JohnnyCyp
Posts: 75
Joined: Sun Mar 31, 2019 11:05 pm

How to connect I2C 1602 LCD Display to Raspberry pi ?

Thu May 09, 2019 9:44 pm

Hello, I need help. I have this 16x2 LCD Display:https://amzn.to/2vNZPhs which is a ready plate with MCP23017 chip. I want connect it to RPi, i know i can put it into RPi but it will use me all pins of RPi and i don't want to do that because i'm making a project about home security and i want to connect other devices like keypad, buzzer and PIR Sensor... I have used this tutorial :https://bit.ly/2LAL5NN to connect the VCC, Ground, SCL, SDA pins out to raspberry pi (not to arduino like tutorial). Do i need to connect another pin to GPIO ? The backlight of the display is working but when i write a python script not working and it didn't shows the output text and is only displaying blocks like in photo: Image I tried also a lot libraries but i didn't find anything applicable... Any idea why this is happening or is there any step I am missing ?

PhatFil
Posts: 1234
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: How to connect I2C 1602 LCD Display to Raspberry pi ?

Thu May 09, 2019 10:37 pm

there should be a pot (potetiometer / variable resistor) for the contrast on the i2c interface board that you tweak down until those white blocks clearly visible in each character place just fade out of view to make characters written visible..

check out this i2c 1602 pi how to http://www.circuitbasics.com/raspberry- ... ogramming/

JohnnyCyp
Posts: 75
Joined: Sun Mar 31, 2019 11:05 pm

Re: How to connect I2C 1602 LCD Display to Raspberry pi ?

Thu May 09, 2019 11:38 pm

PhatFil wrote:
Thu May 09, 2019 10:37 pm
there should be a pot (potetiometer / variable resistor) for the contrast on the i2c interface board that you tweak down until those white blocks clearly visible in each character place just fade out of view to make characters written visible..

check out this i2c 1602 pi how to http://www.circuitbasics.com/raspberry- ... ogramming/
So the screen should be clear ? because there is a potentiometer for the contrast and in the beginning the screen was clear and i turned it the potentiometer to show this blocks.

PhatFil
Posts: 1234
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: How to connect I2C 1602 LCD Display to Raspberry pi ?

Thu May 09, 2019 11:44 pm

JohnnyCyp wrote:
Thu May 09, 2019 11:38 pm
PhatFil wrote:
Thu May 09, 2019 10:37 pm
there should be a pot (potetiometer / variable resistor) for the contrast on the i2c interface board that you tweak down until those white blocks clearly visible in each character place just fade out of view to make characters written visible..

check out this i2c 1602 pi how to http://www.circuitbasics.com/raspberry- ... ogramming/
So the screen should be clear ? because there is a potentiometer for the contrast and in the beginning the screen was clear and i turned it the potentiometer to show this blocks.
;) Fraid so.. tweak it again until the squares just fade out, too much and the chars wont be visible when written, not enough and the white square will obscure the chars..

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

Re: How to connect I2C 1602 LCD Display to Raspberry pi ?

Fri May 10, 2019 7:25 am

You need to adjust it so it looks like this

Image

then once you have some text on the LCD you can adjust it some more till all you see is the text.

Image
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

JohnnyCyp
Posts: 75
Joined: Sun Mar 31, 2019 11:05 pm

Re: How to connect I2C 1602 LCD Display to Raspberry pi ?

Fri May 10, 2019 9:05 am

pcmanbob wrote:
Fri May 10, 2019 7:25 am
You need to adjust it so it looks like this

Image

then once you have some text on the LCD you can adjust it some more till all you see is the text.

Image
I adjust it like your photo but mine shows only boxes only on the first column and i test it withi this driver: https://bit.ly/2JdFomS but again i didn't saw text in the display. Which is the best and appropriate driver for this lcd display 16x2 i2c ?

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

Re: How to connect I2C 1602 LCD Display to Raspberry pi ?

Fri May 10, 2019 10:14 am

Have you looked at the documentation on getting started ?

https://rplcd.readthedocs.io/en/stable/ ... arted.html
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

JohnnyCyp
Posts: 75
Joined: Sun Mar 31, 2019 11:05 pm

Re: How to connect I2C 1602 LCD Display to Raspberry pi ?

Fri May 10, 2019 12:03 pm

I got it working! :D

I have used in my program this two libraries :
from Adafruit_MCP230xx import Adafruit_MCP230XX
from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate
and write this:
mcp2 = Adafruit_MCP230XX(address = 0x20, num_gpios = 16) # MCP23017
lcd = Adafruit_CharLCDPlate()
lcd.begin(16,1)

I have downloaded the libraries from here: https://bit.ly/2E1oMun

I'm so relieved! I tried for 18 hours to make it work...

Image

Return to “Interfacing (DSI, CSI, I2C, etc.)”