Raspberry Pi LCD Backlight Issue

One of the cheapest ways of adding a basic display and keys to a Raspberry Pi is using one of the Adafruit clone 16x2 LCD with keypad "hat". This simple board consists of a 16x2 character LCD with 5 buttons all of which is driven through 2 main data lines facilitated with I2C and a MCP23017 (port expander).

16x2 Character LCD Hat with Buttons

Now, I bought one of these hats a while ago to play with and was quite impressed with its simplicity, however I did come across a "bug"/"limitation" in that the Adafruit Library did not cater for Back-light control. I did manage to alter the code to allow this functionality and all was well with the world.

In a recent project however in which I needed to setup 10pi's with display and buttons I found that no matter what I did I was unable to switch the Backlight off. Instead the backlight remained on and bright as long as power was supplied to the hat. After checking and rechecking my code I was forced to break out the soldering iron and start dismantelling the hat to get to the bottom of this mystery.

After probing around with a Multimeter and removing the LCD and the the backlight 1k ohm resister I finally arrived at a discovery:

LCD Issue

Can you spot the issue? Hidden away under the silkscreen of the 1k ohm resistor is a small trace that connects the Blacklight driving resistor to ground causing the LCD Backlight to remain on permanently.

The fix was simple, using a craft knife, slice away and break this connection:

LCD 16x2 Fixed

And viola, you can now control the Backlight again.

The one point to note though is that this must have been added as the adafruit libraries did not support backlight control and the manufacturer just thought it a pain to have people complaining about dimmly lit displays. To resolve this, this "bridge/connection" to ground forced the backlight to maximum brightness at all time. When cutting this away you are able to control the backlight but the "on" state the MCP is only able to sink current such that the backlight is at half the intensity as with the bridge.

Hope someone finds this useful!

Network Manager From Source on Raspberry Pi

I have compiled and installed many packages from source but I must admit Network Manager (NM) threw me a curved ball that had me debugging for 3 days.

My Pi 3 with stretch allowed for installation of the ver 1.6 line of NM through standard apt-get. However when using standard NM and Modem Manager (MM) on the pi, I faced an issue with connective. The modem would either not connect or disconnect a while after successful connection. I decided to update NM as a last resort as I was unable to pin point any issues.

Firstly there was alot of libxxx-dev packages that are prerequisites, some of which I maneged to pull from my history:

sudo apt-get install gtk-doc-tools autopoint intltool gio-unix libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libudev libudev-dev gobject-introspection gobject-introspection-dev libgirepository1.0-dev libnl-3-dev uuid-dev libnss3-dev ppp-dev libjansson-dev curl-dev libcurl4-openssl-dev libndp-dev libreadline-dev python-gobject-2-dev python-gobject-dev libnm-dev libnm-dev libmm-dev libmm-glib-dev

I then downloaded the source for the 1.8 line and followed the following process:

./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var -enable-wifi --enable-ppp --with-modem-manager-1
sudo make install

Once this was complete I finally have a working copy of NM on v1.8