Computing stuff tied to the physical world

LCD Plug

In AVR, Hardware, Software on Nov 1, 2009 at 00:01

Here’s the new LCD Plug:


It’s a little piggy-back board for standard LCD modules with 16-pin connectors. The middle 4 pins are not connected, so that two 6-pin male headers are in fact enough to hook this board up to the LCD.

Here is a setup using a 2×16 character display:


The interface uses I2C, so this “plug” can be daisy-chained like all the others. The plug uses an I2C expander chip with a fixed I2C address of 0x24. There are two jumpers to select the voltage level for driving the logic supply and the backlight, respectively. The backlight can be turned on and off under software control.

A generalized version of the LiquidCrystal library included with the Ardiuno IDE 0017 is used to redirect the actual interface through a bit-banged I2C bus, using the Ports library. This was described in an earlier post. Details about how this code works are also available, see this post.

The latest Ports library now includes the new code, including the “lcd_demo” example as shown above:

Screen shot 2009-10-31 at 16.06.14.png

The only difference with the LiquidCrystal example is the definition of port 1 as I2C bus, and defining the “lcd” object to connect to the display via this I2C bus.

  1. Can I ask what parts you are using for those connectors? I’ve been looking for exactly such a setup, I think.

    I assume that the cable is F/F to mate with the male headers on each board. If so, do the wires get soldered in to those connectors, or are they connected via a crimping tool?



    • The cable I’m using is F/F with an extra long M/M 6-pin header inserted to turn it into a M/F extension cable (the plugs are male, the JeeNode headers are female). A bit convoluted. The cable ends are called Du Pont connectors, I think.

      I’m having a bunch of slightly shorter custom 150 mm cables made this very moment, with crimped-on M/F 6-pin connectors. IMO such cables will be very convenient while experimenting as well as when mounting a setup in a more permanent enclosure.

      There – how’s that as sneak preview for what I hope will soon lead to a new weblog post :)

  2. Cool, Congrats JC!

    Would future versions allow the address to be changed?



    • I didn’t want to make things too complicated, there are already 3 jumpers on the board. Multiple LCD’s can be handled by placing them on different ports. Or is there a need to add more jumpers?

  3. Four should be enough for everybody…

    Then again, didn’t they use to say that for 640k as well ;)

    You are right, in the off chance that someone needs more then 4 of them, or needs to put them on one port, he/she can probably figure out which pins to short on the I2C controler.

  4. I have some “big” lcd dispays 2 x 20 backlight current consumption is 360 mA ,but I think 200 mA will work, how much current can the transistor handle ,with or without resistor 10 ohm. ?


    • I’m using a 2N3904 (SOT-23), looks like it can sink about 200 mA. Maybe there’s a MOSFET with the same pinout which can go higher? The other option would be to connect BK- (pin 16) directly to GND (pin 1), bypassing the transistor altogether (and keeping the backlight on all the time).

  5. I’m going to try the BC817, it goes up to 500 mA.

    • Ok, I’m switching to BC817 for all new plugs. Should be able to control heftier backlights. Or a small motor, if you prefer ;)

Comments are closed.