Using LCD Displays with Arduino

preview_player
Показать описание
Learn to use LCD displays with an Arduino. All types of LCDs, including I2C and display shields are covered here.

Today in the workshop we will look at Liquid Crystal Displays or LCDs.

We will examine the use of two types of LCD displays - the common LCD1602 display module and a popular LCD Keypad Shield for the Arduino. We’ll also see how to use the I2C adapter for the LCD1602 display module.

LCDs are a very simple way to add display capabilities to your Arduino project. They are inexpensive, easy to use, and very versatile. They also don’t consume a lot of current so they are ideal for battery-powered projects.

I'll show you a couple of ways to interface an LCD with an Arduino, including the use of an I2C adapter. If you’re not familiar with the I2C (Inter-Integrated Circuit) bus it’s a very versatile method of adding sensors and peripherals to your Arduino using only a few wires. I’ll give a brief explanation about the operation of the IC2 bus in the video.

We will also build something practical while we are at it - a digital temperature and humidity gauge. This will make use of the I2C adapter and the DHT22 Temperature and Humidity sensor.

The video, and the accompanying article, will also show you how to use a very common LCD Keypad Shield for the Arduino Uno. The neat thing about this device is how the pushbuttons are wired. I’ll explain that and show you a demonstration sketch that you can build upon for your own projects.

Here is the Table of Contents for this video:

00:00 - Introduction
04:27 - The LCD1602 Display Module
07:04 - Hooking up the LCD and Arduino
09:49 - Demo Sketch 1 - Hello World
12:59 - Demo Sketch 2 - Scroll
15:39 - Demo Sketch 3 - Custom Characters
20:00 - Introducing I2C
23:44 - Hooking up the I2C Adapter
26:15 - I2C Address Test
27:08- I2C Display Test
32:48 - Building the Temperature & Humidity Gauge
37:39 - LCD Keypad Shield
41:00 - LCD Keypad Shield Demo Sketch

By the way, I should mention I had a “slip of the tongue” while narrating this video. During the “Custom Character” demo I described the LCD as having a 5 x 7 matrix, it’s actually 5 x 8. Sorry about that! One extra row for you to define your custom characters.

The article accompanying this video contains a link to a very handy resource, an online custom character generator that you can use to write the code to define your own custom characters. You’ll want to check that out.

As usual, the article has links to more resources and to a ZIP file with all of the code you see displayed here.

Hope you enjoy this video and that you use it to display something wonderful in your next Arduino project!
Рекомендации по теме
Комментарии
Автор

I2C finally makes sense. I've waited 78 years for this, the first few decades were useless, then there was confusion for a few years until suddenly; tonight my code decodes itself and does what I want. Woo Hoo! Thank you.

TheAmpair
Автор

I do not believe a presentation of higher quality is possible. Clear, concise, and professional. 2 Thumbs Way Up!!!!

eddelauter
Автор

While many of my age group have surrendered to the slippers and pipe brigade, I added two Nema 23 steppers to a Taig lathe with plans to use Mach 3 because I wanted to experiment with simple CNC. I describe doing this stuff as my anti-Alzheimer's strategy.
Initially I had modest success with Mach 3 using a parallel port computer but when I decided to move to a USB control, it became a very expensive and unsatisfactory white elephant. There is not much help for CNC novices with Mach 3 and it is now in the too hard basket.
After watching a number of your outstandingly clear and easy to watch videos, including "how to control a larger stepper motor" and this LCD video, I have now mentally transferred my modest CNC ambitions out of the "too hard basket" into the "active projects basket". So I thank you for providing a way forward.
Incidentally if you do have a video that deals with controlling and X and Y axis I would love to know about it.
Best regards and thanks.
Robert

robertwebb
Автор

Hello Sir, just wanted to thank you for your extremely high quality and comprehensive tutorial videos. It is really a pleasure following them as you provide all required information and background needed. You accomplish this at an optimal speed with friendly and clear voice. One of the best tutorials I've ever seen. Keep on with the great work! Regards from Mexico City.

Scanito
Автор

Im glad I found your videos, they are the best for learners like me. Slow and fully descriptive, with time to absorb what your teaching. Many thanks. VK2KWW

TheHellfiremissile
Автор

An excellent tutorial even for someone like me who has zero knowledge of electronics. Clear, precise, focused and, as others have said, presented with a slow, steady clear speaking voice. Impressive work!

thomasm
Автор

didn't even go all the way down of this video, you're so GOOD, can't believe some people disliked this, well can't satisfy everybody that's a real fact, Thanks for this hard work, you're the definition of confidence and knowledge

patson
Автор

I know this is an old video. But its literally perfect

GarlicMonoxide
Автор

I have just lately found your channel and I like it just fine... I know this is 5 years old now but you are getting me interested in some experimentation. I am a retired electro-mechanical engineer who worked extensively on automation projects in south Texas using programable logic controllers. So using these microcontrollers interest's me ...

mcgam
Автор

You make very clear, informative, easy to follow videos. I laughed a bit when you listed each consecutive pin 7 to 14, but again, you were very clear, not skipping any info, so I wouldn’t say you should change it. These videos are perfect! All I can ask is hat you continue to make more. And maybe do some viewer question videos.

DisgruntledPigumon
Автор

This man is a brilliant articulate educator. Love the videos as much as I enjoy electronics.

trentjackson
Автор

Thanks, occasionally I go back and re-watch these, seems at my time of life, some things that I used to know are no longer available in my gray database, and a reload is in order.

JerryEricsson
Автор

15:56
Note that each character on the display is actually a 5x8 matrix.

pngmmst
Автор

I was absolutely delighted not only with the well conducted, direct and detailed explanations that were coupled with didactic/illustrative diagrams, but also with the meticulously written “Article with code” accompanying the video. The moment I saw your organization at your workshop, where every tool was neatly positioned on the wall and drawers were gracefully housing all the micro components, I knew that this video was a good find. Congratulations for your excellent job! As for future videos, please include nice touchscreen LCD projects and some eye-catching Nextion LCD courses as well. Subscribing now to your channel!

maleck
Автор

You, good sir, just got yourself a new subscriber! I bought the keypad shield and searched through the whole internet on how to use it. Then I stumbled upon this tutorial and this really helped. Clear explanation and very thorough. This really helped, thank you! :)

aaroleikari
Автор

You are a treasure of a teacher! Your HC-SR04 tutorial is a masterpiece!

Vhbaske
Автор

for the lcd keypad, if acting up, one can add a setup routine in the beginning to assign analog readouts to variables upon pressing buttons and then use them in the condition tests. Great videos as always Bill! THANKS!

hadibq
Автор

Clarifying 11:50 (if I understand correctly): the loop doesn’t actually wait for 1 second to repeat, it repeats hundreds (thousands?) of times per second. It does integer division (no decimal after “/ 1000”) and rounds to repeat the same number display over and over. It’s not noticeable to the human eye, so the display simply counts seconds - even though the loop portion does repeatedly count in milliseconds.

ehb
Автор

I bought my own Arduino set and it really works, it really helps to tests our heart and BPM rate

yeethengkee
Автор

This is one of the best videos I have watched on audino and in particular LCDs. It's very detailed and informative. Am definitely following your channel right away. This is a great treasure sir.
Thanks alot for everything sir.
Greetings from Nigeria

valmontdain