Instructables
loading
loading

Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pins

Picture of Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pins
completed-top-view-sml.jpg
Adding an LCD display to Arduino projects can add real value but the cost of doing so can be significant. Not a financial cost - you can pick up 16 (characters) x 2 (rows) LCD for as little as £3.50. The cost is the pin count it can take to drive them. Using the built-in LiquidCrystal Display library it can take as many as 6 pins! That does not leave much for your sensors, motors and other components.

There are many projects that discuss using alternatives - such as a much more expensive Serial LCD (£10 up). Other projects discuss using two-wire interfaces, increasing the complexity of your code. The simplest way to drive the HD44780 style LCDs, in my opinion, is to use a 74HC595 shift register, taking the pin count down to 3.

In any case, connecting an LCD either using the 595 Shift Register or the more traditional way takes a lot of wiring which is not only a super mess (unless you use a ribbon cable I guess), it takes time.

This shield is simplifies this process - all that is required is power and three wires back to the Arduino - ie. connect the LCD in under 6 seconds!
 
Remove these adsRemove these ads by Signing Up

Step 1: Required Components

Picture of Required Components
This is an extremely easy board to make and should take you no more than 15 minutes to solder up and have running.

Component List
    1 x 74HC595 Shift Register
    1 x BC547 NPN (or MOFSET or similar NPN)
    1 x 10k Trimmer Potentiometer
    6 x Male headers (I used right angle connectors)
    16 x Female headers
    Strip/Vero-board 17 strips x 13 holes (I used 15 for cable support)
    Hookup wire
    Your soldering kit
1-40 of 97Next »
I have this running great from an ATtiny85. It also has a TMP36 temp sensor to desplay the current temperature. LCD uses pins 0, 1, 2 and TMP36 uses pin 3.
Here is my version. Thanks, it was a fun project.

Hi, please where did you buy this stripboard? It was online? I just found another version with independent holes, different of yours... Sorry my English, thanks!

bitterOz (author)  matt.e.jenkins2 years ago
That is fantastic Matt. Really nice work.

Being in London, I feel those cold mornings too.

Thank-you for sharing.
R
Hey thanks bitterOz. I gave your instructables page props in the description of the above video and in the prototype video http://www.youtube.com/watch?v=1ipJzppZvVk
Thanks again, It was a fun project.
Matt
I'm wanting to build your project Matt. Any chance you could post the modified code for the attiny85?
Hi. Here's a link I made for you.
http://pastebin.com/saZ3ect9
It should contain the code.
The temp sensor I use is a TMP36 from Adafruit.com
I hope this helps.
Matt
Thanks! You should really do an instructable on this, or at the least, draw up a schematic for us noobs and post it in the description of your video.
jimpeachey made it!11 months ago

I finished it! This uses and ATTiny85 replacing the take offs for pins 7, 8,and 9 from the Arduino. I also used pins 3 and 4 from the ATTiny to run two flashing LEDs just to see how it work. This is running off a 4.5v battery pack using AAA batteries. I'm glad i got this done,it's a nice unit!

20140411_195143_zpsvps43hmv.jpg20140411_195211_zpsrbb79uhw(1).jpg
bitterOz (author)  jimpeachey9 months ago

Brilliant stuff Jim. Looks great.

asimbhuta3 days ago

Okay so I've tried to build this on a breadboard and I have deleted the original liquidcrystal library, but I still get black boxes on the first line of the lcd. I cannot get it to print anything... Any ideas?

Hello! The project presented here is not working as is presented here,
if you will follow this instructable. I had the same problem like you,
and it seems that "copy-paste" method on ALL pages that describe this
metod, have the same issues. The problem can be solved if you put data
pin (wich goes to the arduino) on shift register pin 14 and LCD no. 6
pin on pin 15 of shift register. The rest is the same. Also, you can
remove the transistor from the circuit and put pin 16 of LCD to ground
(GND) and pin 15 of the LCD to + Vcc (trough a resistor about 1K if you
wish to reduce luminosity).

IMG_20150330_113622.jpg
Build_it_Bob made it!9 days ago

bitterOz,

I built this as per your Instructable and it works nice. I printed out the vero layout sheet as it was a bit confusing at first . I labelled it up and it all made proper sense to me. Everything worked first time as well...thank you for sharing a very useful project !

Build_it_Bob

LCD 3 wires Vero diagram.JPG
mandu221 year ago
Good day!

I tried making the circuit in my breadboard, and I'm 100% sure I built it right.

However, I only get black squares on the LCD's first row as an output. Any ideas? :D
saumyak mandu2216 days ago

hi all, well i was facing the exact same issue, and found out later it was due to a connection problem, with datapin from Arduino connected to pin 15 of Shift Register instead of pin 14 of the same. i was referring to this same article from a different site, http://rowansimms.com/article.php/lcd-hookup-in-seconds and http://rowansimms.com/mediagallery/mediaobjects/disp/1/1_all-connections-bboard-lrg.jpg ..... now here in the schematic pin 15 of Shift Register was connected to Arduino as the datapin, and it was causing all the problems.... just replace it with pin 14, and it works perfectly......

bitterOz (author)  mandu229 months ago
I recently built another one of these shields and noticed that if I had lots of other devices connected to my USB chain I only received the blocks you mentioned.

So I obviously had noise on my power supply lines. The quickest method I used to solve it was to plug my Arudino directly in to the host USB port.

If that is not an option to you, then add 0.1nf caps across the power lines of the shift register and possibly the LCD too.

Of course there is also a simpler explanation - you have your contrast set WAY too high, try adjusting the pent down.
bitterOz (author)  mandu221 year ago
Hi mandu22,

Have you tried:
a) adjusting the contrast?
b) try sending something like
void noDisplay();
void display();
void clear();
void home();
and then writing your text?

I have the same problem of mandu22 and tried what you say and it still doesn't work. Also a schema would be nice as well, I know this is meant for people with no electrical skills but trying to guess where stuff are connected by looking at pictures isn't the best.

bitterOz (author)  mandu221 year ago
I have another idea mandu22.

Remove the existing LiquidCrystal library from Arduino before adding this library. I believe that will solve your problem.
killercatfish2 months ago

Does need the transistor? Just wondering since I never use one when wiring up my lcd's using the breadboard version.

skunkmyrddyn3 months ago

I've built the circuit, but I cannot get the code to compile on my arduino software installation. I get a "shiftOut" not in scope.

I've looked through the code, and while I see the call to the function, I do not see where that function is defined. Is there another library that this one requires that is possibly missing from my arduino installation?

I'm using the most current for the intel galileo, and I know this software setup is a little different due to the modifications for the galileo.

amri.jbi3 months ago

Good day Instructables.com.

May i asking, if i change that control pin (7,8 & 9) to be set own pin (11,12,13) is there affect from that one?
because i have limit I/O pin for my project using UNO..

nicholast24 months ago

Hello good sir! I am wondering of how you do a input with the Arduino UNO as Serial in to go to the HEF4094 chip to a LCR2002ABTAR1-2Y LCD (came from a printer i had) i seen that you made things like these but i cannot find the one for to use serial out from USB or can i use a serial connector from my computers serial port?

whoops.

nicholast24 months ago

Hello good sir! I am wondering of how you do a input with the Arduino UNO as Serial in to go to the HEF4094 chip to a LCR2002ABTAR1-2Y LCD (came from a printer i had) i seen that you made things like these but i cannot find the one for to use serial out from USB or can i use a serial connector from my computers serial port?

nicholast24 months ago

Hello good sir! I am wondering of how you do a input with the Arduino UNO as Serial in to go to the HEF4094 chip to a LCR2002ABTAR1-2Y LCD (came from a printer i had) i seen that you made things like these but i cannot find the one for to use serial out from USB or can i use a serial connector from my computers serial port?

TheLUXY2 years ago
Can somebody tell me how to turn backlight on or off in Arduino (code)?
bitterOz (author)  TheLUXY2 years ago
Hi TheLUXY,

You can turn off the display by calling:
void noDisplay();

Turning it on again:
void display();

Other functions available for you are:
void clear();
void home();
void noBlink();
void blink();
void noCursor();
void cursor();
void scrollDisplayLeft();
void scrollDisplayRight();
void leftToRight();
void rightToLeft();
void autoscroll();
void noAutoscroll();
void createChar(uint8_t, uint8_t[]);
void setCursor(uint8_t, uint8_t);
Actually, when i do this the backlight remains off, but the text appears and disappears.
diy_bloke lobonse5 months ago

not sure which library you are using but for me the commands:
lcd.setBacklight(LED_OFF);
and
lcd.noBacklight();

work

diy_bloke5 months ago

Great project and looks tidy
You mention two wire interfaces and say it makes the code more complex.
perhaps, but most of us use a library for the LCD and then it really makes no difference.
FMalpertida's library is just as easy for 2 wire, 3 wire or I2C.
Have made several 2 wire interfaces and the code looks like this:
#include
LiquidCrystal_SR
lcd(8,7,TWO_WIRE);
// 8 is data pin 7 is clock pin
void setup(){

lcd.begin(16,2); // initialize the lcd

}

void loop(){

lcd.home ();

lcd.print("LiquidCrystal_SR");

lcd.setCursor (0, 1 );

lcd.print("2 wire");

}

needs virtually the same amount of components as a 3 wire :-) (shiftregister, diode, resistor)

http://arduinodiy.wordpress.com/2014/01/12/two-wire-interface-for-lcd/

u9719 months ago

Very nicely presented instructable will definitely make myself a similar board.

jsatch111 months ago

may i change the pin 7 for another?.

the arduino is using a gsm shield which needs pins 7 ,2 and 3

jimpeachey jsatch111 months ago

You should be able to use any pin. The original sketch uses 7, 8 and 9 but 6 should work equally as well.

bitterOz (author)  jimpeachey9 months ago

Correct. Any pin set as an output will work well. You can even use A0-A5 by addressing them as D14-19.

jimpeachey12 months ago

Damn, i built this and it still doesnt work! Im going to re-do the circuit board and try again. I really need this to work as it is going to form the basis for how i display the models i build. Wish me luck. bitterOz, any luck with the ATTiny85 version?

jimpeachey1 year ago

Anyone got any ideas on the ATTiny85 issue please?

bitterOz (author)  jimpeachey1 year ago

Hi Jim,

Let me have a look in this for you over the next day or two.

BitterOz thanks. I'm waiting on some bits to make building the board easier. I'm pretty sure that the ATTiny pins are right and once i get some better connections i'm sure it will be OK. Having an expert check it out for me would be great though. I'm also looking at adding another pot for the backlight. I'll post once i have everything working.

michael_x1 year ago
Re Step2:
Strips are easily and safely cut by enlarging holes with a 4mm drill.
Later steps show there are enough spare holes that can serve as separators.

If you want to enhance your instructable to a foolproof version, you might want to flip the picture and enlarge the "cuts" to isolating holes instead.

BTW: Thanks for this "long term" project ( > 6 sec. ) ;)
1-40 of 97Next »