Swap With Dell 9300

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, September 28, 2011

InduinoX: Interfacing with LCD

Posted on 12:23 AM by Unknown
After my quick Hello World app, I became a bit more adventurous and decided to interface with the LCD screen that was part of the basic kit from Simple Labs (see this post for more details). Fortunately, arduino has a library called LiquidCrystal to interface with LCD displays that are driven by Hitachi HD44780 compatible drivers. All you have to do is add a #include <LiquidCrystal.h> in your code to start using the library.

But before going into the coding part, I had to first make the proper connections from the LCD display to the arduino board. I looked up the datasheet for my LCD display, but found a much simpler connection diagram over at http://www.arduino.cc/en/Tutorial/LiquidCrystal. I did not make the exact connections like in the diagram. This is what I did

LCD                            Arduino
PIN 1 (GND)                    GND
PIN 2 (Vcc)                    +5V
PIN 3 (Contrast adjustment)    Voltage divider (see below)
PIN 4 (Register select)        Digital PIN 13
PIN 5 (R/W signal)             GND
PIN 6 (Enable signal)          Digital PIN 12
PIN 7 (Data bus line)
PIN 8 (Data bus line)
PIN 9 (Data bus line)
PIN 10 (Data bus line)
PIN 11 (Data bus line)         Digital PIN 11
PIN 12 (Data bus line)         Digital PIN 10
PIN 13 (Data bus line)         Digital PIN 9
PIN 14 (Data bus line)         Digital PIN 8
PIN 15
PIN 16

Pins 7, 8, 9, 10, 15 and 16 are not connected to the arduino board. Pin 3 was supposed to be connected to a 10K pot, but since I did not have a pot, I had to do a voltage divider circuit. I tried out 1K, 10K divider circuit, with output of the 1K ohm resistor connected to pin 3. This gave me the correct contrast! Although the LCD display has 8 data lines it can be driven with only 4 lines with a lower refresh rate and the arduino library can communicate over the 4 lines. Now that the connections are done, back to programming.  Here is the code

#include <LiquidCrystal.h>

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

void setup() {


  // Setup LCD's number of columns and rows
  lcd.begin(16, 2);
  
  // Print a message to LCD
  lcd.print("hello");
}

// a function which executes again and again
void loop() {
}

Very simple app that displays "hello" on the LCD screen.


If you want the backlight of the LCD screen to turn on, connect pin 15 to +5V with a limiting resistor and pin 16 to ground.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in arduino, electronics, home automation, lcd | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • InduinoX: Interfacing with LCD
    After my quick Hello World app , I became a bit more adventurous and decided to interface with the LCD screen that was part of the basic ki...
  • Scopes and electronics
    An oscilloscope is very important for any electronic enthusiast. Recently I have been trying to send IR remote codes from an arduino board ...
  • Dell Recalls Batteries
    Ahh the news could not have come at a better time. I was having problems with the battery that came with my Dell Inspiron 9300. Just 7 days...
  • XBMC / Boxee remote control android app
    I have been writing a few android apps over weekends at home and during 20% time at Google. However I never actually released any of them in...
  • Elisa problems marshalling MediaUri
    The short version If you are having problems with elisa not playing your local media files (see https://code.fluendo.com/elisa/trac/ticket/9...
  • nVidia ION for HTPC
    This is an exciting time for buying HTPC devices. They come in really small sizes, they are efficient and yet can playback 1080p video and b...
  • Purchase experience with Probot
    I have recently posted my purchase experience with Simple Labs . This post is the continuation of that. That same day I ordered these compon...
  • IR remotes
    As part of my  home automation project , I also wanted to control my home entertainment system. The controller can be a web interface or an ...
  • gtkdocize not found
    If you are ever configuring an app and see the message "gtkdocize not found" in Gentoo, then you need to emerge gtk-doc. I had som...
  • Testing AdSense and Getting Things Done
    Working in Google and not having an AdSense account is not cool. So I created an account and added the AdSense page element. Looks good. Alt...

Categories

  • 555 timer
  • arduino
  • delay circuit
  • electronics
  • gentoo
  • home automation
  • induinox
  • ir emitter
  • ir receiver
  • ir remote
  • kubuntu
  • lcd
  • ldr
  • leds
  • lucid lynx
  • oscilloscope
  • picoscope
  • probots
  • receiver
  • relay
  • relays
  • scope
  • sensors
  • simple labs
  • sony remote protocol
  • transmitter
  • virtualbox
  • virtualization
  • wireless relay

Blog Archive

  • ▼  2011 (12)
    • ►  December (1)
    • ►  November (1)
    • ►  October (6)
    • ▼  September (4)
      • Purchase experience with Probot
      • InduinoX: Interfacing with LCD
      • InduinoX: Blinking LEDs
      • Purchase experience with Simple Labs
  • ►  2010 (5)
    • ►  May (1)
    • ►  March (1)
    • ►  January (3)
  • ►  2009 (10)
    • ►  December (5)
    • ►  November (3)
    • ►  May (1)
    • ►  April (1)
  • ►  2008 (29)
    • ►  August (1)
    • ►  June (1)
    • ►  May (4)
    • ►  April (1)
    • ►  March (1)
    • ►  February (10)
    • ►  January (11)
  • ►  2007 (7)
    • ►  May (5)
    • ►  April (1)
    • ►  March (1)
  • ►  2006 (8)
    • ►  November (1)
    • ►  October (3)
    • ►  September (2)
    • ►  August (2)
Powered by Blogger.

About Me

Unknown
View my complete profile