6
http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/ Food Living Outside Play Technology Workshop Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pins by bitterOz on April 8, 2012 Table of Contents Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intro: Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 1: Required Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 2: Stripboard Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 3: Soldering Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Step 4: Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Step 5: Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Step 6: Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Aurdino Hookup

Embed Size (px)

Citation preview

http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/

Food      Living       Outside        Play        Technology       Workshop

Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pinsby bitterOz on April 8, 2012

Table of Contents

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

Intro:   Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1:   Required Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2:   Stripboard Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3:   Soldering Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 4:   Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5:   Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 6:   Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/

Intro:  Hookup an LCD to an Arduino in 6 seconds with 3, not 6 pinsAdding 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 notleave 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 downto 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 aribbon 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!

Step 1: Required ComponentsThis is an extremely easy board to make and should take you no more than 15 minutes to solder up and have running.

Component List1 x 74HC595 Shift Register1 x BC547 NPN (or MOFSET or similar NPN)1 x 10k Trimmer Potentiometer6 x Male headers (I used right angle connectors)16 x Female headersStrip/Vero-board 17 strips x 13 holes (I used 15 for cable support)Hookup wireYour soldering kit

http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/

Step 2: Stripboard Preparation!! Remember, you are cutting the other side of the breadboard so you need to cut the INVERSE of these graphics. A simple way to get this right is todownload the image, flip it horizontally then use it as your cutting guide. !!

There are 18 cuts in total you need to make on your stripboard.

To cut the tracks of these boards you can use a "track cutter" which is available from most electronic component retails, use a drill bit or knife to cut across them or bringout your trusty Dremel and use one of the myriad of tools they have for doing this.

The board size needs to be, at minimum, 17 strips x 13 holes. That said, I used 15 holes to give my cables some extra support.

Double check all track cuts for bridges!

http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/

Step 3: Soldering ComponentsNow comes the fun part of soldering all the components. The attached images will help you place each of the wires and components easily. These are "top-view" images,i.e. your board should look exactly the same from above.

Start by soldering the wires first.Then the 74HC595 Shift Register, Potentiometer then the NPN.Lastly, solder in the headers.

The NPN collector pin has been bent backwards slightly and is placed behind the base pin. This is easily seen in the second image.

Double check all track cuts again and your soldering for bridges!

Step 4: ConnectionsOverview the entire board (again) for any bridges to ensure there are no short circuits.

Now it is time to connect this up and test it.

Connect the power (5v and ground).Connect the wires to the shift register, if you use the library as default you will connect Green to Arduino Pin 7, Blue to Arduino Pin 8, Yellow to Arduino Pin 9.

The pin between Green and Blue is not used. It is placed there to enable 4-pin connectors if that is the cabling you have and to make soldering much easier (trying tosolder 1 pin then 2 pins is painful).

Next attach the LCD so it covers the board - this will ensure you are connecting it the correct way.

Contrast is adjusted using the Potentiometer.

http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/

Step 5: SoftwareThe method of using a shift register to drive these displays with only 3 pins seems to have originally documented by Stephen Hobley. He did a great job of adjusting thebuilt-in LiquidCrystal Library so it works brilliantly with the 595 Shift Register, you need to download his latest code . It is feature complete and should be a drop-inreplacement for any project you already have.

Here is the test Arduino sketch to show you how to use the new library, replacing the LiquidCrystal 6-pin with a great 3-pin version.

--------------------COPY BELOW HERE--------------------/** 3-pin Arduino interface for HD44780 LCDs via 74HC595 Shift Register* by Rowan Simms [email protected]* Licence: Creative Commons - Attribution.* Full Documentation and Description: http://rowansimms.com/article.php/lcd-hookup-in-seconds** This sketch allows Arduinos to use a shift register to control an LCD, allowing* a reducation in pins it requires from 6 to 3 while still retaining full control* including backlight on/off.* This requires the use of the LiquidCrystal595 library from Stephen Hobley* available at: http://www.stephenhobley.com*/

#include <LiquidCrystal595.h> // include the libraryLiquidCrystal595 lcd(7,8,9); // datapin, latchpin, clockpin

void setup() {lcd.begin(16,2); // 16 characters, 2 rows

lcd.clear();lcd.setCursor(0,0);lcd.print("Wow. 3 pins!");lcd.setCursor(0,1);lcd.print("Fabulous");}

void loop() {// not used.}--------------------COPY ABOVE HERE--------------------

Copy this in to a new Sketch after installing the library and upload to your Arduino.

You should now be basking in the glorious glow of your LCD.

Step 6: ConclusionThis shield really does allow you to use just 3 pins of your Arduino to drive an LCD display - and it takes less than 6 seconds to connect it up.

Don't want to commit to a shield just yet? Wish to do this with only 3 components and breadboard?I understand that you may not wish to make a shield before trying this method out - that is completely understandable. For you, I have this documented for breadboard stoo. Sure, you will have to deal with more hookup wire, but it gives you a great way of at least trying this 3-pin method without any soldering. That layout, more code andwiring explanations are available from http://rowansimms.com/article.php/lcd-hookup-in-seconds

That's it. Enjoy your sub-6-second hookups!

http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/

Related Instructables

ATTiny45/85LCD displaycontrol with ashift register,programmed inArduino bybaharini

Display supersized font onHD44780 20X4characterdisplays withArduino (video)by liudr

LCD Shifter forArduino byGusPS

Connecting anLCD to theArduino bycrocboy

Arduino with4x20 LCD andLCD Smartieover USB (video)byFrancisShanahan

Truck Lane - a16x2 LCDArduino game(video) by thedod

Comments

1 comments Add Comment

 Bongmaster says:  Apr 8, 2012. 12:22 PM  REPLYneat :)