Published using Google Docs
PoE 2013 - Lab 2 - LCD's and Communication
Updated automatically every 5 minutes

ENGR2210        22 September 2013

Lab 2 - LCD’s and Communication

Due: 3/4 October 2013


  After Labs 0 and 1, you’ve encountered Arduino programming, digital and analog input/output, using libraries, servo motor control, and two-way communication with a PC.


  In this lab, you will expand your familiarity with the capabilities of the Arduino by building a computer-connected temperature sensor and LCD display.  

  When complete, the device will:

  If connected to a computer, it will also:

  Optionally, you could make a nice mechanical case for the system, or add the ability to control the backlight color from the PC (you can set it to any color of the rainbow...)

  Tackle this lab in stages - don’t just try to build everything all at once.  It probably won’t work, and will be much harder for you to debug.

Part A - Reading Analog Sensors, and Datasheets

TMP36 Temperature Sensor

  The TMP36 temperature sensor is a (relatively) easy-to-use temperature sensor. TMP36 sensors have only three pins - ground, power supply, and the reading.  The reading is convertible into a temperature.  Check the datasheet!

Part B - PWM Control of LEDs

1 @ 2x16 Character LCD with RGB Backlight

Current-limiting resistors for Backlight

  LCD’s come in a variety of styles, ranging from the style on your laptop, down to small color LCD’s, to small monochrome LCD’s, to the character LCD you have in front of you.  Character LCD’s are easier to use than graphical LCD’s, but more limited in capabilities.  Rather than displaying arbitrary graphics, the LCD has a preprogrammed set of characters that it can display in each space.  This LCD has space for 32 characters arranged in two rows.  The LCD has a backlight which shines through the liquid crystal, and makes it (much) easier to see the characters.  This LCD’s backlight is an RGB LED, which means we can change the background to nearly any color we want.

  1. Solder pins onto your LCD.  You will need pins 1-6 and 11-18.  You are welcome to solder pins to every spot if you want, though we will not be using 7-10.
  2. Now wire up the LCD.  Start by wiring up the backlight.  The backlight consists of an RGB (Red, Green, Blue) LED, which you can think of as three separate LED’s.
  3. Using analogWrite(), turn on each of the backlight colors in some combination.  Does each color turn on as you’d expect?  Make the backlight orange-ish.

Part C - The Fun Part

1 @ 10k Variable Resistor / Potentiometer for LCD Contrast Adjustment

  Wire up the rest of the LCD.  Follow the tutorial on Lady Ada’s (Limor Fried) website, at

  1. To control the LCD, you should use the LiquidCrystal library distributed with the Arduino library.  Read the documentation on the Arduino website ( to get an idea of what you can do with the library.  The LadyAda tutorial should also help get you started.
  2. Look at the datasheet.  What characters can you display?  Draw a non-English character on your screen.
  3. Make the LCD display the temperature.  Don’t use floating point math. (Hint: Use division and the modulus operator [%] to get whole / decimal degrees)
  4. Now, create a custom unit symbol to display after the temperature, indicating that you are using degrees Fahrenheit.  Alternatively, you can make and use some other custom symbol, like the PoE symbol below. The LiquidCrystal createChar() method will allow you to define up to 8 custom symbols.  You may want to look at the LadyAda tutorial for a helpful online utility.
  5. Add a button for switching from Celsius to Fahrenheit on the display.  Make sure you debounce the button!  You may want to define a new unit symbol as well.

Part D - Controlling from the PC

  Finally, add the ability to control the LCD from the host computer.  You can use any programming language you’d like, though Python+PySerial is Chris’s recommendation.


  Please hand in a lab report at the completion of this lab.  Your report should contain, at a minimum: