Documente Academic
Documente Profesional
Documente Cultură
LABORATORY NO. 3
Raspberry Pi and LCD
Submitted by:
Caringal, Cherrielyn M.
Dimaculangan, Jhoven L.
Masangcay, Diether Jhay S.
Miranda, Anne Jeline H.
Torino, Cleo Martin R.
ECE- 4201
Submitted to:
Dr. Gil Barte
Instructor
LCD (liquid crystal display) is the technology used for displays in notebook and other smaller
computers. Like light-emitting diode (LED) and gas-plasma technologies, LCDs allow displays to be
much thinner than cathode ray tube (CRT) technology. LCDs consume much less power than LED
and gas-display displays because they work on the principle of blocking light rather than emitting it.
The backlight in liquid crystal display provides an even light source behind the screen. This
light is polarized, meaning only half of the light shines through to the liquid crystal layer. The liquid
crystals are made up of a part solid, part liquid substance that can be "twisted" by applying electrical
voltage to them. They block the polarized light when they are off, but reflect red, green, or blue light
when activated.
Each LCD screen contains a matrix of pixels that display the image on the screen. Early
LCDs had passive-matrix screens, which controlled individual pixels by sending a charge to their row
and column. Since a limited number of electrical charges could be sent each second, passive-matrix
screens were known for appearing blurry when images moved quickly on the screen.
The basics of incorporating an LCD into the group’s project will be learned in this laboratory
experiment. The Raspberry Pi will allow simple text messages to be displayed on an LCD using the
Python programming language.
II. OBJECTIVES
The aim of this paper is to make necessary codes to perform the required tasks using Raspberry
Pi.
Specifically, this includes:
1. Connect the LCD to GPIO (General Purpose Input Output) pins of PI to display characters on
it.
2. Write a program in Python to send the appropriate commands to the LCD through GPIO and
display the needed characters on its screen.
3. Make a program where the Raspberry Pi is connected to a LCD character display and shows
the status of the LED with switch.
4. Make a program where the Raspberry Pi is connected to a LCD character display and shows
the status if the sensor (LDR) detects.
III. MATERIAL
The following materials will be needed to conduct the laboratory experiment:
Raspberry Pi
I2C LCD Display
Header
LED
Push Button/ Module
LDR
10k resistor
Several jumper wires (Male to Female)
Laptop/PC
LAN connector
5-Volt supply to power Raspberry
IV. PROCEDURES, CODES AND PSEUDOCODES
A. LED with switch (STATUS)
1. As shown in figure connect the I2C lcd on raspberry pi
Objective:
Create a program using a temperature sensor. Display the temperature on the LCD.
Procedure:
Then select Advance Options and enable I2C and SPI. After rebooting the Pi, we need to
modify the module’s config file. Type the following command in terminal:
sudo nano /etc/modules
3. Install smbus and i2c python library. Then, type following command in terminal:
sudo apt-get update
sudo apt-get install -y python-smbus i2c-tools
sudo reboot
shown below:
Finally run the program by typing:
Sudo python3 temperature.py
VII. CONCLUSION
Communicating with the Raspberry Pi LCD 16×2 display is easy because of the library
provided by Adafruit. It is incredibly easy to write Python scripts to setup and alter the display.