Computing stuff tied to the physical world

LCD Plug prototype

In Hardware on Sep 24, 2009 at 00:01

For one of the numerous projects here at Jee Labs, I’m going to need a little 2×16 LCD panel hooked up to a JeeNode. Time to get the breadboards and jumpers out:


On the left is a breadboard-friendly 5V power supply.

The chip is an MCP23017, which is a 16-bit GPIO expander for the I2C bus. For the LCD, I only need 8 pins but this particular project needs a few more, hence the MCP23017 i.s.o. of the MCP23008. What’s the project? Well, for now let me just say that it’s about Volts and Amps (no, not because it’s an electrical circuit).

Here’s the MCP23008, as originally planned for use with LCD panels:

Picture 2.png

The chip is running at 3.3V, matching the I2C bus, but the LCD is powered at 5V. This should not be a problem since all connections on the LCD are inputs, and a 3.3V “high” level ought to be sufficient as 5V “high” level as well. The PNP transistor for backlight control¬†will need a second resistor between B and E, though.

Next step is to come up with code for this I2C setup!

  1. I Could be wrong, but I thought these LCD panels (mine are still in transit from the UK) would run on four IO ports as well as on eight.

  2. Yes, 4 data pins (D4-D7), plus ENA/RS/RW. Bit 7 is used for backlight power on/off. RW is not needed actually, so with at least 6 output lines you can drive a character LCD in 4-bit mode.

  3. How about replacing the “dumb” port extender by an ATtiny (e.g. 26 or 2313) of the same price range?

    Putting the low-level stuff into the Tiny would allow for a more efficient data transfer between the plug and the JeeNode. Add some buttons to the LCD plug and you can create the i2c equivalent of a serial terminal with very low demand on the host side.

    • This is indeed an interesting idea, although it would require developing firmware for one specific case. I do have some ideas on a similar approach, but they are too rough to start describing them now.

      I’ve started extending the LiquidCrystal library to also handle the I2C-connected display – looks like it’ll be relatively easy to do. To send one character to the LCD will require sending 5 bytes over I2C (including addressing). The result is as easy to use as the Serial class, since LiquidCrystal also has all the different print()/println() functions mixed-in.

  4. Hallo at all ! why so difficult ? There is an solution with an 2 wire interface for such lcd’s ! it is solved with an 4094 . see on it is for the atm18 project from elektor. k.r. Thomas you only need two wire’s , #clock and #data

    • What you’re proposing is a simple shift register. Not so very different from the I2C extender solution – but with I2C you can daisy-chain multiple plugs on those same 2 wires…

Comments are closed.