Тёмный
No video :(

#23 LCD BIG DIGITS for your Arduino using I2C - Easy! 

Ralph S Bacon
Подписаться 54 тыс.
Просмотров 26 тыс.
50% 1

Using an LCD display is very easy using the I2C communications bus (just two wires plus power). Creating custom digits that take up two lines is also very easy and I show you exactly how to do that here.
So now your temperature gauge can now be read from across the other side of the room!
Step by step example of how to create a simple, single custom character first, then we use that knowledge to create further custom characters that we put together to make some BIG DIGITS.
The two demo code sketches (just copy them into a folder of EXACTLY the same name in your sketches folder) are linked below. You'll have great fun tinkering with the shapes of the characters - can you make it look better than mine? (Rhetorical question, of course not!!!)
Here are the links to the two demo sketches and the Liquid Crystal I2C library:
github.com/Ral...
Remember, for the second sketch you need to send any character from the Serial Monitor window (by pressing SEND) to move on to the next part of the demo).
Questions, comments and constructive suggestions can be left below the video. And please SUBSCRIBE so you don't miss any future videos.
And, as always, Thanks For Watching!
And my channel is here:
/ ralphbacon
How can I remember this? Memory tip: "See" Ralph Bacon, geddit?

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 87   
@RalphBacon
@RalphBacon 8 лет назад
Here are the links to the two demo sketches. First one (simple single custom character ) Second one (BIG DIGITS) github.com/RalphBacon/LCD_Big_digits Remember, for the second sketch you need to send any character from the Serial Monitor window (by pressing SEND) to move on to the next part of the demo).
@boldford
@boldford 6 лет назад
Thanks Ralph. Although I wasn't looking to print large characters on an LCD however your video provided the answer to another problem I had.
@boldford
@boldford 6 лет назад
Hi Ralph. Have these now been moved to a private part of your Dropbox?
@RalphBacon
@RalphBacon 6 лет назад
Links updated to point to my Github (it was correct in the video description but not here). Oops.
@RottnRobbie
@RottnRobbie 3 года назад
Hi Ralph - I know this is now pretty old content from you, but it's still relevant and useful 5+ years later... I was looking for information and tutorials on using the LCD screens for my current project, and when I saw you had one in your back catalogue, of course I had to watch it. And while I don't think I need the BIG NUMBERS this time around, I'm definitely going to use that "degrees C" character! So once again - Thanks Ralph!
@RalphBacon
@RalphBacon 3 года назад
Glad it was helpful! I want to use this font again in the near future.
@rinokentie8653
@rinokentie8653 2 года назад
Thanks Ralph. I always follow your channel and now found this gem. Six years old video, but just what I needed today!.
@RalphBacon
@RalphBacon 2 года назад
Glad to help!
@danboyce1
@danboyce1 Год назад
Great Arduino project. I used your sketch as the starting point to make a RTC-based large digit clock. Thanks….
@RalphBacon
@RalphBacon Год назад
Excellent! That's great news, glad it helped.
@docbanzai
@docbanzai 5 лет назад
Hi Ralph, just wanted to say thank you and also, possibly, supply a tip for some users. I had a problem that has had me scratching my head for a few days with this video/sketch. I always had an error on compiling ("unable to compile for board arduino nano") that had me weeping for a few days. In the end it turned out that my library was subtly different from the one you must be using. Simple fix that made my brain boil! Instead of lcd.begin() it had to be lcd.init(). Honestly it was making me almost give up on Arduino as I just couldn't figure it out and I had begin to believe there was something wrong with my wiring or the board itself. It was worth it though as the feeling of triumph when I cracked it was fantastic (yes I am very new to Arduino). I'm really enjoying my adventures as a novice Arduinite as it reminds me of my youth programming on ZX81, VIC20 and, later, BBC B (yes I'm really that old). I actually enjoy the limitations of Arduino as it forces you to be creative and problem solve. I really am grateful for your videos, they're perfectly paced, informative and 'comfortable' to watch. I've just seen your vid on the Fm Radio module and now I'm inspired to build a clock radio controlled with an IR remote (I've been working on just a clock but the radio, brilliant!) So thanks again, you are an inspiration and you're helping to keep my knackered brain active. Cheers!
@RalphBacon
@RalphBacon 5 лет назад
I'm glad you're liking the videos, DocBanzai, and I'm sorry you experienced those frustrations with the LCD library. Normally I include the libraries I use in my GitHub but this one is an old video and I don't believe I have a GitHub repository for it. But, and this is important, you didn't give up and eventually got a working solution. Just think of the experience you've gained. Sounds like you should do well with that clock radio project! And yes, I repaired my boss' ZX81 once, much to his delight. Didn't get me promoted though.
@docbanzai
@docbanzai 5 лет назад
@@RalphBacon Wish I still had my old ZX81, but that passed on many years ago. I've still got my Beeb which has been upgraded over the years and now runs everything from an internal SD card module which is great and I STILL mess with it from time to time! Just to go off on a complete tangent; referring to your video #5 (RTC modules) there was mention about a follow up video about the SQR and 32k pins on the module. I believe that SQR is a square wave generator and the 32k is some kind of non-volatile memory. Did you ever do this follow up or am I missing something? Please don't get me wrong, I'm not moaning! I think I've seen all your vids (more than once) and have never heard you mention it. I'm only asking as I'm curious whether the 32k (EEPROM I'm assuming) could be used as a sort of external storage device mainly for constant variables, strings etc. as I know the number of write cycles would probably be finite. I'm probably way off the mark but I hope you don't mind me asking. I have done (very) litle research but I'm kind of sticking to your vids for the time being as I prefer your style and, frankly, a lot of others just confuse me! Oh and just an idea but I've been reading about the TV-Out library that lets you output to tv, and it seems suspiciously simple. Is it something you're aware of or have tried? Haven't had the courage to try it yet as I don't want to blow up my TV! Thanks again!
@RalphBacon
@RalphBacon 5 лет назад
Hmmm, long time ago that video... I probably did not follow up on the 32K EPROM because I instead did a video on the onboard EEPROM on the Arduino. Same principle but easier to use on the Arduino. I just didn't get a vibe that there was that much interest on (yet more) EEPROM space, on what is effectively an external device that not every project needs. Especially as it can't be used as run-time memory or program space. The SQR is indeed a square wave output that can be configured to 1Hz which can be useful to light up a LED every second (it looks very slow but really is 1 second). Could be useful for interrupts on the Arduino (to wake it up every second) but, once again, I never really explored that. Oh dear! But all these comments do make me rethink whether there are legs on any of those ideas for a future video (or part video), so thanks for that, it's all been added to my list.
@solimaneluahabi7579
@solimaneluahabi7579 6 лет назад
Hi Ralph thanks for your amazing effort. i have been watching your videos for sometimes i love the way you portray your lectures. i would love to ask you could explain the array with double square bracket in this lecture or if you recommend another another video that would shed some light on array with double square bracket within arduino syntax. many thanks
@RalphBacon
@RalphBacon 6 лет назад
When you say "double brackets" do you mean [ ] or [ ] [ ]? They both indicate an array, the first is a simple, one dimensional array like this: int scores[ ] = {9,8,7,6,5,4,3,2,1}; You then refer to each *element* of the array like this: Serial.print(scores[4]); which is actually the 5th element because arrays always start at zero: scores[0] value is 9 because that is the zero'th (first) element in the array. The second is an array of arrays. In the Real World think of it as a list of lists, such as a stack of boxes each with several colours of pencil in each. box 1 contains red, green pencils box 2 contains blue pencils box 3 contains yellow, red, orange and pink pencils Do you see how this can be considered a list (of boxes) of lists (pencil colours)? In C++ this might be described as: string boxes[ ][4] = {{"red", "green"}, {"blue"}, {"yellow", "red", "orange", "pink"}}; How to get the "yellow" colour? Serial.println( boxes [2][0]); Starting always from zero, this is the *third* box, first [0] colour within it. You can practice this here: www.tutorialspoint.com/compile_cpp_online.php which allows you to type in simple C++ stuff like this and execute there and then. Have a guess how I validated my examples?! Here's a complete example: #include using namespace std; int main() { string boxes[ ][ 3] = {{"red", "green"}, {"blue", "pink", "grey"}}; cout
@solimaneluahabi7579
@solimaneluahabi7579 6 лет назад
yes i meant this double double [ ] [ ]. can you give an example on this one
@RalphBacon
@RalphBacon 6 лет назад
The example is already in the reply above! It starts with the words "The second is an array of arrays..." Have a read and tell me what you think, Soliman.
@billglass5160
@billglass5160 3 года назад
Excellent tutorial! Bravo! Your special characters have a nice style! I used them for my bedroom clock. Nighttime, I'm not very talented for reading those small numbers. Daytime, I switch to normal display with day, date, outside temperature, and pool water temperature. I wonder if anyone has also been able to make big letters even though we only have 8 special characters available. Thanx!
@RalphBacon
@RalphBacon 3 года назад
Glad you like them! Oh, I just read, "...pool water temperature". Sigh. In my dreams.
@billglass5160
@billglass5160 3 года назад
@@RalphBacon 29dgC, sunny & warm! It's almost California weather today!
@felixhartard5569
@felixhartard5569 3 года назад
Thank you for this very good explanation.
@RalphBacon
@RalphBacon 3 года назад
Glad it was helpful!
@maxximumb
@maxximumb 8 лет назад
Nice job, well explained and very interesting.
@RalphBacon
@RalphBacon 8 лет назад
+Maxx B Glad you liked it. It's just not that complicated when it's laid out step by step, is it? If you have any suggestions for future videos just post them in the Discussions section or right here under any video!
@maxximumb
@maxximumb 8 лет назад
+Ralph S Bacon I'm new to electronics and I suppose I could describe myself as a mature student. I've spent a lifetime programming, learning BASIC in the 80s and several languages since. Since an illness has left me partially disabled, I'm teaching myself electronics to try to keep my brain going and as exercise for my hands. The arduino is turning out to be a great way to incorporate my programming experience with electronics. My current project is to make an RF controlled vehicle using this pair of modules bit.ly/arduino-rf to provide the communication between the controller and the vehicle. I'd be interested to see a project using the Tx/Rx pair.
@RalphBacon
@RalphBacon 8 лет назад
Sounds an interesting project (not to mention a challenge!). I will doubtless get round to the RF modules but before then I want to cover the various wi-fi modules (ESP8266) and the bluetooth module. If you can code then the electronics will be less of a challenge (most people in the Arduino forum face challenges with coding). So much to cover and so little time to do it all in. Stay tuned for future videos and do spread the word if at all possible :)
@Graham1904
@Graham1904 5 лет назад
Your videos are great but I wish you wouldn't use a metal pointer when the power is on :)
@RalphBacon
@RalphBacon 5 лет назад
I use a wooden, red chopstick now, much safer!
@pistiberez
@pistiberez 6 месяцев назад
U must change: lcd.begin(); to lcd.init(); error if not change :
@RalphBacon
@RalphBacon 6 месяцев назад
Yes, a later version of the library made this breaking change, very bad not for it to be backward compatible.
@vibhor6685
@vibhor6685 4 года назад
Hello Mr.Ralph, Thank u for such a useful video. I am not able to toggle the display with the help of the button on the breadboard. The connections are correct. And is there a way to skip that as well? thanks in advance. :)
@RalphBacon
@RalphBacon 4 года назад
Hi Vibhor, let's see. If you are using my unchanged LCD_CustChar_Demo_2 then it is line 107 that is causing you issues. The code stops there whilst PIN 7 (GPIO D7) is HIGH. You must connect D7 to GND for the code to continue. Or else just comment out the line that reads: while(digitalRead(7)) { } I hope this helps!
@DTGcolor
@DTGcolor 7 лет назад
Nice! Thank you very much
@RalphBacon
@RalphBacon 7 лет назад
Glad you liked it Hung Viet! I use the Big Digits every day in my Wireless Rain Sensor receiver (video #54) and it works very well. I can read the temperature the other side of the room. Thanks for posting.
@DTGcolor
@DTGcolor 7 лет назад
I am using the nodemcu module and I have also done it. Thank you for sharing
@solimaneluahabi7579
@solimaneluahabi7579 6 лет назад
superb thank you
@RalphBacon
@RalphBacon 6 лет назад
Glad you liked it Soliman. I used the big digits in another project to tell me when it was raining so I could bring the cat basket and stuff in - the big digits display the temperature, all described in video #48. Thanks for posting.
@Karl_Levine
@Karl_Levine 3 года назад
Great work Ralph. One thing I'm wondering about. This i2c module has a jumper that when removed cuts off power to the backlight. I'd like to remove it and Powe & control the backlight to make it dimmer, by a pot or maybe even PWM? Any ideas on this? Many thanks 👍
@RalphBacon
@RalphBacon 3 года назад
You can do this but not by using a pot. 😱 Background: The LED is on pins 15 & 16 on the LCD module and the jumper connects pin 15 to VCC. Pin 16 is then controlled by an NPN transistor on the backpack module. If you remove the jumper, you can control the power at pin 15 (VCC) by connecting to one of the bare jumper connections (your multimeter will tell you which one is connected to pin 15 on the backpack). You could easily turn the LED on and off just by connecting it to a digital pin on the Arduino (warning! measure the current being drawn first, across the jumper, must be less than 20mA, probably is). To control the brightness in a more granular fashion, you can use PWM on a digital pin that supports it too by using AnalogWrite (I'm guessing you know all this).
@Karl_Levine
@Karl_Levine 3 года назад
You're awesome Ralph 👍many thanks! No, I didn't know all of this, the info you gave me was exactly what I was looking for! Thank you very much.
@Karl_Levine
@Karl_Levine 3 года назад
My module's jumper print claims the jumper shorts "5v to Gnd" 🙄
@RalphBacon
@RalphBacon 3 года назад
The 5v (VCC) goes to the LED first (via the jumper) then to ground via the transistor - at least, that's what the schematic shows. If there is no transistor present then it would need a resistor to limit the current, probably 200Ω or thereabouts.
@Karl_Levine
@Karl_Levine 3 года назад
Aha! Many thanks for everything Ralph!
@rwils6333
@rwils6333 5 лет назад
Great video
@RalphBacon
@RalphBacon 5 лет назад
Thank you, R Willis, appreciated.
@kamd9703
@kamd9703 2 года назад
hello sir. why am i trying this and printing two int values ​​ADC . A0/A1 . but one of the values ​​displayed on the LCD is blinking.
@RalphBacon
@RalphBacon 2 года назад
There is a function in the Liquid Crystal library to turn blinking on and off. Ensure you have not called that. Also, check that it really is blinking and not your code displaying a value, then displaying blanks, then displaying a value again - it looks like it is blinking but is not. I would change the sketch to display the values of A0 and A1 _separately_ first, and then combine them.
@kamd9703
@kamd9703 2 года назад
Can you help me. I want to display 2 adcs with lcd 1602. but when I print. displayed value. A0 blinking . A1 is good
@bulthy1958
@bulthy1958 2 года назад
Hi, I have been trying to get this to run (Im very new to programing) keeps stopping at lcd.begin any help please, thanks.
@RalphBacon
@RalphBacon 2 года назад
You say it stops at lcd.begin(). That sounds like it hasn't found the I2C screen. Did you first load the 'scanner' sketch to get the address of the screen? It might be the default 0x27 but could be some other address - no point in guessing, load the scanner.ino and see what it finds.
@electronicsideas1361
@electronicsideas1361 Год назад
need a big digit clock using 20x4 lcd and rtc
@RalphBacon
@RalphBacon Год назад
Well, the example sketches I provide should easily get you started, and if you use an ESP32 you can join a Wi-Fi network to get the time (the ESP32 auto-syncs the internal time against real-time).
@billglass5160
@billglass5160 3 года назад
Nevertheless, I have a question(as I'm hunting a bug): Why is each of your custom characters specified on 8 bytes and not 7 as shown in the Arduino example below? uint8_t custChar[8][8] = { {31, 31, 31, 0, 0, 0, 0, 0}, // Small top line - 0 {0, 0, 0, 0, 0, 31, 31, 31}, // Small bottom line - 1 { B11111, B00000, B00000, B00000, // This shows an alternative B00000, // way of defining a custome character, B00000, // a bit more 'visually' perhaps? B00000, B11111, }, //{31, 0, 0, 0, 0, 0, 0, 31}, // Small lines top and bottom -2 {0, 0, 0, 0, 0, 0, 0, 31}, // Thin bottom line - 3 {31, 31, 31, 31, 31, 31, 15, 7}, // Left bottom chamfer full - 4 {28, 30, 31, 31, 31, 31, 31, 31}, // Right top chamfer full -5 {31, 31, 31, 31, 31, 31, 30, 28}, // Right bottom chamfer full -6 {7, 15, 31, 31, 31, 31, 31, 31}, // Left top chamfer full -7 }; Arduino example: www.arduino.cc/en/Reference/LiquidCrystalCreateChar byte smiley[8] = { B00000, B10001, B00000, B00000, B10001, B01110, B00000, };
@RalphBacon
@RalphBacon 3 года назад
Without re-engaging my entire thought process for this design, I'm assuming my characters are taller and use the entire set of pixels?
@billglass5160
@billglass5160 3 года назад
@@RalphBacon yes, OK. I made a mistake. LCD pixels are 5x8, not 5x7. When I use the LiquidCrystal_I2C.h library and I do lcd.print(line), where line is a character string, I only see 7 lines of pixels (if my vision is not too cloudy). This must be because the folks that wrote that library wanted to keep a small space between the 2 lines of the display. Sorry to bother you for that!
@RalphBacon
@RalphBacon 3 года назад
No bother, Bill, it's all a learning experience!
@XXXXIndices
@XXXXIndices Год назад
I have used a lot of these, only ever seen 2 addresses, 0x3F or 0x27.
@RalphBacon
@RalphBacon Год назад
You're undoubtedly right, but in a single project I guess it would be unusual to use more than one, right?
@XXXXIndices
@XXXXIndices Год назад
@@RalphBacon Yes but they don't all have unique addresses as you described. just one or the other.
@beehivescale9535
@beehivescale9535 8 лет назад
hy. i know this is big digids video tutorial but i like to turn on-off lcd i2c 16x2 when i dont need more lcd. i have arduino in deep sleep but lcd dont want to turn off. it turns off only backlight. tanks for amwser
@RalphBacon
@RalphBacon 8 лет назад
+zoran b I can't find a register command for the HD44780 chip (that controls the LCD) to put it into 'sleep' mode but one way (given that you are putting the Arduino into deep sleep) is to control the power to the LCD via the Arduino (either a logic-level MOSFET or an NPN transistor) on a standard GPIO pin. Switch the LCD on when you come out of deep sleep, wait 50ms for the LCD to initialise (says the datasheet, but you may need to give it a bit more time) and you are on your way. Shut off the power via the Arduino just before you set the Arduino into deep sleep. I hope this helps! And thanks for the interesting question.
@warnithathilakarathna6849
@warnithathilakarathna6849 4 года назад
brow thanks a lot. i have made a lcd clock with rtc 3231.but in small digits in 1602 dispay. i want to show it with big digits.can u give me a help?
@RalphBacon
@RalphBacon 4 года назад
Simply download the example sketch of mine from my GitHub and see how that works. It's all straightforward. I have just done exactly that for a project I am working on for this Friday's video! What a coincidence! Have a look at what I do there (also a time display).
@warnithathilakarathna6849
@warnithathilakarathna6849 4 года назад
what a person you are?thanks a lot brow. i will try with this.
@mostafakaram9792
@mostafakaram9792 3 года назад
Nice! Thank you very much --- Where is the code please
@RalphBacon
@RalphBacon 3 года назад
In the description! github.com/RalphBacon/LCD_Big_digits
@leehewitt9559
@leehewitt9559 6 лет назад
Hello Ralph, great video. I can't seem to locate the code for this project; it seems to be a broken link.
@RalphBacon
@RalphBacon 6 лет назад
I will sort this out in a day or so, thanks for letting me know. What's happened is that Dropbox has removed the public access to the files. I will move them to a Github repository as soon as I can. I'll update here when that is done.
@RalphBacon
@RalphBacon 6 лет назад
Links in the comments updated to point to my Github. Video description was already up to date. Enjoy!
@jozsefkotalik7985
@jozsefkotalik7985 4 года назад
Can you share the temperature meter code?
@RalphBacon
@RalphBacon 4 года назад
It's all in my GitHub repository, József: github.com/RalphBacon/LCD_Big_digits Enjoy!
@boldford
@boldford 6 лет назад
It's a little unfortunate there is an 8 custom character limit.
@RalphBacon
@RalphBacon 6 лет назад
Indeed, Brian, indeed. But we must accept that and be creative! The big digits I use (in daily use showing the outside temperature in Benny's cat run) is very readable across the room. And perhaps this is where the custom characters excel, rather than defining a whole raft of them. But, as you say, if only the chip manufacturer had allowed a full 128 though, or 256, or... oh well!
@dekipet
@dekipet 2 года назад
Just messing around to make a bigger number on my LCD and wonder where to find some example. Check Google, Google says check Ralph. As usual... Next time I will firstly check Ralph.
@RalphBacon
@RalphBacon 2 года назад
Ha ha! Yes, I'm using the big digit code on my Smart Heater Controller in my workshop. I literally just copied and pasted my original code (from an Arduino) into the sketch for my ESP32 and it "just worked". How good is that?
@bulthy1958
@bulthy1958 2 года назад
used I2C _scanner no result!!!!
@RalphBacon
@RalphBacon 2 года назад
That means your I2C device is not connected up correctly (or powered incorrectly). Check SDA vs SCL lines. You need it to be recognised to move forwards. Try another I2C device (any kind) to prove your sketch is working OK. You're running this on an Arduino Uno?
@RalphBacon
@RalphBacon 2 года назад
Pease add your reply to _this thread_ and don't repost another topic!
@bulthy1958
@bulthy1958 2 года назад
I cannot think of a way to test LCD so ordered another, however I connected an LED in series with a resistor clock and data both showed the Uno to be active. I don't have any other I2C items. Thank you for your time.
@RalphBacon
@RalphBacon 2 года назад
Once you have your scanner sketch telling you that it has found something on the I2C bus, your LCD sketch (to prove it works) should look like this: #include #include // Set the LCD address to 0x27 (default) for a 16 chars and 2 line display LiquidCrystal_I2C lcd(0x27, 16, 2); void setup() { // initialize the LCD lcd.begin(); // Turn on the backlight and print a message. lcd.backlight(); lcd.print("Hello, world!"); } void loop() { // Do nothing here... } Pins A4 and A5 are SDA and SCL respectively.
Далее
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Просмотров 7 млн
ЛОВИМ НОВЫХ МОНСТРОВ В LETHAL COMPANY
2:42:22
СЕРЕГА ПИРАТ - TEAM SPIRIT
02:37
Просмотров 351 тыс.
Display examples - which one to use?
12:41
Просмотров 254 тыс.
Switching OLED-0010 character display to SPI
20:30
Просмотров 3,3 тыс.
Using LCD Displays with Arduino
46:23
Просмотров 1,7 млн
6 Horribly Common PCB Design Mistakes
10:40
Просмотров 191 тыс.
EEVblog #1044 - LCD Technology Tutorial
26:46
Просмотров 178 тыс.