Getting Things to Talk: Arduino + LCDs

I spent the better part of the day on Saturday doing some more basic research into connecting an Arduino and LCD for this ongoing project. For the most part, it’s pretty basic and following the wiring diagrams and tutorials online is fine.

I ran into a problem with getting text on two lines, which I’ll detail below. Next on the to do list is to order a different LCD, maybe a 4×20 display and maybe something even smaller and then do some work on the text processing part of this whole thing.

Overall, it was a good start and I’m anxious for later this week when I’ll have a block of time to continue with the next steps in this early research.

First thing after pulling this stuff out again, I followed the wiring diagrams and I connected the data wires, leaving the power and ground until the end.

An initial sketch. Really, really basic “hello, world!” program. However, this was before I installed the newest version of Arduino, which is why that error came up.

Installing version 0017 helped and I finished connecting the LCD.

It’s not ideal, but quick and dirty. Also, it seems like there are better screens out there in terms of connections.

The arduino side of things.

I figured that it would be better to not be so tightly tethered to the Arduino, so I used the breadboard.

Trying to make connections a little cleaner.

My first program, working!

All the wires, still a mess, but I was just too anxious to get something on the screen.

BROKEN CITY LAB!

Then I worked on another program that would flash different texts.

This one switched between BCL and make things happen!

Here’s the code, trying also to change the position of the cursor, which didn’t work as anticipated because I didn’t initialize the screen with lcd.begin().

I switched the wiring around to try to figure out how to get text on two lines.

I also connected the backlighting.

Lots of confusion, I just couldn’t get two lines to work, so I went back to one line. I had momentarily wondered why I couldn’t get any decent contrast on the screen when trying to use two lines and the lcd.begin() line in my code.

I wondered if it was just my poor connections, so I tried a bit of soldering, but it didn’t help.

I went back to the drawing board, trying different wiring set up again.

Still not the effect I wanted.

I can’t seem to get the correct contrast when using the lcd.begin() line, that is to say that at a very severe angle it’s possible to read the screen, but under normal viewing it’s no where near what it should be (as pictured above). I didn’t post a picture of that because it basically just looks like the backlight is on with nothing on the screen itself. I couldn’t find an answer online, so I’m going to try this again with a different LCD. Although it could be a number of other things, this seems to be the simplest way to move forward. All these screens are based on the Hitachi HD44780 LCD, so it shouldn’t be an issue, but I’m not sue what else could be causing the problem at the moment… As frustrating as it can be sometimes, I think troubleshooting is where I learn the most.

Here’s a bit of an annotated bibliography :

http://www.arduinoprojects.com/node/13 (for whatever reason, this was the most successful wiring setup, though I have my suspicions that I messed up the contrast at some point due to my shoddy and impermanent wiring)

http://arduino.cc/en/uploads/Tutorial/lcd_schem.png (a diagram for the wiring setup recommended on the Arduino site)

http://www.jamie.net/tag/arduino/ (a quick example of using the 4-bit LCD library, I haven’t tried it)

http://dawes.wordpress.com/2009/12/23/twitter-to-lcd/ (interesting project connecting twitter and Arduino)

http://blog.tinyenormous.com/2008/12/02/arduino-based-rss-reader-with-lcd/ (lots of interesting projects, hooking up Arduino + Twitter and Gmail + Arduino using Python)

http://www.alfonsomartone.itb.it/kwztcq.html (some helpful troubleshooting stuff)

http://www.arduino.cc/en/Reference/AnalogWrite (analog write, I used this to correct the contrast problem I had)

http://arduino.cc/en/Reference/LiquidCrystal (LCD library for Arduino)

Tagged:

Related Posts: Starting New Projects: Researching the Basics of Arduino + LCDs Arduino + LCD + PHP, Part 2 More Arduino + LCD + PHP fun

Previous: « Next: »


10 Responses to “Getting Things to Talk: Arduino + LCDs”

  1. Jeff says:

    Sweet writeup, I’ve been looking for a good intro to working with LCDs and my Arduino, because I’ve been having the same issues. I’ll be watching to see if you figure it out, yeah? And thanks for the links!

    • Justin says:

      Jeff, glad the post was helpful … I’ll definitely be keeping an ongoing list of links in this series of posts as I figure things out. Goodness knows the Internet has already helped me out huge with this, so hopefully I can contribute back with some knowledge too.

  2. jluciani says:

    You mentioned that you had a problem with the contrast. How are you controlling the contrast pin?
    On my boards I use a pot and the contrast is quite good. Your LCD looks very similar to the Optrex 51505 that I use. The schematic of my board is in the datasheet at http://tinyurl.com/9mv2cs

    • Justin says:

      I tried it two ways — I grounded the contrast pin and I also used analogwrite from pin 5 (if I remember correctly) to do a variety of tests (I figured this was more accurate than using a pot for troubleshooting).

      The problem only appears when using lcd.begin(), regardless of trying to put text on two lines … so, I’m not sure what the problem is with that command (or with how I’ve tried to set things up).

      • jluciani says:

        The analog write is a digitally generated voltage. You need a filter cap to generate a stable DC value. As you draw current from the pin the voltage will drop. With a decent size cap the voltage drop probably would not be much in an LCD application.

        Not sure how lcd.begin() could cause a constrast problem.

        • Justin says:

          Thanks for the help with this … I’ll try the contrast pin with a pot.
          I’m sure it’s a silly mistake on my part somewhere, but it’s really strange, because I can set up an Arduino sketch that simply says write “test”, and it works perfectly fine, good contraste totally legible. Then I’ll add the line lcd.begin(16,2) in the setup and the contrast will be so weak that it’s illegible.

          That line is the only change I make, and whether I ground the contrast pin or try the analog write, it’s results in the same problem.

  3. Michelle says:

    you own

  4. Toaster says:

    I have the same problem…
    One line – working perfect
    Two lines – bad contrast…
    The next try will be to use a negative contrast voltage, hope this will solve the problem…

  5. tinyenormous says:

    Hi justin!
    For the 2 line contrast thing I have run into similar issues before. I recommend using a pot to control the contrast line. Also, depending on how your script is written if you don’t have enough delay() then it will be constantly flickering on and off as it rewrites itself.
    Lastly, as toaster mentioned, some lcds want to have a neg voltage for contrast. That’s never fun to work out. Check the data sheet, and if it does want that I’d just buy a different lcd!

Leave a Reply






Location

Windsor from Google Maps' perspective

Windsor, Ontario (South of Detroit)

Save the City !!!

Broken City Lab: Save the City
5 months of community events to imagine how to save this city.

Participate! March 20th, 3PM

Mailing List


 

Activity

Follow us on Twitter

Conversations

  • Justin: ahhh nice. thanks for the link!
  • darren: adafruit has been selling those for quite a while http://www.adafruit.com/index. php?main_page=product_info&...
  • Justin: Yes, Mark, thanks for the pics and the suggestions for the list, that area around the Casino fell into the sites of apology side...
  • tinyenormous: Hi justin! For the 2 line contrast thing I have run into similar issues before. I recommend using a pot to control the...
  • Mark Boscariol: p.s. pelissier bldg isn’t mine, but I know the guy who bought it
  • Mark Boscariol: Cool, couldn’t make it but I hope you got the pics I dropped off. 3 houses across from casino parking garage...
  • Justin: Sorry we missed you! But, this might not be the last time we do this … I think there are still a lot of places that could...
  • pc: i wish i could have been there. I had a list of places I wanted to add!

Archives

Tags

3D 100 ways abandoned activism advertisements air airport algorithm Ambassador Bridge analog annotate architecture arduino art artist Artspace astroturf automobile awesome balloons banner baskets battery BCL Bench bicycle bike bikes billboard bio biodegradable Blog book books border bridge buildings bus Canada car cellphone chalk Chattanooga Chicago cities city citynoise code collaborative collective community computer computers conference Conflux consultancy context costume create here crisis cross-border communication crowd-sourcing data database demo design Detroit development DIY documentary documentation downtown drawing driving ecohouse economy EC Row editing electricity electronics energy environment eric boucher event exhibition exploring extended field trip eye fake fashion fence field test fieldtrip fire firefox flagging tape fuel efficiency gallery game garbage garden gardening geography google google earth google maps graffiti grants grass green Green Corridor guerilla hack hacking Halloween hardware history house housing how to HQ ice ideas image inflatable infrastructure install installation inter-city interactive internet intervention interventions interview ironing knitting LCD Lebel LED light lights list lists magnetic magnets make making mapping maps materials math message michelles Michigan micro-residency mind map monitoring moss movie music naturalized area nature neighbourhood news newspaper newspapers New York new york city night noiseborder office hours open source opportunity paint painting paper paperwork parade paranoia park parking ticket parks participation party pedagogy performance perspective Peterborough photography PHP physics pixel planning plans plant planters plants plastic bags politics pollution presentation printers project projection projector projects psychogeography public public art public domain public realm public space public transit pulp radio Rain reading reblog recycle remote research residency resistors restaurant reuse ribbons river roof rope safety Sandwich Sao Paulo Save the City school science screening sculpture sculptures seed bombs seeds sign signage snow social practice software soil soldering sound Soundart space spray paint stencil stencils stickers story strategic plan street street art street art strike submissions suburb surveillance sustainability sustainable tags talk tea technology test tetris text Text In-Transit time-lapse tools Toronto transit transmit transplant travel tree trees tshirts tunnel tv university urban venues video visualization walk wall water Waterloo website wheat paste wildflowers Windsor youth youtube

Our Recent Research

Research Description

Broken City Lab is an interdisciplinary creative research group that tactically disrupts and engages the city, its communities, and its infrastructures to reimagine the potential for action in a collapsing post-industrial city.

Call for Submissions

Broken City Lab: Storefront Residencies for Social Innovation
The Storefront Residencies for Social Innovation invites the radical re-imagining of the possibilities in occupying a vacant storefront in the heart of Windsor for one month. Apply now!

Subscribe

Broken City Lab RSS icon Blog RSS

Broken City Lab RSS icon Comments RSS

Events

Sing to the Streets March 20, 2010, 3pm

City Share Conference in Chattanooga Feb 17 - 20, 2010

Sites of Apology / Sites of Hope Sunday, Feb 28, 2010, 1pm

Public Realm at Propeller Centre for the Visual Arts Jan 20 - 31, 2010

Save the City: Listen to the City Sunday, Jan 24, 2010, 8pm

» More Events...

Cross-Border Communication

Cross-Border Communication: We're In This Together
Cross-Border Communication is an interventionist performance series based on the desperate need to communicate with Detroit from Windsor.

Most Read Posts

Contact

info@brokencitylab.org

Bookmarks

What We're Reading

Links

Meta