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!
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); }
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.
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?
@@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 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)
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 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.
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
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.
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 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
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.
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
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?
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.
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?
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.
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.
@@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!!
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
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.
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 ...
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.
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.
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
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
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