LCD 16x2 Interface With Raspberry Pi


12,832

15

1

I am hobbies, educator, learner, and developer in various programming languages and Electronic ha...

Hello friends,

Today i am Interfacing 16x2 Display to Raspberry pi.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Components Required

Here you need the following components to complete the task.

  1. Raspberry Pi
  2. power supply adapter for Raspberry Pi
  3. 16x2 LCD display
  4. potentiometer 10k
  5. connecting wires
  6. breadboard or any 16x2 display shield

Step 2: Circuit Connections

Connections are shown in this image. But its not mandatory to use this GPIO's. You can use any GPIO for connect the LCD. But you have to mention same GPIO's in Programming.
variable resistor is connected to adjust contrast of the display. Display is powered from Raspberry pi. R/W pin is connected to ground because i am not performing any read operation on display.

Step 3: Working

I designed an display library namely lcd.py In this library i write some functions to which can be called by user. In order to drive lcd it is mandatory to include this library in your code. More details about library is available in library.

First of all you have to execute begin() function and pass the pins which you are going to use for interface display.

Here Print() function can print any value passed to this function.

This display isinterfaced in 4 bit mode so only 4 pins D4-D7 and RW,EN pins are connected to raspberry pin.

Step 4: Test

Here the tested video is available

Step 5: Code

Here code is available for this instructable here

Step 6: Disadvantage

  1. This won't be work properly if we put this script to run automatically at boot. This is because the Raspberry pi is not Real time controller. Need some more improvement in this code.

Step 7: Contact Us

For more instructables follow here

Facebook

blog

email me

Be the First to Share

    Recommendations

    • Assistive Tech Contest

      Assistive Tech Contest
    • Reuse Contest

      Reuse Contest
    • Made with Math Contest

      Made with Math Contest

    Discussions

    0
    None
    cjbhaskar

    11 months ago on Step 5

    The code says the IndentationError : unindent does not match any outer indentation level in lcd.py at Line 39. I could not fix this. Could you please help ?