Тёмный

Lesson 28 - 4 Digit 7 Segment Display 

Ricardo Moreno
Подписаться 13 тыс.
Просмотров 116 тыс.
50% 1

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

 

26 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 87   
@GaryMarkowski
@GaryMarkowski 3 года назад
Nicely done! Very thorough! Wow! Thank you for saving me from burning out the output pins on my Arduino! I only have two transistors in my starter kit, so I am displaying just 2 digits for now. I modified my displayDigits function to display each of the 2 digits for 1 ms each, and I added a for loop around that to set how long in ms to display the two digits for (eliminating the flicker). I set this to about 50 ms which worked great for my decimal counter (0 to 99). Now I know more about transistors!
@GaryMarkowski
@GaryMarkowski 3 года назад
Wonderful tutorial! BTW... I used the pin connections similar to the Arduino tutorial, so my bit positions are different from your spreadsheet, and the values being output for each number are different from your circuit. I used this code to determine the decimal values to output according to my pin connections. // Bit positions for each segment const int legTop = 0; const int legUpperRight =1; const int legLowerRight = 2; const int legBottom = 3; const int legLowerLeft = 4; const int legUpperLeft = 5; const int legMiddle = 6; const int legDecimalPoint = 7; int setSegments(int number, bool decimalPoint) { int retSegments = 0; switch(number) { case 0: bitSet(retSegments,legTop); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); bitSet(retSegments,legBottom); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); break; case 1: bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); break; case 2: bitSet(retSegments,legTop); bitSet(retSegments,legUpperRight); bitSet(retSegments,legMiddle); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legBottom); break; case 3: bitSet(retSegments,legTop); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); bitSet(retSegments,legBottom); bitSet(retSegments,legMiddle); break; case 4: bitSet(retSegments,legUpperLeft); bitSet(retSegments,legMiddle); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); break; case 5: bitSet(retSegments,legTop); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legMiddle); bitSet(retSegments,legLowerRight); bitSet(retSegments,legBottom); break; case 6: bitSet(retSegments,legTop); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legBottom); bitSet(retSegments,legLowerRight); bitSet(retSegments,legMiddle); break; case 7: bitSet(retSegments,legTop); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); break; case 8: bitSet(retSegments,legTop); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); bitSet(retSegments,legMiddle); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legBottom); break; case 9: bitSet(retSegments,legTop); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legMiddle); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); bitSet(retSegments,legBottom); break; case 0x0A: bitSet(retSegments,legTop); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legMiddle); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); break; case 0x0B: bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legMiddle); bitSet(retSegments,legLowerRight); bitSet(retSegments,legBottom); break; case 0x0C: bitSet(retSegments,legTop); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legBottom); break; case 0x0D: bitSet(retSegments,legMiddle); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legBottom); bitSet(retSegments,legUpperRight); bitSet(retSegments,legLowerRight); break; case 0x0E: bitSet(retSegments,legTop); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legMiddle); bitSet(retSegments,legBottom); break; case 0x0F: bitSet(retSegments,legTop); bitSet(retSegments,legUpperLeft); bitSet(retSegments,legLowerLeft); bitSet(retSegments,legMiddle); break; default: retSegments = 0; } // End Case if (decimalPoint) { bitSet(retSegments,legDecimalPoint); } return(retSegments); }
@Enigma758
@Enigma758 Год назад
12:54 You are overdriving the 74HC595 which has a max chip current of 70mA. With 5v supply, 2.0v forward voltage of red led and 220ohm resistor, each segment requires (5-2)/220 = 13.6mA. When displaying an "8" that's 7 segments x 13.6mA = 95.2mA.
@deadlyorchard
@deadlyorchard 9 месяцев назад
I'm just starting out with micro controllers and just finished wiring this. If I proceed, will the shift register just have a shorter lifespan? If so, how much shorter?
@Enigma758
@Enigma758 9 месяцев назад
@@deadlyorchard It's a roll of the dice. Just use higher value resistors, 470 instead of 220 and you should be fine. You won't even notice the difference in brightness.
@randomrandom5
@randomrandom5 3 месяца назад
I think you might've messed up the math there. (5-3)/220 = 0.00909, not 0.0136. 0.00909 x 7 segments = 0.0636 = 63.6mA
@Enigma758
@Enigma758 3 месяца назад
@@randomrandom5 Actually it's the (5-3) part that has a typo. The forward voltage of a red LED is around 2v (see preceding sentence above). So my analysis still stands, and thanks for pointing out the typo! (corrected above)
@wclumiere5665
@wclumiere5665 5 лет назад
Very good and well explained tutorials Ricardo, I've been looking for this kind of 74HC595 shift register tutorials and even though there are plenty all over the net, I've been able to really understand how they work with your explanations. Could you please make a tutorial showing how to control a Led matrix and if possible how to create some effects on it like scrolling right to left and vice versa and some other effects? Like I said before there are a lot of videos about led matrices but they only show the hardware part but not how the code really works. If you decide to do it I will really appreciate it. Thanks for all your Hard Work. Keep it UP!
@rickmorenojr
@rickmorenojr 5 лет назад
Thanks! Great suggestion! I worry that sometimes I go over the code in too much detail.
@amruthanair9988
@amruthanair9988 5 лет назад
wow such a good dumbo
@Inertia888
@Inertia888 5 лет назад
@@rickmorenojr Certainly not too much detail. It has taken me quite a number of hours to find such a quality explanation with such detail that I am able to begin to understand this project. Since beginning with LCD displays and I2C connections, seven segment displays with this type of connection were surprisingly more complicated. Maybe this is why it has not been easy to find great tutorials on them? I don't know...🤷‍♂️ Either way, I am grateful for the work that you put in to help others learn. We may be very quickly approaching a world that will require this type of knowledge from us. At very least I think that having this knowledge will give a person a hand up in life.
@clarkso65
@clarkso65 4 года назад
The best tutorial for arduino I have ever seen for now. :)
@ceoofpoonis3668
@ceoofpoonis3668 3 года назад
Clark what is your location
@killianrocky3431
@killianrocky3431 3 года назад
Pro tip : watch movies at Flixzone. Me and my gf have been using it for watching a lot of movies these days.
@alvinjamir3130
@alvinjamir3130 3 года назад
@Killian Rocky Yea, I've been watching on Flixzone} for years myself =)
@LHommeDeParfum
@LHommeDeParfum 4 года назад
Thanks for poiting out the flaws in the lesson 28 tutorial. Actually I am using a common anode but didn't realise the tutorial was about common cathode. But I could not figure out how to wire for a CC. So the shift register IC was boiling hot! I stopped everything. What are the modifications necessary for a common anode wiring? Cheers
@cones914
@cones914 3 года назад
Before I watch this video I am going to make an assumption: The four digit display is controlled by setting certain segments from high to low and you can pick which one of the 4 digits you want to multiply.
@johnjackson9767
@johnjackson9767 4 года назад
Fantastic explanation and walkthrough. Subbed.
@brunosuperman
@brunosuperman 5 месяцев назад
My kit is the Super Starter Kit and it came with only 2 transistors. Your scheme is really complex. Is it the only way to connect this display?
@heidik1757
@heidik1757 13 дней назад
What program are you using to build circuit diagrams?
@1996rblue
@1996rblue 5 месяцев назад
It works!!! Thank you so much!!!
@kvamsidharvamsi5800
@kvamsidharvamsi5800 5 лет назад
Bro can you upload a video on how to use 2 or more single digit 7 segment display with 74hc595 shift register with Arduino ,i saw your videos all but there is no like that , your videos r great clean understand what we want to do in our projects , thanks for your hard work and we support u always
@rickmorenojr
@rickmorenojr 5 лет назад
Great suggestion. Thanks!
@kvamsidharvamsi5800
@kvamsidharvamsi5800 5 лет назад
@@rickmorenojr come on bro i want to use in my project for next month 10th can you post before that "2 or more single digit 7 segment display with 74HC595 " how to use and connect
@rickmorenojr
@rickmorenojr 5 лет назад
Unfortunately, the Elegoo kit only includes one 7-segment display. I did order a few more and hoping they arrive soon.
@amruthanair9988
@amruthanair9988 5 лет назад
@@rickmorenojr from where do you get to know your circuits. I want to learn it myself a well
@adammiles5087
@adammiles5087 2 года назад
Shame in you Elegoo; you just wasted my whole day. All I wanted to do was display some numbers on the 4-panel LED, so I thought I'd start with the Elegoo demo and take it from there. Then I find it doesn't work and spend hours trying to debug it. Then I come across this video and it tells me how bad and dangerous the sample is! Now after watching this video, I see how complicated it will be so I am giving up and will just use the LCD. This video is great if you want to proceed with it; but I don't now.
@1996rblue
@1996rblue 5 месяцев назад
I kinda did it
@MrMikeD28
@MrMikeD28 4 года назад
Very well done video! I'd really like to convert this to a count down timer with minutes and seconds format MM.SS 99.59 to 00.00
@manuelfreitas7165
@manuelfreitas7165 3 года назад
Why we need to use transistores? It's possible to do it without them? I'm using a esp32-cam and i need to wire my 4 digit 7 segment display with the 74hc595
@SpheresVA
@SpheresVA 2 года назад
yeah I need mine without the processor
@ElGarziaSiempre
@ElGarziaSiempre Год назад
Beautiful tutorial! But if i want write a casual decimal value on the segment, what is the command for that?
@colepdx187
@colepdx187 Год назад
I've never seen a 'char' data type that is 16 bits. In Arduino IDE the char is an 8 bit signed integer.
@rikjanssen6440
@rikjanssen6440 5 месяцев назад
How do I connect my decimal point with with shift register? Do you have a code that then writes privileged 1.141?
@adixtrim
@adixtrim 5 лет назад
very good...
@rickmorenojr
@rickmorenojr 5 лет назад
Thanks!
@abdullahanwar3270
@abdullahanwar3270 4 года назад
is it possible to use the sn74hc595 with a common anode ?
@bernardo5758
@bernardo5758 4 года назад
So, the shift register is providing the power for the LEDs right? But in the 74HC595 datasheet, it says it's capable of providing 6mA output drive. But since you used 220 ohm resistors for limiting the current to the LEDs, that gives approx. (5-2)/220 = 14mA of current per LED. Wasn't that current supposed to fry the shift register?
@rickmorenojr
@rickmorenojr 4 года назад
I seem to recall that the Q0-Q7 max output current is 20ma each. I'll have to double check the datasheet. Though like many chips that are switch on and off rapidly, they can tolerate a little higher currents if need be.
@thetaylors8759
@thetaylors8759 3 года назад
Okay I have tried to replicate the lesson from Elegoo (in which the four digits all cycle through) and have quadruple checked connections, and it goes through a very odd cycle starting with 1, 3, 5, 7, etc. Interestingly, if I move the red jumper wire from 5v (coming out of the Uno board) to the Vin pin, it works as shown above. Any idea what could be going on?
@rickmorenojr
@rickmorenojr 3 года назад
Greetings, first I need to confirm that you are using the same Elegoo lesson as shown in the video. Also Vin will supply unregulated power out. To get regulated 5V out, use the 5V pin. If you are using a USB cable, you're getting 5V from your computer. Your adapter may supply up to 9V. You can do a quick Google search for more information.
@GerryChoco
@GerryChoco 2 года назад
What if I have multiple display module? How can I control it ?
@kolhatkarchinmay
@kolhatkarchinmay 4 года назад
You will forget electronics and embedded systems after watching this video for sure!! Char is 16 bit...he'll yeah
@rickmorenojr
@rickmorenojr 4 года назад
Oh darn. To clarify, typically a char is a value from 0 to 255, which is single byte and typically represents a letter or character. A byte can be a value between -128 to 127. An unsigned byte is 0 to 255. While researching this lesson I found that a char in Java is a UTF-16 code unit. It's not necessarily a complete Unicode character, but it's effectively an unsigned 16-bit integer. I'm not sure if this still hold true.
@kolhatkarchinmay
@kolhatkarchinmay 4 года назад
@@rickmorenojr Ohh I dont know about the Java man. But I think as far as u r twiking around embedded systems char is always 8 bit or 1 byte...yes ofcourse you can creat your typedef to creat your own 16 bit char😉. Great video by the way!!
@techsilv5170
@techsilv5170 3 года назад
Hi it's possible to that but with a 5digit 7segment?
@kamleshajamere6784
@kamleshajamere6784 4 года назад
where is the code
@rickmorenojr
@rickmorenojr 4 года назад
The link to the code is available in the show notes.
@2010RSHACKS
@2010RSHACKS 4 года назад
@@rickmorenojr Can you please show how to connect the wires and components on the breadboard. I dont care how it works, I just want to use it...
@muezaffar
@muezaffar 3 года назад
can you show the design of it in quartus 2 please?
@titoharyo6897
@titoharyo6897 2 года назад
Do you have code colaborate with lm35??
@aaamarco6726
@aaamarco6726 3 года назад
buongiorno bel video, volendo fare un orologio con RTC3231, 4 display 7 segmenti, che visualizza: ore: min: sec, e che periodicamente da temp. e giorno, come faccio a leggere i dati dal RTC e a visualizzarli sui display? Grazie
@seo_bitna01
@seo_bitna01 4 месяца назад
how about 3 digit with keypad?
@nxtlego
@nxtlego 3 года назад
The kit only comes with two transistors. What do I do?
@Jason-xl8fm
@Jason-xl8fm 3 года назад
Buy more, they aren't expensive. I saw a pack of 10 listed on adafruit for just under $2. I think he is using the Elegoo Complete Starter Kit which comes with 10 instead of 2.
@24-dinitrophenylhydrazine29
@24-dinitrophenylhydrazine29 2 года назад
thank you sir.
@lacki9900
@lacki9900 5 лет назад
what do I have to write in the sketch to have a point at the 1000th place? At DisplayDigits [3] ??? you even wrote the byte DigitDP, but did not use it ...
@GaryMarkowski
@GaryMarkowski 3 года назад
It is important to know the decimal value of the pin connections. In the original Arduino tutorial, the decimal value for the decimal point is 128. In the program here, the decimal value for the decimal point is 32. Add this value to the output value to turn on the decimal point.
@henriqueers
@henriqueers 4 года назад
Where's the pin for GND?
@ziggymondus8753
@ziggymondus8753 4 года назад
I don't get why you say "char array", instead of "character array" which would surely help learners absorb the concepts, as they would then recognise why 'char' is used in the code.
@rickmorenojr
@rickmorenojr 4 года назад
Well, Arduino's reference calls this data type a "char" www.arduino.cc/reference/en/language/variables/data-types/char/
@PercyPanleo
@PercyPanleo 3 года назад
@@rickmorenojr It's defined as "char" due to it being abbreviated. This is the case for (pretty much) any language that has a "char" data type.
@kosiogboruche4889
@kosiogboruche4889 3 года назад
thx
@عبداللهعبدالرحمن-غ8ذ
Thanks for you
@gohan3243
@gohan3243 3 года назад
"char" should be "khar" since it is a character not a "tsaracter"
@CuberGamesOG
@CuberGamesOG 2 года назад
Imagine if his name was Rick Astley
@RetroGamer-zz5jn
@RetroGamer-zz5jn 3 года назад
after watching this, theirs too much inconsistancy with ur examples and hard to follow witch diagram is correct one. i have 3 diff breadboards and none of them match ur cheap sketch up version on 12.42 time frame. the segement display doesnt leave eno room for wires to run
@SpheresVA
@SpheresVA 2 года назад
He clearly lists the "junk ones" as JUNK. also, that's your problem, not his. the only cheap sketch up is yours, and yours is CLEARLY too small. get a new one and stop whining
@dorasimon7059
@dorasimon7059 4 года назад
I dooooooooooooooooooooooo9
@jeetenderkakkar7570
@jeetenderkakkar7570 3 года назад
Pakistann
@aaamarco6726
@aaamarco6726 3 года назад
Ciao bel lavoro puoi fare un video per quali modifiche devo fare per adattarlo a questo? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-aRmNmZihD8o.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-KZMISO55mGQ.html grazie
@jeetenderkakkar7570
@jeetenderkakkar7570 3 года назад
Pakistann
Далее
Visualizing Data with 7-Segment Displays
34:26
Просмотров 1,3 млн
Lesson 27 - 74HC595 and 7-Segment Display
23:06
Просмотров 37 тыс.
Three NEW MAPS in Update 0.31.0 Nightmare | Standoff 2
01:48
новое испытание
00:40
Просмотров 265 тыс.
Create your own LARGE 7-segment LED display!
41:08
Просмотров 62 тыс.
Designing a 7-segment hex decoder
15:33
Просмотров 3,7 млн
LED Displays with Arduino - 7-Segment & Dot-Matrix
44:43
I Made The Ultimate Cheating Device
9:39
Просмотров 1,3 млн
Have you ever seen soldering THIS close?
9:53
Просмотров 593 тыс.
I Turned a PS4 into a Handheld Console
27:40
Просмотров 303 тыс.
74HC595 & 74HC165 Shift Registers with Arduino
40:38
Просмотров 403 тыс.