Monday, August 26, 2013

Raspberry Pi and the Nokia 5110 LCD: contrast value is important

There comes a time in every tinkerer’s life that you think of a project for which a small display device would be a nice addition. Think of displaying a temperature, the time, status ‘on’ or ‘off’, etc.

It is of course easy to go to Adafruit or Maplin’s and order an LCD and for roughly $20 you would get something useful. Plus shipping naturellement.

I happened to stumble on the blog of scruss and his Quite Rubbish Clock. He uses a Nokia 5110 LCD, a 1.6” device. I believe these are surplus from old Nokia 5110 phones from around the year 2000. I had me one of those phones, nothing fancy but very reliable. The first text message I ever received was on it!

Anyway, I searched around on dx.com (Deal Extreme) and ordered 3 of these displays for the grand price of $16.20. Wait a few weeks for them to arrive and voila: time to play.

I followed the installation instructions contained in scruss’ blog. I won’t repeat them here.

However, when I ran my first test, the back light came on but then: nothing. After checking and rechecking my wiring, re-installing the software and still nothing, I decided to browse the Raspberry Pi forums to see if anyone had any advice. After a few fruitless hours, I found that the right contrast value of the display is crucial to its ability to display something.

User ‘bgreat’ on the Raspberry Pi forum had written a Python class to make using this device possible (NokiaSPI.py). User ‘pest’ on the same forum had enhanced this class even further to the point where, if the class is run as ‘main’, it goes through a number of self tests, which I think test every possible scenario. So I downloaded that version and am using it for my next project. Which, by the way, is almost ready for public showing…

1 comment:

Zoth-Ommog said...

Thank you so much - your post saved me from a lot of frustration.