May 052011
 
LCD and Arduino

Driving a LCD from an Arduino is no problem at all. There are nice libraries doing this. I bought a slightly different display which uses an I2C interface instead of the usual 4 or 8 bit parallel interface. Since I connected recently the Wii Nunchuck which uses I2C too to my small Arduino board, the next logical step was to add the display too. After all, I2C is all about adding devices to a 2 wire bus.

There was only one small problem: I2C LCD is not supported natively by the Arduino library system. But someone (and I really do not know who as the amount of comments was limited) created a library for Arduino here. All I can say about the author is that he (or she) is using a Mac and probably Japanese since I found a Japanese comment. This library was a great starting point, and although it was not complete and quite some functions were commented out with a “Does not work”, they worked out fine after I replaced them with what I thought should be here according to the data sheet of the used controller (ST7032i).

Now I have connected to my Arduino:

  1. Wii Nunchuck (2 button, 3 axis accelerometer, analog joystick)
  2. LCD (2 lines with 16 characters each)
  3. Servos (like those)
  4. A 12V fan which can be controlled via PWM to change its rpm
  5. LEDs of course
  6. 12V relays

If anyone wonders what the goal here is, for those I can only say: “Der Weg ist das Ziel” by Confucius.

Next on my list:

  1. RTC via I2C so the Arduino knows what time it is
  2. A piezo buzzer
  3. More sensors, like temperature, humidity, light etc.
  4. Another uController via I2C

With the first two I can make an alarm clock. Not that I would need one…