LCD Header PCB

Most of the time the average microcontroller development boards have no quick and easy way to interface an LCD screen. In both 4 and 8-bit modes it can be awkward to connect the LCD without having wires going everywhere if there is no 16-pin LCD header readily available. While debugging can be done by blinking a light, using RS232, or even in-system (eg, JTAGICE for Atmel AVR), I’ve found that the easiest way is to output text to the LCD. Toggling a pin to blink an LED requires a lot of LEDs or complex blinking algorithms in order to be of any real use when dealing with more than a byte of data. Using the LCD, any piece of data you would like to keep an eye on is possible to view in real-time. There is no bulky and expensive programmer or debugger, nor is a PC interface required to receive output.

Some Considerations

If a 3.3V microcontroller is used to drive the output data pins then an additional 5.0V step-down voltage regulator and a pair of capacitors will be needed (assuming an input voltage of greater than 6.5V is used). While some of the Hitachi LCDs can run with an input source voltage between 2.7V and 5.5V (specifically the model HD44780U), it turns out that the screen I own (HD44780S) only has the ability to handle a 5V input. Keep this in mind when creating your own schematic and PCB files in whatever circuit CAD program you use.

The Schematic

Looking at the schematic it can be seen that this circuit is not challenging to understand but provides all the necessary components to let the LCD work easily with minimal wiring mess. In the upper left hand corner The standard pinout for the Hitachi can be seen — even though pins seven through ten aren’t used by the 16-pin LCD header due to the this board being specifically built for four-bit mode.

Input Port

The input port from the microcontroller is the first place to start. A standard eight-pin header is used here because most 8-bit microcontrollers use eight pin ports and on development boards that is generally how the pins are pulled out. While the eighth bit may still be used for I/O, I’ve found that for the most part I usually dedicate the entire port to LCD operation. Most likely reason being is that I have an abundance of eight-pin cables lying around the lab and it is just easier to make sure I give ample room on the PCB so that using a eight-pin cable is possible without encroaching on other components.

5V Step Down Regulator

A 7805 is probably the easiest to use and cheapest linear voltage regulator around. There’s no shutdown or enable pin required and it only costs about $0.35 from Jameco (PN: 51262). It also serves three purposes on the board. First, my particular LCD model (S) runs on 5V DC so attaching the output of the 7805 directly to pin two of the LCD header takes care of my input voltage requirements. Second, if I were using the U-model LCD and had an low-power input voltage of 3.3V it would be necessary to create a negative voltage between -0.7 and -1.4V so that the potential voltage differential between Vcc and Vo is greater than about 4.0V in order for the contrast to work. This circuitry, depending on how it is implemented, can cost more PCB real estate and can actually cost more in components than putting in a 5.0V regulator. This is a moot point if the overall input voltage is not higher than 7V because without a Vin of 7.0V the regulator will not respond and thus will not give a regulated 5V output. In any case, the third and final purpose of the regulator is to isolate the current draw on from the LED backlight. Most LED backlights will pull about 120-150 mA of current when turned on. This current draw can sometimes be too much for a development board voltage regulator which normally supports up to 750 to 1000 mA. This may sound like ample current overhead, but if other components are also being used it is a good idea to isolate the LCD just to prevent any possibility of blowing the regulator on the microcontroller board.

Alongside the regulator are two polarized capacitors — one between Vin and ground, and the other between Vout and ground. The pair of caps will reduce transient noise in the input and output signals. I generally use a 22 μF electrolytic capacitor on the input and a 47-470 μF capacitor on the output.

Note that when the input voltage is large (greater than 12 or 15V) or when the voltage regulator is sourcing a good amount of current the chip will get very hot to the touch. If the chip gets extremely hot with no load then there’s a good chance there is a power and ground short somewhere on the board.

Contrast Adjustment Potentiometer

In order to adjust the contrast of the LCD characters, a potentiometer is used. Generally, here I use a 1 kΩ but a 10 kΩ pot works well, too. Anything larger than that and the contrast resolution suffers as a result.

LED Backlight for the LCD

Most common LCD screens have a backlight — either electroluminescent (EL) or a light emitting diode (LED). EL backlights require the use of an inverter to be used. This is yet another component that needs to be added so I usually opt for the LED backlights. As can be seen on the schematic, I chose two resistors in parallel. I did this because I was looking for a resistance between 3 and 6 Ω and it is cheaper to buy two 10 or 12 Ω resistors and put them in parallel than it is to find the even smaller equivalent resistors. Keep in mind that some LCD panels already have surface mount resistors built onto the circuit board. If this is the case there will be a jumper that needs to be soldered together and then no external resistor are needed to limit the current flow.

Power Headers

There are two sets of power headers — one for the input voltage, VDC, and the other for 5V, VCC. They don’t need any more explanation other than why is it three pins? That way any kind of connector provided it in put onto the header and not slightly off will always have the positive voltage on the middle pin. It helps to eliminate the stupid mistakes when hooking up to a development board or power supply.

The PCB

Downloads

Schematic:

PCB:

2 Responses to LCD Header PCB

  1. manoj gulati says:

    hello sir , I am a beginner at avr uc .i had worked on atmega 16 but I used cvavr ide for coding … Can you tell how can I interface a graphic lcd to atmega … Is it possible through spi.. Protocol interfacing? Plz tell way for programming in that case…..

  2. Matt says:

    Hi Steven,
    I’m trying to use a 3.3V microcontroller to control my LCD, and having some problems making it work. Can you describe how I would add the additional 5.0V step-down voltage regulator to make this work properly?

    Thanks,
    Matt

Leave a Reply

Your email address will not be published. Required fields are marked *