CD4026 decimal counter tutorial

  Рет қаралды 22,659

FriendlyWire

FriendlyWire

Күн бұрын

The CD4026 is an integrated circuit (IC) that works as a counter from 0-9 with an integrated decoder for a 7-segment display. I think it is an ideal beginner circuit for anybody who wants to learn electronics. In this tutorial we will go through the very basics of this IC and learn, step by step, how to connect it to pushbuttons, a 7-segment display, and a battery, to build our own counter!
Check out the companion article on my website for more details and an up-to-date list of all components: www.friendlywire.com/tutorials...
Thanks for tuning in, and let me know in the comments if you have any questions!
Website: www.friendlywire.com
Twitter: / friendlywire
Reddit: / friendlywire
Facebook: / friendlywire
Instagram: / friendlywire
Timestamps:
0:00 Introduction
0:21 What you need
1:14 Schematic
3:17 Building the circuit

Пікірлер: 77
@MindFlareRetro
@MindFlareRetro 4 жыл бұрын
That's a fun little project. Great presentation again, by the way.
@FriendlyWire
@FriendlyWire 4 жыл бұрын
Thank you so much, I am glad you like it!
@thetooginator153
@thetooginator153 Жыл бұрын
I don’t think anyone could have explained that circuit better! I understood the whole process - thanks to your explanation and graphics. Well done!
@FriendlyWire
@FriendlyWire 11 ай бұрын
Hey, thank you so much, it means a lot. I hope I could inspire you to give it a try and lean some more electronics. Have a great day!
@thetooginator153
@thetooginator153 11 ай бұрын
@@FriendlyWire - I finished my first attempt about a week ago, and I obviously did something wrong. I would have been amazed if I got that whole circuit right the first time. I might start from scratch and try to be more careful on my next attempt. Wish me luck!
@FriendlyWire
@FriendlyWire 11 ай бұрын
@@thetooginator153 Of course, it always takes more time to do these things in person. I am happy to help, just send me an email or get in touch on social media. We will figure this out! :-)
@razpootis5802
@razpootis5802 2 жыл бұрын
The hand drawn bits are adorable.
@FriendlyWire
@FriendlyWire 2 жыл бұрын
Ha, glad you like it!
@michealmyers4515
@michealmyers4515 3 жыл бұрын
That was informative Thanks man
@FriendlyWire
@FriendlyWire 3 жыл бұрын
Thank you so much, glad you like it!
@anokhautomation4453
@anokhautomation4453 2 жыл бұрын
Nice tutorial.
@FriendlyWire
@FriendlyWire 2 жыл бұрын
Thank you so much, glad you like it! :)
@dazamad
@dazamad 3 жыл бұрын
Great tutorial. What if i wanted a second switch that decrease the counter. Would i need a different ic chip. Many thanks
@FriendlyWire
@FriendlyWire 3 жыл бұрын
Hello Darren, I am glad you like the video, and thanks for the question. Yes, the CD4026 can only count in one direction (up). The CD4510 counter, for example, can count up and down, but outputs BCD signal. You would need a CD4511 to convert it into 7-segment. So: instead of the CD4026 you could use a CD4510+CD4511 and then count up and down :) Let me know if it helps!
@user-pk5xv5nr2c
@user-pk5xv5nr2c Жыл бұрын
Hi ! Nice tutorial. But, how to make the memory backup after power off ? To display the same number when turned on again ?
@FriendlyWire
@FriendlyWire Жыл бұрын
Hello Marzena, this is a good question. Unfortunately the CD4026 does not have a built-in memory. What you could do is this: simply disable the display by putting pin 3 to ground, then the current consumption should be much lower. Then, if you drive everything via a rechargeable USB bank, for example, it could easily last in standby mode for a few days. How long does it need to keep the memory?
@adamansley2240
@adamansley2240 11 ай бұрын
Hi! I thought it was a common practice to connect a 220-ohm resistor in series with each output of the 4026 IC to its respective LED in the 7-segment display. Why not use that instead?
@FriendlyWire
@FriendlyWire 11 ай бұрын
It's much better to do that, you are right. I took a shortcut here, which was not the best idea.
@flipper556
@flipper556 5 ай бұрын
Greeat video, but can I ask, "Is there a way to subtract a count from the total?
@FriendlyWire
@FriendlyWire 5 ай бұрын
Unfortunately, the CD4026 does not count backwards... But you could count forward and basically subtract it this way, since it always rests back to 0 after passing 9. If you want to subtract a number, call it N, it's the same as adding 10-N. Example: the counter is showing 8, and you want to subtract 4. So, in this example, N=4. This means you have to add 10-N, which is 10-4 = 6. If you increment the timer 6 times, it will show 4 after that, which is what you wanted :) If you want to subtract 1, then you just have to increase the timer 9 times. If you do it really quickly, then it will look like it reset by 1 (the intermediate counts will be almost invisible). Hope that helps!
@Grave81
@Grave81 Жыл бұрын
Hey quick question, is the 7 segment display is a common cathode or a common anode? Please answer!
@FriendlyWire
@FriendlyWire Жыл бұрын
Hey there, it's a common cathode one. If you build this, make sure you add one 470 ohm resistor on each output of the CD4026 (see schematic at 1:23). In the video I just used one 470 ohm resistor at the cathode, but that is not good practice. Hope it helps! If you build this I would love to see a picture, feel free to share on socials @FriendlyWire :)
@arduino5267
@arduino5267 6 ай бұрын
Jens ich hab dich abonniert, wegen deiner coolen Brille
@FriendlyWire
@FriendlyWire 6 ай бұрын
:D
@taurruth
@taurruth Жыл бұрын
Hi. Great video. Just one quick question. If I chain six of those to make 6 digits counter is the ceramic capacitor required once per build or once for every IC? Do other IC's also need the capacitor? If yes how do I know what kind and value should I use?
@FriendlyWire
@FriendlyWire Жыл бұрын
Thanks so much! A 100nF ceramic should be close to any CD4026, it's just good practice that removes the possibility of unwanted glitches :)
@taurruth
@taurruth Жыл бұрын
@@FriendlyWire Do other ICs also require 100nF or other values? If other how do i know what value I should use?
@FriendlyWire
@FriendlyWire Жыл бұрын
@@taurruth These are sometimes called bypass capacitors. Their value is not so critical, but around 100nF is typical. All logic chips have one of these, to make the circuit more resilient against noise. Under ideal conditions these capacitors are not necessary, but it is good practice to include them, especially if you are using a noisy power supply.
@taurruth
@taurruth Жыл бұрын
@@FriendlyWire Thank you. I will use them from now on everywhere until I'm wise enough to know where they are not needed :)
@FriendlyWire
@FriendlyWire Жыл бұрын
@@taurruth It's good practice, and I have actually had a case, very early on, where I used a dirty power supply and my digital clock just would not work for the life of me. These capacitors saved me, and so I think it's only fair to recommend them to others, too. :)
@jumbo999614
@jumbo999614 Жыл бұрын
Any tutorial for CD4026 to display number between 0-12? I want to make 12-hour digital clock without microcontroller.
@FriendlyWire
@FriendlyWire Жыл бұрын
You will need two CD4026's for that, connect the carry out in of the first one to the clock pin of the next one. :)
@angs7265
@angs7265 Жыл бұрын
Hi I have dont this project it works perfectly, but i have a question, instead of push button do i connect Rotary encoder ( Mouse Scroll wheel ) ?? if it is yes, will you please tell the pin out connections, where do connect the mouse scroll wheel button in the 4026 ic ? Thanks
@FriendlyWire
@FriendlyWire Жыл бұрын
Thanks for the question! A mouse scroll wheel does not generate an on/off output like a pushbutton, there is more circuitry involved to decode the signal of a rotary encoder. So I am not aware of any simple solution for this, unfortunately. Would you be willing to use a microcontroller, or does it have to be the CD4026? I may do a video on how to use rotary encoders with a PIC microcontroller soon.
@angs7265
@angs7265 Жыл бұрын
@@FriendlyWire Thanks for your quick reply, my idea is instead of push button , i would like to use some Rotary encoder like volume control to increase or decrease the count with CD4026,
@FriendlyWire
@FriendlyWire Жыл бұрын
@@angs7265 I see! Unfortunately I cannot think of any simple solution. It depends a lot on your rotary encoder. But there is another way: you can use a BCD dip switch ( see the one at friendlywire.com/tutorials/buttons-switches-101/#ch6 , or one on Ebay right now, Jan 17, 2023: www.ebay.com/itm/175465827952 ) that has four outputs. Then you can use the CD4511 BCD-to-decimal converter to turn that signal into 7-segment value.
@antonioagostinelli9430
@antonioagostinelli9430 3 жыл бұрын
Hi! I have one question! Shouldn't you put one limiting resistor from each output of 4026 to the anodes of the display, instead of one single resistor from the common cathode to ground? In case multiple LEDs are lit the sums of the currents make a greater IR drop across the single resistor.
@FriendlyWire
@FriendlyWire 3 жыл бұрын
Hi Antonio, yes, you are completely right! In practice I find that for these small displays there is not much variation in brightness between a 1 and an 8, though. I did the same for my CD4094 project and it works rather well there, too. In general, and for larger displays, this does not work. Thanks for pointing it out! :)
@antonioagostinelli9430
@antonioagostinelli9430 3 жыл бұрын
I was reading the 4026 datasheet and it suggests that LED switching be made via npn transistor and current limiting resistor. How come your circuit (4026 or LEDs) did not overheat?
@antonioagostinelli9430
@antonioagostinelli9430 3 жыл бұрын
no wait...disregard this last comment of mine. I was thinking of other 4026 implementations I saw...where no current limiting resistor is used at all.
@FriendlyWire
@FriendlyWire 3 жыл бұрын
​@@antonioagostinelli9430 It's easy to check: with only one resistor you cannot make it worse, because all LED segments that are ON draw current through it. But the current through the resistor is fixed. If it is, say, 15mA, then two segments get 7.5mA each, 3 segments would get 5mA each, and 7 segments would get slightly more than 2mA each. Hope it makes sense :)
@michealmyers4515
@michealmyers4515 3 жыл бұрын
Hey so like if we are making a digital clock ,should we connect 7 similiar resistors or 1 resistor at the end? Using 1 single resistor in the end causes sum of all the 7 currents to go through it and thus increases I^2R losses and increases heating is that what you meant bro?
@MAFIAGAMING-pn6se
@MAFIAGAMING-pn6se Ай бұрын
Hi, I understood this and implemented this it works and helps a lot but the problem is I have to run this on simulator on Proteus for my project and Tried alot but Stuck on led display there a-k alphabets in led but in Proteus there is a-g so how to take other inputs can you make a video on it
@FriendlyWire
@FriendlyWire Ай бұрын
Thank you for the question, I am glad that the video was helpful. I am not sure if I understood everything :) Can you explain what the problems seems to be?
@MAFIAGAMING-pn6se
@MAFIAGAMING-pn6se Ай бұрын
@@FriendlyWire thanks for your response There was a wire missing which was not connected,now it's working
@FriendlyWire
@FriendlyWire Ай бұрын
@@MAFIAGAMING-pn6se Perfect, I am glad it's working now! Which wire was it?
@MAFIAGAMING-pn6se
@MAFIAGAMING-pn6se Ай бұрын
@@FriendlyWire led common pin is connected to R3(Resistor) and then resistor is connected to ground,but I have to connect led common pin to ground separately after that it starts working 🙂
@janedrinesteban5687
@janedrinesteban5687 3 жыл бұрын
Hi I have a project like this, and I am following your tutorial. I already completed the circuit in my simulation, but I need to reset the sevseg after it reaches the digit 8. This will be use as a scoring device. We are not allowed to use any programmable ICs. Can you help me of some sort?
@FriendlyWire
@FriendlyWire 3 жыл бұрын
Hello, thanks for your interest! Glad you find the video useful :-) Yes, this can be done. Just to clarify, when should it reset? At 8 or at 9? Basically you need to check if each segment is in the right state (on or off), and you can do it with logic gates. The resulting output can be sent to the reset pin. Let me know if that makes sense, and if not I can draw a schematic :)
@janedrinesteban5687
@janedrinesteban5687 3 жыл бұрын
@@FriendlyWire after 8, when i press the button, it should be 0, instead of proceeding to 9. Adding logic gates might complicate the overall circuit, wouldn't it?
@FriendlyWire
@FriendlyWire 3 жыл бұрын
@@janedrinesteban5687 Yes, of course it makes it complicated :( But that is the price you pay for using the all-in-one counter+decoder like the CD4026. You could always use a CD4510 and CD4511 combination, where the CD4510 is a BCD counter that is easier to reset, and the CD4511 is the BCG-to-7-segment decoder. For the CD4026 you need to get creative. I will think about it, maybe there is a simpler way, but the brute force approach is this one: connect segments a,b,c,d,f,g to the inputs of a 6-channel AND gate. Connect segment e to an inverter. Then connect the outputs of the AND gate and the output of the inverter to a 2-channel AND gate. The output of that AND gate will fire when the display shows 9.
@FriendlyWire
@FriendlyWire 3 жыл бұрын
@@janedrinesteban5687 Let me know if that helps or if you need more input :)
@AnimaladasGraciosas
@AnimaladasGraciosas Жыл бұрын
Hello, one question if I want to use an inductive proximity sensor, how can I switch it so that it can count me?
@FriendlyWire
@FriendlyWire Жыл бұрын
Hello :) In principle, you can use sensor outputs to count with the CD4026, they just have to be the right voltage levels. Do you have a datasheet/name/link of the proximity sensor you want to use?
@AnimaladasGraciosas
@AnimaladasGraciosas Жыл бұрын
@@FriendlyWire thanks for answering, the sensor is inductive NPN powered by 12v DVC three-wire brown, black and blue
@FriendlyWire
@FriendlyWire Жыл бұрын
@@AnimaladasGraciosas Great, that looks like something we could work with. Do you have a datasheet? Feel free to reach out via email as well, you can find it on the bottom of the website www.friendlywire.com :) Without datasheet it will be hard to guess how to do it.
@rhmjaal7178
@rhmjaal7178 2 жыл бұрын
Where is your explained full vedio, how to work this Circuit properly.
@FriendlyWire
@FriendlyWire 2 жыл бұрын
I'm not sure what you mean?
@Tolderian
@Tolderian Жыл бұрын
How would I set it to a certain number when it resets?
@FriendlyWire
@FriendlyWire Жыл бұрын
Good question, but not possible with this chip, it will always reset back to 0. If you want a more custom experience, I recommend the CD4510 BCD presettable up/down counter, and then the CD4511 BCD-to-7-segment decoder to connect it to a 7-segment display.
@saboorurrahman4832
@saboorurrahman4832 2 жыл бұрын
Awesome video, but I need 2-digit counter for my project. Can you please help me with that?
@FriendlyWire
@FriendlyWire 2 жыл бұрын
Hey Saboor, thanks for the question! Yes, you can do that. Add a second CD4026 to the circuit. Connect it to VDD, ground, and the 7seg display the same way. Then, connect the "CO" pin (carry out, pin 5) of the first CD4026 to the "CLK" pin (clock, pin 1) of the second CD4026 counter.
@saboorurrahman4832
@saboorurrahman4832 2 жыл бұрын
@@FriendlyWire And what about Pushbuttons (Reset & Start)? Do I have to connect pushbuttons with second CD4026 also? If yes, then how? Please help.
@saboorurrahman4832
@saboorurrahman4832 2 жыл бұрын
@@FriendlyWire One more question, Do I have to connect all these resistors and capacitors to the second CD4026 also or are these enough?
@vishamv6346
@vishamv6346 4 ай бұрын
What If I have common anode display available
@FriendlyWire
@FriendlyWire 4 ай бұрын
Unfortunately it won't work with the CD4026 :/ You could invert each signal and then use the common anode display, but you would need another chip for that. It would probably be easier to get a common cathode display in that case.
@vishamv6346
@vishamv6346 4 ай бұрын
@@FriendlyWire thanks for your reply . I had a deadline so used ic7404 (NOT gate) and inverted each output...works fine now
@FriendlyWire
@FriendlyWire 4 ай бұрын
@@vishamv6346 Yup, that woks! Perfect! :)
@yusufkonevi6803
@yusufkonevi6803 11 ай бұрын
Hi sir. The tutorial is great and I understand all the cirtuit. But even I had done everything same (yes. even the coordinates of components ) it didnt seem to work. What can be the problem you think? (I checked all components no problem about them) Also. If you answer this, Thank you man youre great
@FriendlyWire
@FriendlyWire 11 ай бұрын
Hello Yusuf, thank you for your interest and your question! I have been there, too, these things can be a bit tricky sometimes. Can you send me a photo of your built? You can either contact me on social media @FriendlyWire or send me an email (my address is at the bottom of www.friendlywire.com). I am sure we can figure this out together! :)
@yusufkonevi6803
@yusufkonevi6803 11 ай бұрын
Problem Solved, Thank you
@FriendlyWire
@FriendlyWire 11 ай бұрын
@@yusufkonevi6803 That's great, congratulations! Let us know what it was, maybe somebody else has the same problem and they may find your solution helpful :)
@yusufkonevi6803
@yusufkonevi6803 11 ай бұрын
@@FriendlyWire The problem was that the display I installed later was a common anode, not a common cathode, since it was larger. I also have a question: how can I make this counter 2 digits?
@FriendlyWire
@FriendlyWire 11 ай бұрын
​@@yusufkonevi6803Oh, I see! Yes, this circuit is for a common cathode display. (But these displays always have the same size, you can only tell if it is common anode or cathode from the type number and/or from experimenting with the module.) You can make it 2 digits like this: connect Carry Out (pin 5) to the CLK pin of the next CD4026. On this next CD4026, connect a 7seg display just as before, and put RESET (pin 15) to ground, Clock Inhibit (pin 2) to ground, and Display Enable (pin 3) to VDD. Let me know if it works! :)
Описание и применение микросхемы CD4026
10:42
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 4,5 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 3,9 МЛН
Final muy increíble 😱
00:46
Juan De Dios Pantoja 2
Рет қаралды 48 МЛН
WOW!!! Amazing 3 Digit Counter Circuit || By ES Tech Knowledge
7:00
ES Tech Knowledge
Рет қаралды 40 М.
NE555 tutorial: three useful circuits
16:09
FriendlyWire
Рет қаралды 82 М.
Designing a 7-segment hex decoder
15:33
Ben Eater
Рет қаралды 3,7 МЛН
CD4017 tutorial: the IC you can count on!
17:49
FriendlyWire
Рет қаралды 31 М.
Best breadboard 7-segment LED driver: TLC5916 tutorial
22:27
FriendlyWire
Рет қаралды 19 М.
Digital Clock Using 4026 IC | Electroniks Day
7:56
Hassam Bin Hassan
Рет қаралды 35 М.