Raspberry Pi LESSON 25: Using an LCD1602 LCD Display with I2C

preview_player
Показать описание
Announcing the Most Awesome Raspberry Pi Lessons of All Times! This time we RUMBLE!

In this class series, we will be using the most excellent Sunfounder Ultimate Raspberry Pi kit, available here: (Affiliate Link)

In this lesson I will show how to use I2C to connect an LCD Display to the Raspberry Pi. I will show how to enable and configure I2C on the Raspberry Pi, and then how to connect up the LCD1602 LCD to the Raspberry PI. I show how to install the LCD1602 Library, and then how to write text to the LCD.

If you want to grab those cool little straight jumper wires I am using to keep my breadboard builds neat and clean you can snag a box of them here:

If you guys are interested in the oscilloscope I am using, you can pick one up here (affiliate link):

You guys get your hardware ordered so you can follow along at home!

You will also need a Raspberry Pi. I suggest the Raspberry Pi 4. If you do not already have one, this is the most suitable gear I could find:

The Raspberry Pi's are sort of pricy right now, so you can look on ebay or elsewhere to see if there are any deals. You will need a SD card. If you do not already have one, this is a good one:

I like using a wireless keyboard and mouse to have fewer wires. You can certainly use your USB keyboard and mouse, but if you want a nice wireless one, this one works on the pi. We demonstrate this by using a button switch to control a LED.

You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

#TUTORIAL
#DHT-11
#RASPBERRYPI
Рекомендации по теме
Комментарии
Автор

Love seeing the fisherman. I love to fish myself and really like seeing those boats.

tntragan
Автор

I’m probably like many others who do the lesson after the premier when I can concentrate on what’s being said. Trying to do the lesson and keep up with the chat during the premier showing is too distracting for this old guys brain. Anyway, it was a great lesson and I’m anxious to get at it. Thanks for all your efforts Paul.

leeg.
Автор

Another Great LESSON as USUAL! Thank YOU PAUL!

larryplatzek
Автор

Hello Paul.
Been loving this series this far. Can you please make some videos on how to find a supervisor for masters program.

arbab
Автор

I've played around slightly with the LCD1602 display but (as i mentioned in the chat) I couldn't remember doing all this. It's good that you went through all the steps with us but all I did was to enable i2c and SPI using raspi-config and everything worked fine. This tutorial has actually made me want to dust off my Pi 1 to see what I can do with it. And I did save the LCD1602.py library.

charlotteswift
Автор

Haven’t seen it mentioned, but you have two lessons both are numbered 25. Caused me some confusion…anyhow, thank you for all your hard work making these lessons, they are excellent.

grandadmark
Автор

Very interesting. I have been looking at other videos on youtube about running this display from a PI and they all skip the bit about installing the display. and jump right into the coding.

rienwijnsma
Автор

Please make a video of how to interface the 16X2 LCD in 4-bit and 8-bit mode with the Rasberry Pi without using I2C protocol.

nishantaggarwal
Автор

I did it!
My video is at :
This is the video of my homework to Lesson 25 : Using the LCD1602 Display, DHT11 Temperature and Humidity Module, Transistor driven sounder, and a Pushbutton, make a Temperature Alarm, which is controlled by pressing a button, and turning a pre-set potentiometer.
I also had a couple of Learning points!
When I designed the layout of the breadboard, I made sure that I wasn’t going to use any of the pins (with special purposes, e.g. I2C nor SPI, etc.), but I didn’t realise that only the GPIO12, GPIO13, GPIO18 and GPIO19 pins supported PWM. Once that was solved, everything worked correctly.
Secondly, I have a personal preference for using the Pushbutton to enable ‘Setting Mode’, rather than toggling between modes. For example, you can’t leave mine with the alarm disabled, and walk away, expecting an alarm which will never happen.

keyboardlearning
Автор

Hello Paul, I have a concern about the signal of SDA and SCL port of LCD1602 that will it return the signal back to SDA and SCL port with 5V signal. SDA and SCL ports are supposed to handle only 3, 3V so may it make the damage in raspberry Pi if we connect LCD1602 and raspberry Pi directly ?

HungNguyen-glxt
Автор

hello i try to see your video but my visual studio code tell me in the module LCD1602.py No module named 'machine' WHY ?

jeancharlesaubinaud
Автор

Your channel "Successful Homesteading" seems really valuable these days, as the earth seems crazy nowadays, when it comes to climate change, resulting in floods, earthquakes, etc, killing thousands of innocent people. I wish most people could do homesteading and be safe.

Bob-zgzf
Автор

Very good training material. Well done and Thank you!
Out of curiosity, what needs to be changed in the Library file to use more than one LCD?
Also, if I am planning to use a 20x4 LCD, what do I need to be change inside the library file?

Bennie
Автор

Where can I find these libraries & theri reference ??

mradulbhardwaj
Автор

My LCD only displays the first 8-Bits, the last 8-bits don't display anything at all, what could be the problem?

siphesihlefisokuhle
Автор

I had to adjust the contrast of the LCD display, by turning the small pot on the backside, to be able to see the text.

peterkarlsson
Автор

Very neat! My brightness was already good. The odd thing is I had to set my sleep pretty high at 1 second for it to clear. 0.2 seemed to keep leaving the letters on the screen, 0.5 was a bit better, but 1 second seems to fully clear it every time for mine.

BunnLilah
Автор

Hello professor, Do you teach any Cybersecurity field?

FarhanYAlyas
Автор

Just a quick question, how can I let text scroll from right to left / left to right?

leflopshow
Автор

I am not getting my display to clear every time that I interrupt the program. The "LCD Good to Go" does come up every time, but the display only sometimes clears. I am using a Raspberry Pi 3b+ and have changed the time.sleep(time) to different values. I even added another tiime.sleep(time) and LCD1602.clear() pair of lines and it still doesn't clear every time. Anybody else got that same issue or have it figured out?

lensman