ladypi
Posts: 10
Joined: Mon May 13, 2019 10:26 am

run lcd 2*16 with raspberrypi

Thu May 16, 2019 10:33 am

hello guys
i bought this 16*2 lcd but dont show words on it
connection:
1. Pin 1 (Ground) goes to the ground rail.

2. Pin 2 (VCC/5v) goes to the positive rail.

3. Pin 3 (V0) goes to the middle wire of the potentiometer.

4. Pin 4 (RS) goes to GPIO25 (Pin 22)

5. Pin 5 (RW) goes to the ground rail.

6. Pin 6 (EN) goes to GPIO24 (Pin 18)

7. Pin 11 (D4) goes to GPIO23 (Pin 16)

8. Pin 12 (D5) goes to GPIO17 (Pin 11)

9. Pin 13 (D6) goes to GPIO18 (Pin 12)

10. Pin 14 (D7) goes to GPIO22 (Pin 15)

11. Pin 15 (LED +) goes to the positive rail.

12. Pin 16 (LED -) goes to the ground rail.

look at this photo:
https://imgur.com/ZyAUNw6
https://imgur.com/zzJqUjc
https://imgur.com/sJe5VXZ

my python code:

Code: Select all

import time
import Adafruit_CharLCD as LCD

# Raspberry Pi pin setup
lcd_rs = 25
lcd_en = 24
lcd_d4 = 23
lcd_d5 = 17
lcd_d6 = 18
lcd_d7 = 22
lcd_backlight = 2

# Define LCD column and row size for 16x2 LCD.
lcd_columns = 16
lcd_rows = 2

lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)

lcd.message('Hello\nworld!')
# Wait 5 seconds

time.sleep(5.0)
lcd.clear()
text = raw_input("Type Something to be displayed: ")
lcd.message(text)

# Wait 5 seconds
time.sleep(5.0)
lcd.clear()
lcd.message('Goodbye\nWorld!')

time.sleep(5.0)
lcd.clear()
what is the problem?

pcmanbob
Posts: 6960
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: run lcd 2*16 with raspberrypi

Thu May 16, 2019 12:25 pm

First off your contrast pin ( pin 3 on the LCD ) needs wiring to the variable resistor like this.

Image

then you need to adjust the variable resistor so you get a display like this

Image

so you can just see the squares were the text will appear, note this is a 20x4 display.

then try running you program and see if text appears.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ladypi
Posts: 10
Joined: Mon May 13, 2019 10:26 am

Re: run lcd 2*16 with raspberrypi

Thu May 16, 2019 1:55 pm

thanks but lcd is 16*2 . i added the photo and this is big lcd 2*16
and i use 50K volum for pin 3

https://imgur.com/W8F9WqF
https://imgur.com/ZyAUNw6

pcmanbob
Posts: 6960
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: run lcd 2*16 with raspberrypi

Thu May 16, 2019 2:20 pm

ladypi wrote: thanks but lcd is 16*2 . i added the photo and this is big lcd 2*16
and i use 50K volum for pin 3

https://imgur.com/W8F9WqF
https://imgur.com/ZyAUNw6
So is is based on the same HD44780 LCD controller or an equivalent or is it using some other LCD controller ?

May be a link to where you got it from ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

ladypi
Posts: 10
Joined: Mon May 13, 2019 10:26 am

Re: run lcd 2*16 with raspberrypi

Sat May 18, 2019 6:10 am

pcmanbob wrote:
Thu May 16, 2019 2:20 pm
ladypi wrote: thanks but lcd is 16*2 . i added the photo and this is big lcd 2*16
and i use 50K volum for pin 3

https://imgur.com/W8F9WqF
https://imgur.com/ZyAUNw6
So is is based on the same HD44780 LCD controller or an equivalent or is it using some other LCD controller ?

May be a link to where you got it from ?
how can i find driver?

User avatar
joan
Posts: 14270
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: run lcd 2*16 with raspberrypi

Sat May 18, 2019 8:21 am

That is a standard 2x16 LCD display. Just follow one of the thousands of tutorials.

Return to “Graphics, sound and multimedia”