Using a 16x2 LCD Display with a Raspberry Pi

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • A quick tutorial demonstrating how to hook up a 16x2 LCD display to a Raspberry Pi and control it with Python. Full notes, code and updates are available on my website: www.rototron.in...

Комментарии • 427

  • @rdagger
    @rdagger  2 года назад +8

    *UPDATE:* The Adafruit Char LCD library used in the video is now deprecated. Therefore, I added an update to my website showing how to use the Adafruit CircuitPython CharLCD library: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/#cp

  • @MattVarner
    @MattVarner 9 лет назад +14

    Thank you for making this video. Although I'm really just at the beginning of my Python adventure...this sort of thing fires my daydreaming.

  • @Yeeter_Inbound
    @Yeeter_Inbound 2 года назад +1

    This was awesome! Thank you so much! I used the first method for code. I didnt have one of those little modules that only makes 4 pins used and they actually are already being used for another device. I'm trying to make an alarm clock for a school project. I hope I can make this work!

  • @andy1845c
    @andy1845c 9 лет назад +1

    Excellent video. I watched the first one too and really appreciate both! Please keep making them!!

  • @patricktucci2818
    @patricktucci2818 7 лет назад

    Very helpful video, thanks for posting.
    Just a clarification, at 10:39, you say "the columns are zero-based so (7,0) is the 6th column on the first line." If in fact the values are zero-based, 7,0 is the 8th column on the first line (7 + 1 = 8. 0 + 1 = 1). I believe the position you'd want to specify would be (5,0) for the 6th column on the first line.
    Again, great video and thanks again.

    • @rdagger
      @rdagger  7 лет назад

      Great catch! I think you’re the first to notice this mistake. Thanks for the feedback.

  • @rdagger
    @rdagger  8 лет назад +23

    *UPDATE*: the Adafruit library is now installed using _pip_. It is no longer necessary to use git and the paths are automatically set up. Also the syntax for some of the commands has changed. See my website for details.

    • @akshaytanejaF1
      @akshaytanejaF1 7 лет назад

      how do you get the module using pip?
      #newbie

    • @rdagger
      @rdagger  7 лет назад +6

      sudo pip install adafruit-charlcd
      See my website for updates and more info: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/

    • @akshaytanejaF1
      @akshaytanejaF1 7 лет назад

      Thanks! i somehow got the lcd working from the adafruit library before i read your reply but the problem im having is that when i use scrollDisplayRight() it says Adafruit_CharLCD has no such attribute
      i used github.com/adafruit/Adafruit_Python_CharLCD.git and installed using ez_setup.py because the normal setup file wasnt working for me
      im working on a music player and im willing to share the code once i complete it, im almost there i guess
      EDIT: just found that the function is lcd.autoscroll() but i still cant get that to work after setting it to true

    • @freemanfreed1581
      @freemanfreed1581 4 года назад

      How to Use LED display board instead of LCD??

    • @nabinbhandari471
      @nabinbhandari471 3 года назад

      @@rdagger why have you defined path as /home/pi/lcd ?
      lcd.lcd_init()
      AttributeError: 'module' object has no attribute 'lcd_init'
      i m getting this error...

  • @Havanacuba1985
    @Havanacuba1985 8 лет назад +1

    Very good , I must watch it a few times though haha, thank you for your hard work

  • @ken-ntuee
    @ken-ntuee Год назад

    I found that it's set_cursor() method in the updated Adafruit CharLCD library instead of setCursor() method as you update in your website today (2023.4.23)

    • @rdagger
      @rdagger  Год назад

      Thanks for reporting the error! I updated the code on my site. Please note that the Adafruit CharLCD library is now deprecated and has been replaced by CircuitPython.

  • @dcc1165
    @dcc1165 8 лет назад +4

    You filled in about 20 blanks in my mind with this video. Most confusing was with the AdaFruit library. Sunfounder's Super Kit 2.0 includes the LCD and some tutorials, but they are not very descriptive as to how thing work. This video is so simple and straight forward, I almost feel like an idiot for needing this stuff explained to me...lol

  • @JuryDutySummons
    @JuryDutySummons 3 года назад +1

    Thanks, I got my display working. :) This was helpful.

  • @rdagger
    @rdagger  9 лет назад

    +mridul jain There's a link on the bottom of my temperature monitor project: www.rototron.info/projects/pi-temperature-monitor/

  • @Synthematix
    @Synthematix 2 года назад

    I have this 16x2 rgb adafruit LCD display, when i connect it to LCDSMARTIE i can only get characters to show up on the left side of the screen, everything seems to be setup correctly with the MATRIX.DLL in smartie and the screens driver is installed (the com port driver) this has got me baffled

  • @jimmiealeksic4359
    @jimmiealeksic4359 9 лет назад +2

    Hello! Is there any c++ library instead of Python?

    • @rdagger
      @rdagger  9 лет назад +1

      +Jimmie Aleksic Yes, WiringPi: wiringpi.com/dev-lib/lcd-library/

  • @jjffreeland1326
    @jjffreeland1326 8 лет назад +2

    Using the test script to initiate lcd..py on a raspberry PI 3 failed to display output. import time and added a time.sleep(0.5) after each call and it displayed the messages.

    • @mementorequiem
      @mementorequiem 6 лет назад

      I was going crazy wondering why it didn't work for me - triple checked all the wiring and made sure there were no typos in my code, but all to no avail... that was until I cared to check the comments section. Needless to say you are a real (mental) life saver :) Thank you so much!

  • @erkkinyfors8971
    @erkkinyfors8971 9 лет назад +3

    why i better off without grounding, if i ground it to the pi i have all light illuminated makes it very difficult to see

    • @rdagger
      @rdagger  8 лет назад

      +erkki nyfors If you are referring to grounding the contrast pin then you probably need a resistor or a potentiometer to adjust the contrast. My latest video on an international weather clock goes into detail about pots: ruclips.net/video/4l_nsNaMkuQ/видео.html

  • @redwind3475
    @redwind3475 Месяц назад

    This tutorial is so helpful and just what I was looking for! Thank you so mu--aaaand I burned out the backlight. FML But thanks!

  • @yashwanthchityala7967
    @yashwanthchityala7967 3 года назад +1

    thanks buddy

  • @dylancruz1131
    @dylancruz1131 8 лет назад

    You got a new sub :D

  • @jimlagraff4989
    @jimlagraff4989 7 лет назад

    Just subscribed and love all the projects you've done. Ive had an Adafruit 16 x 2 LCD with backpack (LCD) for 2 weeks and still haven't managed to send any text to it in python. I know it's a very specific question but have you ever done an example of anything this basic on one of these backpack LCDs?

    • @jimlagraff4989
      @jimlagraff4989 7 лет назад

      Thank you so much for the response, I'm going to run through that example tonight. Once again, great tutorials!

  • @barryburketv
    @barryburketv 7 лет назад +1

    I have the pins connected to the gpio pins however i cant get this
    working at all. When i run either, i can get is get 2 lines of white
    boxes. Originally, before i run the test lcd file i have one line. by
    running it , i get 2 . Ive tried rewring it several times. Any
    suggestions on what GPIO pins may be the issue?
    Using pins 11(rw) 9(e) 10 22 21 17(4-7) on old model b

    • @rdagger
      @rdagger  7 лет назад

      First I would double check that all your connections to the LCD display have good solder joints. Next I would try adjusting the brightness and contrast using resistors or potentiometers. There is more info on my site.

  • @JohnBerkPhx
    @JohnBerkPhx 8 лет назад +1

    Very nice. Love the great Video Quality !! Perfect graphics. Lots of Useful information. Thanks!

  • @Havanacuba1985
    @Havanacuba1985 8 лет назад +1

    Man, this was really informative and helpful. I just got my 16 x 2 display in the post this morning. When I get around to hooking it up I will be off to a good start with your video. Thanks for uploading this

  • @jakebroekhuizen9711
    @jakebroekhuizen9711 7 лет назад +2

    Hi,
    When I run the lcd.lcd_init(), the screen doesn't initialise? Any idea why?

    • @rdagger
      @rdagger  7 лет назад +2

      The most common culprit is wiring. Also check your gpio numbering. Is the backlight coming on? If the backlight or contrast is not set correctly, sometimes it's hard to see if it's working.

  • @ursulakinixx8641
    @ursulakinixx8641 8 лет назад +1

    do you know how to make that the lcd displays shows the time?

    • @rdagger
      @rdagger  8 лет назад

      My weather clock video demonstrates how to show the time on an LCD Display:
      ruclips.net/video/4l_nsNaMkuQ/видео.html

  • @karthikmedia4u
    @karthikmedia4u 3 года назад

    How to display that for large display

  • @Unknown-vk9bh
    @Unknown-vk9bh 9 лет назад

    Also at 7:26 when i type "lcd.lcd_string("Raspberry Pi", 2)" it says "TypeError: lcd_string() takes exactly 1 argumant (2 given)"?

    • @rdagger
      @rdagger  9 лет назад

      Sounds like you have the old code. Matt has a newer version: www.raspberrypi-spy.co.uk/2012/08/16x2-lcd-module-control-with-backlight-switch/

  • @LeeRyuuji
    @LeeRyuuji 9 лет назад +1

    Great! I have learned many things from this video (comments on the code confuses me). Can you please make another video on LCDs but with inputs and what methods are used (for example, a calculator-like program using the LCD screen).

    • @rdagger
      @rdagger  9 лет назад

      I created a 2nd video for this series that demonstrates using inputs with an LCD Display. I use a hex calculator for the example: ruclips.net/video/a8ozfd_Wd-w/видео.html

  • @marloxos5487
    @marloxos5487 4 года назад

    after i typed cd Adafruit-Raspberry-Pi-Python-Code i have to type cd Adafruit_CharLCD, right?
    because everytime i do this i get an error because it cannot find the right file
    its always says (bad translated from german) file or directory not found
    can u help me?

    • @rdagger
      @rdagger  4 года назад

      This is an old video. Please see my website for updates. There is a link in the video description.

  • @RixtronixLAB
    @RixtronixLAB 9 месяцев назад

    Nice video, thanks :)

  • @bishop5249
    @bishop5249 7 лет назад +1

    can i do this to my old calculator screen?
    (fx 991ES PLUS 4)

    • @rdagger
      @rdagger  7 лет назад

      That specific calculator probably uses a graphic LCD instead of a character LCD display. Depending on the chipset you still might be able to reuse it. I have a separate video on graphic LCD displays: ruclips.net/video/Nn5u9xhHCTM/видео.html

  • @kuldeepsingh-eb2su
    @kuldeepsingh-eb2su 6 лет назад

    sir plz make a video connecting raspberry pi to rfid reader and showing output in web browser.......we all are waiting for that ......thanks alot sir

  • @IDecaturX
    @IDecaturX 8 лет назад

    okay so i got it all working but how do i put the gksu idle into coding so i can actually use the code, if i use the code i used on the part involving gksu it comes up with no module named Adafruit_CharLCD.(new to raspberry pi & python)

    • @rdagger
      @rdagger  8 лет назад

      +vSxScopeZz "no module" error would indicate the Adafruit library is not in your system path. In your python code, you can use the sys.path.append method to add the location of the Adafruit library to your path. There is an example on my website.

  • @steventaylor6294
    @steventaylor6294 8 месяцев назад

    I had success with this tonight using fivdi/lcd node driver. I found I had to add 10ms sleep after each print, but I'm trying to find a better way using the provided callback but doing successive prints.

  • @prateekchachra9758
    @prateekchachra9758 5 лет назад +1

    Love this video! Thank you so much!

  • @hunsetter061
    @hunsetter061 8 лет назад

    I get the error: bash: cd: Adafruit _CharLCD No such file or directory. Help

    • @rdagger
      @rdagger  8 лет назад

      The Adafruit library install instructions have changed since the video was released. Did you use pip install? For updated instructions see my website (link in the description).

  • @randomidiot50
    @randomidiot50 4 года назад

    Im so sad radio shack closed, noe i have to go to frys 1 hour drive. NOOOOOOOOOOOOO!!!!!!!!!!!!1

    • @rdagger
      @rdagger  4 года назад

      Check if your city has any surplus electronics stores. Often they have very inexpensive components, helpful staff and cool vintage equipment. Unfortunately, they are becoming rare so I always try to frequent my local shops before a project. Some are now online such as www.allelectronics.com but it's often better to go in person. One store I found has shelves of used circuit boards and miscellaneous electronics that they sell for around a dollar per pound.

  • @VirajPawarguynexdoor
    @VirajPawarguynexdoor 9 лет назад

    I'm getting an error.OSError: No such file or directory: 'home/pi/lcd'

    • @rdagger
      @rdagger  9 лет назад

      +Viraj Pawar Create a directory called lcd in your home/pi folder and copy the lcd.py file into it. Make sure you put a slash before home. Example: sys.path.append('/home/pi/lcd')

  • @sethgandy1337
    @sethgandy1337 8 лет назад +1

    Great and clean tutorial. So here's my problem. I own a Raspberry pi 3. I've done the wiring as shown and added in the dimmer pot. When plugged in, the LCD (sparkfun 16x2) displays the usual solid block of display. I cannot do the idle command, as I'm only ssh'ing in. So I am running under root. I installed all the python bits as shown, downloaded the lcd.py file and made the changes you made. When I fire up python, I can execute all the commands without error, just kind of takes them, but when I get to the init() script, the screen does not clear? Is there something I'm doing wrong?

    • @rdagger
      @rdagger  8 лет назад +1

      If you're using the latest version of Raspbian Jessie, you no longer need superuser privileges to access the GPIO. Double check your wiring and that the GPIO pins used match the GPIO pins specified in the code. Also try the Adafruit library to help determine if it is a software or hardware issue.

    • @sethgandy1337
      @sethgandy1337 8 лет назад

      Doubled checked the wiring, all sound. Tried the Adafruit library as well. No dice. Remembered I had an extra lcd module from my 3d printer. My 16x2 lcd was dead. Must have blown it before I added the potentiometer. I'm in business now, with a 20x4 lcd! :D Again, thanks for the video and help!

  • @mayaankkumbhar720
    @mayaankkumbhar720 5 лет назад

    I am getting error in console. ImportError: No module named lcd when I execute import lcd in python console
    Any answer on how it is to be done

    • @rdagger
      @rdagger  5 лет назад

      Please see my website for updated installation instructions for the Adafruit LCD library.

  • @lualgomo3920
    @lualgomo3920 Год назад

    Can't init no matter what. Get a row of blocks in the first line and nothing else. Any help?

    • @rdagger
      @rdagger  Год назад

      A single illuminated row sounds like a wiring issue. Double check all your connections and keep them as short as possible. One possible culprit is that the read/write pin is not properly grounded. You might need to add resistors or a pot for the contrast and/or the backlight but I don’t think that would affect only 1 row. Also make sure your display uses an HD44780 driver chip.

  • @volkerking5757
    @volkerking5757 9 лет назад +1

    Hands up - Super Video Thank you!

  • @getmommed8510
    @getmommed8510 4 года назад +1

    So in other words get a god damn hdmi screen

    • @getzybaggins
      @getzybaggins 4 года назад +1

      that's not what this is for kid

  • @Alfonso013
    @Alfonso013 2 года назад

    can i know what you put inside the 16 hole of lcd screen? there some kind of metal

    • @rdagger
      @rdagger  2 года назад +1

      There is a 16 position male pin header (2.54mm pitch) soldered to the display’s through holes 1 to 16. It allows the LCD display to be plugged into the breadboard.

  • @fahimferdous7293
    @fahimferdous7293 9 лет назад

    if i want to use a tv via HDMI cable then what will be the code? if i add a motion sensor in this and a 55 inch led TV via HDMI cable. a certain video loop will be playback all the time. Then if someone cross the sensor, another video will be played. after that the first video will playback in a loop! thanks in advance!

  • @explosivemosfet1376
    @explosivemosfet1376 3 года назад

    So are RPi pins 5V tollerant...i expected 3.3V isn't enough to drive LCD I/O to an high level and 5v of LCD output to destroy RPi

    • @rdagger
      @rdagger  3 года назад

      The RPi pins are NOT 5 V tolerant. You can damage the Pi if you connect the GPIO pins to 5V. See 2:30 in the video. The LCD HD44780 data lines operate satisfactorily at 3.3 V.

    • @explosivemosfet1376
      @explosivemosfet1376 3 года назад

      ​@@rdagger I knew that HD44780 if you operate at 5V Vih min is 0.7*Vcc >3.6.
      But i will read the datasheet again, maybe i remember wrong

  • @DebanjanKarmakar
    @DebanjanKarmakar 2 года назад

    Adafruit Library is not working now. It raises runtime error as "RuntimeError: Could not determine platform." can you please do an updated video regarding this library.

    • @rdagger
      @rdagger  2 года назад

      Did you check my website because I posted several updates since the video came out in 2014?

    • @DebanjanKarmakar
      @DebanjanKarmakar 2 года назад

      @@rdagger yes but it still showing that same error message..please help

    • @rdagger
      @rdagger  2 года назад

      @@DebanjanKarmakar The old Adafruit library used in the video is deprecated and probably is unable to recognize your newer Raspberry Pi. Please see my website for an example of using the newer Adafruit library: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/#cp

  • @517anon
    @517anon 3 года назад

    GPIO 6 is a ground pin. Ground pins are not configurable.

    • @rdagger
      @rdagger  3 года назад

      The physical pin number is not the same as the GPIO number which is often called the Broadcom or BCM number.

  • @Codebyakshay
    @Codebyakshay 10 месяцев назад

    Hey i have 20x4 will it works the same way u mentioned above ?

    • @rdagger
      @rdagger  10 месяцев назад

      It should. You will need to specify a column width of 20 instead of 16.

  • @user-it6jd1sb6k
    @user-it6jd1sb6k 9 лет назад

    Thanks. Because of this video I have to buy such a display. What a cool toy...

  • @silversisask2328
    @silversisask2328 8 лет назад

    Very clear and good tutorial. Could you make a tutorial of a raspberry Pi Bluetooth soundboard? Playback activated by a Bluetooth remote or smart device (phone, smartwatch) or possibly a Bluetooth keyboard.

  • @ErdosainNueve
    @ErdosainNueve 5 лет назад

    Hi. I want to use the Adafruit library, but my lcd display is 2004a. And with a backpack PCF8574t, how can i change the pins in Adafruit library to match the mine?? Thanks (i dont speak english)

    • @rdagger
      @rdagger  5 лет назад

      I have a tutorial on the PCF8574: ruclips.net/video/i5A5AsDRRwQ/видео.html

  • @PAOLAHERNANDEZ-kv1mu
    @PAOLAHERNANDEZ-kv1mu 9 лет назад

    good an error when compiling your code , at line 59, 181, 98 .. someone help me urgent 'm using the raspberry pi .. 2 Model B appears to be me ??

  • @krzysztofpiechota1554
    @krzysztofpiechota1554 9 лет назад

    Hello when i use "sudo ./Adafruit_CharLCD_IPclock_example.py" on display i can see some japan signs and some another signs. What can i do to fix it? (Sorry for my english)

    • @rdagger
      @rdagger  9 лет назад

      +Krzysztof Piechota Double check your wiring and that the GPIO pins you used match the ones specified in the Adafruit_CharLCD.py __init__. Make sure you don't have any other programs also using those GPIO pins. Do you get the same characters each time or are they random?

    • @krzysztofpiechota1554
      @krzysztofpiechota1554 9 лет назад

      I repare it, file lcd.py was wrong

  • @ColeDuersch
    @ColeDuersch 7 лет назад +1

    7:59 for adafruit library

  • @BretWrightSTUFF
    @BretWrightSTUFF 5 лет назад

    I am currently running Octoprint from an RPi to control my 3D printer. GPIOs are free, I can run this extract program to monitor Enclosure temperature and IP address etc correct?

    • @rdagger
      @rdagger  5 лет назад

      I'm note sure about the OctoPi image, but it should work.

  • @GeorgeInAShed
    @GeorgeInAShed 8 лет назад

    great video, everything was working fine but if i put your test code into a new python project and run it it just gives me a load of jibberish on the lcd but it works fine ifi run it line by line on the shell.
    this is for the raspberry spi guy code.
    many thanks george

    • @rdagger
      @rdagger  8 лет назад

      Do you get gibberish if you try the Adafruit library too? Please see my website because the Adafruit library has breaking changes since the video. Your program might have another library that is causing a conflict on the GPIO’s used by the LCD. You could try changing the GPIO pins or commenting out sections to see if it fixes the problem. Gibberish is usually caused by incorrect wiring or poor connections which can lead to intermittent problems.

    • @GeorgeInAShed
      @GeorgeInAShed 8 лет назад

      okay thanks ill try it out

  • @iscromanpc
    @iscromanpc 9 лет назад

    The best tutorial for use a 16x2 LCD Display with a Raspberry Pi. I followed the instructions in the Adafruit site with no success. I'll try with this solution. Thanks.

  • @kenstovall7216
    @kenstovall7216 6 лет назад

    I just installed one of the temp probes on my Pi and was looking for some code or software that will allow me to display my temp in f on the front of my Monitor or even have it email me if it drops or get above a certain deg. I have found some very plan code but again was looking for something that would really stand out. Thank you and your videos are very nicely done !

  • @Unknown-vk9bh
    @Unknown-vk9bh 9 лет назад

    Help please im stuck at 7:13 when i enter "lcd.lcd_init" it says "Runtime error: No access to /dev/mem. Try running as root !" however how can run as root because sudo dont work?

    • @rdagger
      @rdagger  9 лет назад

      In order to use GPIO, you need superuser privileges. Take a look at 4:58 where from a terminal window, I use: /usr/bin/gksu -u root idle

    • @Unknown-vk9bh
      @Unknown-vk9bh 9 лет назад

      rdagger68 oh lol i guess i must have skipped that part

  • @ogbananaswag3330
    @ogbananaswag3330 9 лет назад

    I typed in os.chdir('/home/pi/lcd') and I received a message saying that no such file was found. Can anyone help me figure out this issue?

    • @rdagger
      @rdagger  9 лет назад

      OG BananaSwag Did you create a folder in your home directory called lcd? The command is case sensitive, so make sure you didn't spell it LCD. When in doubt you can use the file manager to find the folder and then copy the path from the address bar.

    • @ogbananaswag3330
      @ogbananaswag3330 9 лет назад

      rdagger68 THANK YOU SO MUCH lol i appreciate it

  • @onlyac
    @onlyac 3 месяца назад

    Is this a pi 1 b or will the tutorial work for that model ?

    • @rdagger
      @rdagger  3 месяца назад

      The pi used in the video is pi 1 b+ circa 2014. The wiring and code should work for any pi single-board computer. However, the Adafruit library has been deprecated so I recommend the newer Adafruit CircuitPython CharLCD library. There is an updated example on my website: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/#cp

  • @progameer1
    @progameer1 9 лет назад

    help!
    my screen shows squares and no letters or numbres. i´ve rewired it a couple of times and im quite shure it´s ok. can anyone tell me why it doesn´t work???!?

    • @rdagger
      @rdagger  9 лет назад

      You may have to lower the contrast. Also double check that the pins you specified in the code match the GPIO pins.

    • @progameer1
      @progameer1 9 лет назад

      hahah thank you, i already fixed it at night... the thing was that my soldering is not the best so i had to re solder all the connections. after that, the lcd worked fine (well... i still need a potenciometer for the contrast but i can barely see the letters

  • @vanhetgoor
    @vanhetgoor 5 лет назад

    Now making a book reader is a little whistle of a penny! (fluitje van een cent)

  • @boston_rob
    @boston_rob 9 лет назад

    @7:13 I get a run time error for line 117 "please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)" did anyone else run into this and fix it? I've been trying to figure it out but can't yet.

    • @rdagger
      @rdagger  9 лет назад

      Rob Nordberg Sounds like you skipped some of the initialization code. Look at the code that I cut and paste at 5:50 in the video.

    • @boston_rob
      @boston_rob 9 лет назад

      rdagger68 That didn't fix it :(

    • @rdagger
      @rdagger  9 лет назад

      Rob Nordberg Did you trying downloading the code from my website: www.rototron.info?

  • @KimHenriksen.
    @KimHenriksen. 8 лет назад

    great=)

  • @FalcoGer
    @FalcoGer 4 года назад

    why is everyone always using python?

    • @rdagger
      @rdagger  4 года назад

      Faster development, easy to learn, less code, very readable syntax, great documentation, supportive community, vast collection of available open source libraries (especially AI).

  • @cahau8393
    @cahau8393 9 лет назад

    if the panel is not displaying anything but i am pretty sure there is no error to the connection and code? what could be the reason behind??

    • @rdagger
      @rdagger  9 лет назад

      +CA Hau The most common problems are the backlight or the contrast. Check the datasheet and make sure you have the proper voltage and resistor, if necessary, for the backlight. Grounding the contrast pin should provide maximum contrast. Next double check that you specified the correct GPIO numbers when you initialized the display and confirm the datasheet pinout. Some displays have different placements for D4-D7. Also make sure you have an LED backlight. Some displays are electroluminescent which are harder to set up. Often you can still see text with the backlight off if you look very carefully at the right angle. Finally try a different library (Adafruit or Raspberry Pi Spy) to confirm it's not software. Also see my website for more info (link in description above).

    • @cahau8393
      @cahau8393 9 лет назад

      +rdagger68 thankyou for the prompt reply, i realised that i did some mistake to the declaration for RS and E, it should be gpio pin num not the pin num of the pi

  • @marcusjackman1487
    @marcusjackman1487 5 лет назад

    Would it be possible to hook up more than one of these LCD displays to your Raspberry Pi and control them separately from your Pi? I have a project that would require 4 of these LCD displays displaying separate information and data, but I really don't want to have to buy 4 raspberry pi's to accomplish this.

    • @rdagger
      @rdagger  5 лет назад

      Yes you can daisy chain multiple LCD displays using I2C. You can buy I2C LCD displays or your can convert an LCD display to I2C. I have an I2C LCD display tutorial: ruclips.net/video/i5A5AsDRRwQ/видео.html

  • @MrKristian252
    @MrKristian252 8 лет назад

    You only edited the script live, instead of saving it, then running it as a program.. Could you show that?

    • @rdagger
      @rdagger  8 лет назад +1

      Please check out my other videos. I have several that demonstrate how to run programs with LCD displays.

    • @MrKristian252
      @MrKristian252 8 лет назад

      Yep, typical me typing comments before doing research.

  • @r1alcatraz
    @r1alcatraz 2 года назад

    More than eager to explore with this...

  • @ravikumaronweb
    @ravikumaronweb 4 года назад

    very nice

  • @aditid5513
    @aditid5513 9 лет назад

    I tried the first method ,but instead of characters some symbols are displaying.
    Im using Rpi b+ and YJHD 162A 16*2 LCD.What to do?

    • @rdagger
      @rdagger  9 лет назад +1

      Sounds like wiring, but there could be several causes. First double check your wiring and your datasheet. Make sure R/W is connected to ground and that RS, Enable and D4-D7 are connected to the GPIO pins you specified in LCD.py. Next I would try the Adafruit library to see if different software works better.

  • @adamobrien5892
    @adamobrien5892 9 лет назад

    Hi, i don't know what happening. I got it working before using this video and the adafruit library. But today it just isnt working. i re downloaded and did it all and it still runs stuff such as lcd.message() without saying theres a problem but no text will appear on the display?

    • @PixelPickaxe
      @PixelPickaxe 8 лет назад

      You should move this question to a forum.

  • @nikyabodigital
    @nikyabodigital 6 лет назад

    Why do I type commands on Terminal instead of in the Python application itself. Please answer me.

    • @rdagger
      @rdagger  6 лет назад +1

      I am typing all the python commands into the IDLE shell which is a great learning tool for python because of its interactivity. IDLE is a simple IDE that comes bundled with most python distributions.

  • @samu0124
    @samu0124 4 года назад

    thanks! very useful information

  • @jimbelmore7756
    @jimbelmore7756 7 лет назад

    thank you for your time and your knowledge. I have now been able to get a lcd1602 basically functioning. I am unable to get the adafruit_charlcd or ipclock_examples working. i have performed chmod +x but when I run sudo ./Adafruit_CharLCD_IPclock_example.py I get unable to execute.....no such filename or directory. I am trying to get through all your tutorials and I don't know if I was supposed to assume something and chmod something else or if its a result of how I obtained the files. adafruit has modified the repository and so those files are in a legacy tree so when you do a git clone what you get cloned is not the original directory but a readme file that tells you about the move they made and a link to page that tells you how to install something via pip. anyway I'm all over the board and I think this should be much more straightforward based on you video. I've looked at your website but it just reiterates the same info and I need to find out where I'm missing something. Thank you

    • @rdagger
      @rdagger  7 лет назад

      I updated the IP clock program to work with the latest version of the Adafruit Char_LCD library:
      www.rototron.info/lcd-display-tutorial-for-raspberry-pi#ipclock

  • @Sli3py
    @Sli3py 6 лет назад

    hi, I have followed your tutorial but I fail both methods with to initial the LCD, with the first method I got error "Traceback (most recent call last): File "", line 1, in File "/home/pi/lcd.py", line 14 import RPi.GPIO as GPIO import time" then I cannot call LCD in the interpreter, and with the second one (the Adafruit) I can not find the where I have to change the pin number. =( i am so sorry I'm very noob with electrical engineering and Raspberry Pi but I'm trying to learn, Thanks you so much for your answer in advance.

    • @rdagger
      @rdagger  6 лет назад +1

      You can't have 2 import statements on the same line which is what it looks like, but I'd need to see the full error message to better troubleshoot.
      For the Adafruit library, you specify the pins when you instantiate the LCD. For example:
      lcd = Adafruit_CharLCD(rs=26, en=19, d4=13, d5=6, d6=5, d7=11, cols=16, lines=2)
      There have been breaking changes since I posted this video 3 years ago. Please check out my website for updates: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/

  • @JesusGamayon
    @JesusGamayon 7 лет назад

    Thank you for this video, my friend, this is very useful. More power to you!

  • @freeflaminginfinite917
    @freeflaminginfinite917 8 лет назад

    Nicely done mate!
    You just scored another subscriber.

  • @MSDGurukul
    @MSDGurukul 6 лет назад

    nice tutorial sir.I followed each step from above video.make connections as it is. I used adafruit library for LCD Display.after power on raspberry Pi ,back light of 2x16 LCD is activated and getting 16 black boxes on display screen. But unable to show any string on display. please help

    • @rdagger
      @rdagger  6 лет назад

      You may need to adjust the contrast. Please check my website for more information.

    • @MSDGurukul
      @MSDGurukul 6 лет назад

      i tried with potentiometer to adjust contrast,and with this now I am able to adjust contrast.But still not showing any string character on LCD display.

    • @rdagger
      @rdagger  6 лет назад

      Did you try both libraries (Adafruit & Raspberry Pi Spy)? Make sure you specified the correct GPIO pins. Make sure you distinguish between board and BCM pins.

    • @MSDGurukul
      @MSDGurukul 6 лет назад

      finally sir ,it works. I used Adafruit library.I rechecked all connections.thank you for such nice tutorial .

  • @deathst3v3n
    @deathst3v3n 9 лет назад +2

    To lazy for this

  • @HemangJoshi
    @HemangJoshi 7 лет назад

    awesome video....
    keep going//........../

  • @akashk5117
    @akashk5117 7 лет назад

    hello,
    thanks for your tutorial.
    what should i do if i want to display a variable’s content on the 16×2 lcd?
    like for example i have a string stored in variable f.
    so how would i proceed to print contents of f?
    since you showed the displaying of user entered data.
    help would be much appreciated.

    • @rdagger
      @rdagger  7 лет назад

      Format is probably the best approach. I have many examples on my website. For example:
      # Display IP address
      lcd.message('IP {}'.format(ip))
      # Display power usage
      lcd.message('
      {0:0.1f} Watts'.format(p/1000))
      # Display pressure
      lcd.message("
      {0:0.0f} psi {1:0.1f} bar".format(psi, bar))
      # Display time
      lcd.message(datetime.now().strftime('%I:%M %p %b %d'))
      # Display temperature an humidity
      lcd.message("
      {0:0.1f}".format(t))
      lcd.write8(223, True)
      lcd.message("F {0:0.1f}%".format(h))
      # Display number of motion detections
      lcd.message('Motion Detected
      {0}'.format(counter))

  • @vashishtpanday3020
    @vashishtpanday3020 2 года назад

    Hello! Please let me know as soon as possible

    • @rdagger
      @rdagger  2 года назад

      The command should be GPIO.setmode(GPIO.BOARD) instead of GPIO.setmode(BOARD)
      You can use either BCM or BOARD mode. I just tested both and they work. If you use BOARD then you have to confirm you have the correct pin numbers for your specific Raspberry Pi.

  • @sunnydays1238
    @sunnydays1238 6 лет назад

    Hi, I have tried this but get the error "Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)" does anyone know what i need to do?

    • @rdagger
      @rdagger  6 лет назад

      Super-user privileges are no longer required for GPIO access with the latest version of Raspbian. GKSU is not recommended any more and has been removed from Raspbian distributions.

  • @markinhuhta
    @markinhuhta 8 лет назад

    It seems to work for a while, but when I restart my raspberry pi or program, it will start to print out weird signs, when I use the "message" command. It prints the right amount of signs on the screen, but not the letters. I'm able to clear the screen though. I'be tried both ways but have the same result. Also by using the instructions at adafruit.com

    • @rdagger
      @rdagger  8 лет назад

      +Johan Olsson If it works intermittently with multiple libraries then the most common cause would be wiring such as a defective jumper wire or a poorly soldered pin. It could also be a defective LCD display.

  • @simon5143
    @simon5143 7 лет назад

    I wonder if its possible to make a custom PCB to instantly wire up the hardware. It would save up some time when tinkering with different hardware, such when I would like to use a hat or the display.

    • @rdagger
      @rdagger  7 лет назад

      Adafruit has an LCD display plate for the older Pi’s (Eagle schematic and board on Github.) You could use it as a template to create a DIY version for the newer Pi’s. You could make or buy an I2c LCD display breakout. They only require 4 wires (2 for power and 2 for I2C). I have a Raspberry Pi I2C LCD display tutorial:
      www.rototron.info/using-an-i2c-lcd-display-with-a-raspberry-pi/
      Another option would be to buy a USB LCD display which is as easy as just plugging in a USB cable. I have another video on using USB LCD displays on the Pi with LCDProc:
      www.rototron.info/lcdproc-tutorial-for-raspberry-pi/

  • @reedl1767
    @reedl1767 8 лет назад

    Do you only have to use resistors on the backlight part of the display? Anyone can answer, thanks ahead of time.

    • @rdagger
      @rdagger  8 лет назад

      The control and data lines don't need resistors. You can use resistors or variable resistors on the contrast pin and the back light anode pin to control contrast and brightness. My weather clock video has a demonstration of using variable resistors to control contrast and brightness: ruclips.net/video/4l_nsNaMkuQ/видео.html
      The schematics and code for both videos are available on my website.
      Some LCD display backlights will require a resistor. Please check your LCD display datasheet.

  • @jannetjdayette1942
    @jannetjdayette1942 6 лет назад

    how to read the values of the voltage generator and display on lcd using raspberry pi and python ??

    • @rdagger
      @rdagger  6 лет назад

      I have a video on using an INA219 to read and display voltage and current on an LCD display: ruclips.net/video/BgShCD7xT_A/видео.html

  • @justinwhistine8162
    @justinwhistine8162 9 лет назад

    Could you please tell me what brand this LCD happens to be or could you please provide a link as to where you purchased it? I would really appreciate it.

    • @rdagger
      @rdagger  9 лет назад

      +Justin Whistine There's a link on the bottom of my temperature monitor project: www.rototron.info/projects/pi-temperature-monitor/

  • @bart10pont
    @bart10pont 7 лет назад

    good video to the point not too much jib jab

  • @laisa7389
    @laisa7389 4 года назад

    uhm there is no such file or directory in /usr/bin/gksu -u root idle how do i fix this ?

    • @rdagger
      @rdagger  4 года назад

      Super-user privileges are no longer required for GPIO access with the latest version of Raspbian. Therefore, GKSU is unnecessary. Also Thonny is now the default Python editor instead of Idle.

  • @yashadattsawant2380
    @yashadattsawant2380 7 лет назад

    can i do this? if particular mobile comes in wi-fi network then lcd screen should show the message

    • @rdagger
      @rdagger  7 лет назад

      Yes, you could do an ARP scan for MAC addresses. Or if you have a Wi-Fi dongle that supports monitor mode in Raspbian, you could create a Wi-Fi sniffer. There is a Python library called Scapy that would probably work. If you are trying to detect your own phone then I would take a look at Google’s proximity beacons.

  • @InnovativePanda
    @InnovativePanda 8 лет назад

    Hi,
    Great video. Got my LCD display successfully powered up. However, when I send a message using either of the python libraries, no message is shown on the LCD display. Any idea why?

    • @rdagger
      @rdagger  8 лет назад

      I would check the contrast and the brightness. If you look at some of my other videos or my website I demonstrate how to use potentiometers to adjust them.

  • @dha12oks
    @dha12oks 4 года назад

    Thanks mate, subbed.

  • @krzysztofgawryluk4501
    @krzysztofgawryluk4501 9 лет назад

    Yeah. This is what I was lookin for. Good job

  • @taoli5497
    @taoli5497 6 лет назад

    very good. thanks sharing.

  • @seeking9145
    @seeking9145 3 года назад

    5:02 I get "File or directory not found:" :-/

    • @rdagger
      @rdagger  3 года назад

      The video is 6 years old. Please see my website for updates (link in the video description).

    • @seeking9145
      @seeking9145 3 года назад

      @@rdagger Ah yeah I saw already that it was a editor and it isn't available anymore. So I wrote it with another editor. But I will continue with your update thanks

  • @progressivewholesomeness4937
    @progressivewholesomeness4937 4 года назад

    Is it possible to set up a 16×2 lcd
    And a 3.5" in capacitive touch screen as you monitor?

    • @rdagger
      @rdagger  4 года назад

      You can use a DSI or HDMI touch screen for your monitor and a 16x2 LCD to display text.

  • @G1ZJK
    @G1ZJK 7 лет назад

    Great video thanks.