Raspberry Pi - Mini LCD Display Tutorial
HTML-код
- Опубликовано: 11 сен 2024
- Liquid-crystal goodness anyone?!
That's right! In today's tutorial I show you how to wire up and program your very own mini LCD display to your Raspberry Pi! By the end the of this video you will be printing your own messages to your very own screen module and will understand all of the Python code behind it. A good, cheap and enjoyable little project for Raspberry Pi - with plenty of scope for your own further developments!
---
INFORMATION:
Raspberry Pi Raspbian official download: www.raspberryp...
Grab an LCD display for under £5 here: www.ebay.co.uk...
Take a look at the code and installation script here: github.com/the...
---
COMMANDS:
Install all of the code: git clone github.com/the...
Change into the new directory with downloaded code: cd lcd
Install the required software: sudo sh install.sh
View either of the demo programs with: nano program_name.py
Run either of the demo programs with: python program_name.py
---
Thanks for watching! Don't forget to like, subscribe and share!
The Raspberry Pi Guy
Y U NO SUBSCRIBE?!
To get my one to work I used i2cdectect to get the address of the lcd screen then with this I went into theh lcddriver file and changed the lcd address from 0x20 to 0x3f. Hope this helps someone!
+Craig Griffin glad you got it all sorted!
Hello,
I have a liddle Problem:
I bought this Display : www.amazon.de/Schnittstelle-1602-Serielle-Display-Modul-Arduino/dp/B01JZ75AG2/ref=sr_1_4?ie=UTF8&qid=1473947258&sr=8-4&keywords=16x2+Serielle+LCD+Display-Modul
My question now is, does it work with the Raspberry Pi, because it needs 5V to run.
yes it does raspberry pi have 5v input. no worries.
Still having the same problem, kept switching back an forth between 20 and 3f, heck even 27. Any other possible solutions? I2C is enabled in the raspi-config
Thx! Made my day. :-)
AWESOME! the only code I found online that actually works!! this is the only package that has a I2C for RPi3 fully working. I tried two different scripts from two kits and they are both wrong. Thank you so much for sharing your knowledge! you made my day!!!
Dude you rock. Thank you so much for passing on your knowledge. You've just ended my 3 hour journey of trying to get this to work!
mine was even longer aaahh!! but thank god you helped me!!! @theraspberrypiguy
I could be able to fix messages not showing issue by adjusting the brightness as mentioned in this tutorial. Thanks a lot.
Undoubtedly, the best raspberry pi channel
I feel like I am about to spend hours watching these things and trying them out. Good stuff!
This is THE BEST video I have found while browsing the internet for a guide to set up an LCD with my Pi 4. THANK YOU @TheRaspberryPiGuy
Thanks so much. I went through about 5 tutorials until I got to yours... each had a little bit more info but ultimately I got it working with your code... Rock on!
Thank You very much, great job PiGuy! Cheers from Poland :)
Thanks piguy, great tutorial for beginners!! just getting into playing pi with the 37 in 1 pack of sensors and having this output for some basic feedback is cool ... thanks!!
Wow, I searched for days finding the reason why my display did not show anything. Thanks for the tutorial. And thanks for the hint how to change the contrast. 😄
Thanks! :D
I had one of these displays and it didnt want to work with my arduino, so i thought it was broken since i tryed soo Many example codes.
And now i tryed it with my raspberry pi and it worked! Again thanks!
thats an address issue... look at the back of the display and take note of the address
Thanks alot! I didn't know you could lower the brightness with a screwdriver!!
I thought my LCD screen didn't work, but it was the brightness!!
Ummm, its not the brightness its the contrast setting, u can change the brightness by placing somekind of resistors between gnd and vcc from the pi itself, i personally use 3x1k ohm resistor in paralel
Amazing stuff man, thank you so much! Very clear and easy to understand!
The code is good and it shows 'Writing to display' but shows nothing on the LCD screen.What could it be please?
i have the same, all suggestions here don't help to get it to work. did you find a solution that worked for you ?
@@ShakeYaBamBam I have put a video on my RUclips channel showing it working :)
Thank you TheRaspberryPiGuy, this really helped me a lot!
thanks man! this made my setup very easy to complete!
Thank you pi guy and thank you Craig Griffin for giving quick solution.
hello: doing this for the first time in my life. using yr video. Thank you!
You're awesome man. Thanks for the video, it helped me setup my lcd display.
So could hook one of these up to a pi running retropie to display what game I'm currently playing. And or the fps?
I’m really struggling here, for some reason when I’m entering the lcd stuff to clone it’s asking for my GitHub login and won’t let me type ANYTHING for the input of the password meaning I’m not authenticated to access the stuff ... help??
Zozo just log in ur GitHub or sign up and it will work
the password never shows up when you're typing, it will be blank
@@potaziio7174 whaaaaaaat??? I'll try it again soke day - unfortunately my pi broke 💔
Very nicely presented video. Thanks for sharing. :)
Great video! What are your thoughts on whether or not a level shifter is needed to protect the Pi pins?
Amazing tutorial, great work!
Finallllyyyyy!!! Now I can make my own BOMB which will display remaining time! Before everyone thought I was joking since there was no time for detonation 🤔🤔🤔🤔🤔🤔🤔😅😅😅😅😅😅😅😅
Excellent tutorial, thank you!. I had to 'pip install smbus', but everything worked great after that.
Johnny West thanks for this
*OH, HOW SURPRISING! YOU HAVE TO INSTALL LIBRARIES*
Thanks and works well. I had the same I/O error 5 issue as the guys below and it cleared when I went to raspi config and added ssh and camera and then rebooted (nonsense, right?)
MY REAL INQUIRY: how can I keep my lcd clock going when I switch to an
other directory in linux terminal? Thanks.
Thanks for you video, very clear and explains in detail!!! super
Great work, thanks.
Now; how about modd'ing it for a 20x4 display?
What about a level shifter since the device uses 5v e pi's use 3v???
Stupid question, if I wanted to have multiple displays, I would need to have different addresses, then change the lcddriver file accordingly. Or is this really written for just one display and I should consider any other driver library?
Now if I could only make this LCD display work with MPD. That would a super audio player! 👍
how do i write my own text into it. The document always says that i cant pls help
Well done! Thanks for the great upload
I received an Errno 121 saying Remote I/O error. I saw fix to this by editing the address in the lcddriver.py but that file didn't appear in my folder when I cloned it from git. Any advice on how to fix this error?
Absolutely super, one question, in the netmonit is there a way to light an led or flash the lcd screen if it reports down?
Hi, what a great video, thank you! But is there any way to connect a second LCD module to the same Pi and display different data on both screens?
Is it possible to change the orientation of the text? It is upside down for me at the moment
Hello my friend. This tutorial works on Upboard 2?
You should be using a Logic Level Converter, those I2C backpacks have 5v pullups!
What will happen if I don't use it though?
Very Nice!!! Me helped it so much
Hi i change the text to say something different, however on the lcd it shows as mixed up letters and numbers.
Any help would be great.
Thanks.
Thank you very much. You helped a lot.
great video thanks got mine going at last
Is there any possibility to make something like - lcd.cursor_mode = CursorMode.blink ? For blinking the cursor?
Great tutorial. I am trying to make a display that shows my current subscribers using API keys is it possible to do that with this screen? Thanks!
Where do I put the Fan Pins, because both those are in the black and red spots you have. I can choose any 5v and ground location? (I guess I could just put the fan red in the 3.5v location and just have low power maybe?)
I keep getting several errors. Here the first. Line 11, in . display = lcddriver.lcd(). Can you help? I can see you a pic of all the errors if you want
ok same thing happened to me, I did 2 things to fix it. First of all, I had my SDA and SCL wires switched by accident, second of all i gave the command:
sudo i2cdetect -y 1
And in the lcddriver.py file I changed the ADDRESS = 0x value to what I saw after giving out the previous command, in my case 3f, so i changed it to 0x3f.
thx - the socond one was the solution!!!
HUNVilly thx man it workt with the second thing
HUNVilly its pretty hard to find for a beginner
diy perks does a video on making a 4k projector using a lcd screen with hdmi. the problem is you cant run a display without connecting a computer. ideally I would want to connect a streaming device or xbox or bluray. so my question is: can you use a raspberry pi to run the display on the lcd screen by connecting a xbox or what not without having a laptop out?
I am running 0*27 display with raspberrypi. display not giving any output but it is chaging brightness.
i tried different display and it is working. i want to check problem with older display
Excellent tutorial. Is there a way to display playing info from Volumio?
i am currently using my RaspPi as a portable computer. Do you have the codes to make this with the same board on an Arduino?
what's the code for displaying IP address... cause every other tutorial use lcd without module and it's more complicated.
Raspberry 4 ERROR: This example works fine on any of my RaspPi3 but can not get this to work on my Raspberry Pi 4.It appears to be an address error but running i2cdetect -y 1 does not work on this cpu either (raises an error) which works fine on the 3.
you are a god !!! thought mine was faulty can you make same type video for librelec i have asked many people on forms but no luck and i thought my display was faulty
It’s asking me for a user name and password for GitHub when I type the Command in. Any help?
Check your i2c address in the lcddriver.py file. I had to change mine. After that it worked. Thanks RPi Guy!
what exactly do I need to do?
Is there a way to turn off the display for when it is not being used?
Ohhhhh thank you so much sir!!!
Hi, could you please help me!? ;) I want to display the IP-Adress and the CPU-Temp to the display. Do you have a python-script for this? Thanks in advance.
I want system monitoring as well so I can view cpu temp & usage while mining
How do I turn off the screen on and off in python or use the blinkon / blinkoff in the lcddriver?
This is telling me that the module drivers could not be found
is it possible to display cpu temp and cpu usage or ram usage ?
Brk it enough or should we declare pins
hello, how do i check the temperature of the pi 3? cheers and thanks
Works fine on Python 2.7! Is there any version for python 3?
Yes Here you Go: ruclips.net/video/DgYHbjp8kQ0/видео.html
Thanks a lot. How can I get a news ticker?
I need to display month year and date on a large display screen each day . but large screens have no such kinds of pins to connect them to a raspberry pi. Can anyone help me please ??? thank you
i used mfrc522 and this lcd, but but the problem comes.
please share tutorial for uninstall this packed
I’m trying to make my display show the stats like the temp of the cpu and stuff like that while running retropie, anyone know anything that could help me?
Hi, I am new to Python. After 'sudo sh install.sh' in the lcd directory, I got this error 'install.sh: 21: ./setup.sh: Permission denied'. What am I doing wrong?
i got the same error, did you ever figure it out?
I couldn't get this to work with pi 1 old model, any help
Muito Bom!!!!!! Funcionou corretamente. Obrigado!
Will this work in a Pico?
Thanks for this really helpful tutorial!
You are awsome!
Hello, I currently have my LCD screen hooked up and I'm intermittently getting gibberish instead of the desired text. I've gotten the desired text a few times, but upon restarting the script it goes back to gibberish. Do you have any ideas to fix this?
try reinstalling the files or check to see if something is shorting the lcd driver
fatal: unable to access
how to solve this
Can you use the mini LCD somehow without it being connected to the raspberry pi?
Check out the 3 part series by the 8-bit guy
@@YewTide604 Okay
Traceback (most recent call last):
File "demo_lcd.py", line 6, in
import lcddriver
File "/home/yudho/lcd/lcddriver.py", line 12, in
import i2c_lib
File "/home/yudho/lcd/i2c_lib.py", line 1, in
import smbus
ImportError: No module named smbus
I ended up with this code on ubuntu mate, but it doesnt do this when i use raspberry os, can someone help me please
I have the same issue
Does anyone have a fix for it
@@ishanrajesh9528 an update on september fixed it for me, and now i can run this code on any OS, except android ofc
The link to get the LCD w/ i2c is dead!
not sure if i have a dodgy display, its wired correctly, i changed the lcd address to 0x3f, ran the sh file and rebooted, ran the demo but the screen is blank, twisting the potentiometer on the back does nothing, i have a red power light on the back of the screen so i'd assume it works and maybe i did something wrong
turn the pot the other way
PLEASE HELP!! IT GIVES ERROR!
I OError: [Errno 121] Remote I/O error
same, any solution??
same!
check the address on the back of the display module....you might have a config issue and need to change the address, this is a common issue with arduino so look that up if you need more help
Hi, I am learning how to use LCD screen so how do you check the address and change it on raspberry pi? I need help thanks, I am also facing remote I/O error 121 from running codes that others have proved to work, so I believe it is my problem.
not enough information to answer your question. if it has the four pin on the back and you're using linux you can dmesg... usually the module has the address at the rear
Error 121, remote I/o error? Followed everything but nothing upon i2cdetect. I2C is enabled under config.. idk what my deal is but I keep failing and I want to quit! But that's lame, so if anyone has pointers, please lmk!
I have on of the original rev 1 pi's and i'm getting this error. noticed in the comments others are having the same issue
Traceback (most recent call last):
File "demo_lcd.py", line 11, in
display = lcddriver.lcd()
File "/root/lcd/lcddriver.py", line 69, in __init__
self.lcd_write(0x03)
File "/root/lcd/lcddriver.py", line 93, in lcd_write
self.lcd_write_four_bits(mode | (cmd & 0xF0))
File "/root/lcd/lcddriver.py", line 88, in lcd_write_four_bits
self.lcd_device.write_cmd(data | LCD_BACKLIGHT)
File "/root/lcd/i2c_lib.py", line 11, in write_cmd
self.bus.write_byte(self.addr, cmd)
IOError: [Errno 5] Input/output error
Any help would be grand. Thank you :)
+Nat Klopper To get my one to work I used i2cdectect to get the address of the lcd screen then with this I went into theh lcddriver file and changed the lcd address from 0x20 to 0x3f. Hope this helps
+Craig Griffin Thanks Craig, worked superbly. Totally forgot about the i2c addresses!!
Can anyone give some reference about how to print data from sensor to lcd 2x16+i2c ?? please
thanks
Pls share any answers u found that worked for u. Im working on a similar project where the lcd could read the sensor readings
Why I can´t run the code of demo_lcd.py on thonny IDE???
-well done
Hello, i used i2cdetect -y 1 and my display apperas as "3f", however, when i run any of the scripts, no characters are displaying on the screen. i changed the address in lcddriver.py to 3f. Any clue on what can be happening? My LCD is turned on, but no characters are displaying on the screen. I'm wiring directly to a Raspberry Pi Model B like you show in the video. Thanks in advance!
can you see rectangles on the screen? If no, you need to change the value of the potentiometer on the back of the LCD with a screwdriver. I had the same issue. did you leave the address = 0x3f?
Question: I am already using the GND and one of the 5V pins on the GPIO for my case's fan. I see the GPIO has another 5V and GND. Can I use any of them for power, and use SDA and SCL for the data/clock?
Yeap
my raspberry pi is giving me an [Errno 5] input/output error
Has anyone figured out a way to display the same message just by turning on the Pi (not having it hooked up to an external monitor to code anything)?
my 3f is in the colum f and row 30 when i run the i2cdetect command, should i change the lcd address to fx3f or something?
no hex addresses start with 0x to tell the system that it is hex so it is simply '0x3f'
Please Help
self.lcd_device.write_cmd(data | LCD_BACKLIGHT)
File "/home/pi/Desktop/Research/lcd/i2c_lib.py", line 11, in write_cmd
self.bus.write_byte(self.addr, cmd)
IOError: [Errno 121] Remote I/O error
can you please do the same example in C tutorial
Great video, thank you for sharing! My display doesn't have a physical adjustment for the contrast but terminal says 'Writing to display' and my screen is black. I feel like the contrast/brightness is where I need to look to fix this, any idea if it can be controlled via coding? ps, thank you Craig Griffin for your comment, you got me over my first challenge with this!
Sorry I'm late lol. but I think you should get another backpack for it with a physical adjustment.
It keeps asking me to login
thank you alllllllllot!!!!!!
THANKS :D
Where the hell doe VCC hook into?