Instructables

Pandora's Box - An Internet Radio player made with a Raspberry Pi!

FeaturedContest WinnerContest Winner

Step 6: Connecting the LCD

Picture of Connecting the LCD
The LCD module from Sparkfun accepts serial input, making it simple to communicate with on the Raspberry Pi's UART Transmit (TX) pin. 

This circuit uses three pins on the T-Cobbler breakout board - 5V, GND, and TX. For more information about the GPIO pins, refer to: http://elinux.org/RPi_Low-level_peripherals

Be careful about running wires next to the 3.3V regulator - it will be producing a modest amount of heat.




Bonus: Now that the LCD module is connected, some quick Python scripting will let us control it. Try the following Python "Hello World" script:

import sys, serial, time
global serialport
LCD = serial.Serial('/dev/ttyAMA0', 9600)
LCD.open()
LCD.write('\xFE\x01')      #CLEARS THE LCD
LCD.write('\xFE\x80')     #SETS THE CURSOR ON THE FIRST LINE, FIRST CHARACTER
LCD.write("HELLO")
LCD.write('\xFE\xC0')    #SETS THE CURSOR ON THE SECOND LINE, FIRST CHARACTER
LCD.write("WORLD")
LCD.close()
 
Remove these adsRemove these ads by Signing Up
tenokage1 year ago
I was able to successfully get the "Hello" on the first line by writing this code in IDLE and running, but did not get the second line to output anything, is '\xFE\xC0' the correct syntax?
bdeschamps1 year ago
should be vdd, or the 5v, RX is data is data to the LCD and GND is ground. It will conect to the txd pin witch is pin 8 i belive on the rasberry pie. hear is a link to a pic of the pin out.http://www.hobbytronics.co.uk/image/data/tutorial/raspberry-pi/gpio-pinout.jpg
josure1 year ago
hi i need a little help.im pretty beginner and i dont understand how to connect the lcd to what pin in lcd.i need some details.:) thnks to everyone