CD4026 counter circuit - Page 1
Forum section: electronics / beginners

author: mattybigback
author_rank: Contributor
timestamp: January 11, 2014, 02:30:53 am
content: Hi thereI'm trying to build a little circuit that acts as a push-button counter, like the ones used on airlines to count the passengers. I've designed a circuit that uses three CD4026 Decade counter/7 segment decoder chips and 3 common cathode 7 segment displays.I've got it working in the Yenka simulator, but I have some questions about the design.The simulation doesn't reference the clock inhibit pin, so I'm assuming that I'll need to tie it to ground. Is that correct?Also, I've chained the display enable out of IC3 to the display enable in of IC2, and then the out of IC2 to the input of IC1 (the software has the chips in reverse order). Pins 4 and 5 are left unconnected, and on all chips I've left pin 14 unconnected.I'm planning to drive the 7 segment display directly from the chip, via some 100 ohm resistors (or whatever value the displays I end up getting will need). I've seen some designs use transistors, but I don't think they'd be necessary.Does this seem like the best way to do this?Many thanksMatt

author: TheGreatGooglyMoogly
author_rank: Contributor
timestamp: January 11, 2014, 04:09:03 am
content: Hi!Inhibit is low, no thanks to the TI datasheet which doesn't have a function table. But yes, clock inhibit is low.Reset is also normally low.CMOS outputs almost always can be left unconnected with no adverse effects, so thats ok. (pin 4, 5 and 14)Use high enough voltage to drive the display (like 9V or higher) to make sure the displays are bright enough.You will *need* a debounce circuit on the clock switch, if you don't it will count erratically (say it starts at 0 and you push the button it will go to 43 because the switch bounced 43 times.Don't forget to use 100k resistors to pull the switch input pins to ground when the switch is not pressed. CMOS inputs are capacitive and very high impedance, so stray static can charge them to logic, resulting in your counter counting or resetting seemingly at random.Build it up and have fun."If you can't afford to blow it up, you can't afford to use it"

author: TheGreatGooglyMoogly
author_rank: Contributor
timestamp: January 11, 2014, 04:10:04 am
content: Here's a debounce page. The last circuit is super good and the CD4093 is a cheap and easy chip to get.http://www.zen22142.zen.co.uk/Design/debounce.htm~G

author: tszaboo
author_rank: Super Contributor
timestamp: January 11, 2014, 05:22:31 am
content: Quote from: TheGreatGooglyMoogly on January 11, 2014, 04:09:03 amFixed that for you.But indeed, they could refresh the 4000 series datasheets.

author: mattybigback
author_rank: Contributor
timestamp: January 11, 2014, 05:29:24 am
content: Thanks for the advice on debouncing. I actually have a 4093 in my parts box so it's nice to have a use for it.It's a daft little project, but I've been working solidly on the same thing for months, and I just fancied designing and building something over the weekend. Once the counter is built I can always modify it to do something useful.

author: rdl
author_rank: Super Contributor
timestamp: January 11, 2014, 05:42:09 am
content: If you're using the "B" series 4026, and depending on the supply voltage and the LEDs, you may not need the current limiting resistors. I have the beginnings of a digital clock on a breadboard somewhere that I started a couple of years ago, I seem to remember something like 5 mA per segment at 6 volts just driving the LEDs directly from the 4026 outputs.

author: mattybigback
author_rank: Contributor
timestamp: January 11, 2014, 06:03:35 am
content: I suppose I can always give it a go with the decimal point on one of the displays - if it does go pop then the rest of the display will still be usable and I'll have learned a valuable lesson.

author: DBoulanger
author_rank: Regular Contributor
timestamp: February 03, 2014, 01:39:27 am
content: Quote from: mattybigback on January 11, 2014, 06:03:35 amThat's one way to do it although personnaly I'm a bit more conservative. I'd rather prefer testing with a higher resistor first, take some measurements and figure out if the current is adequate and adjust accordingly.If I read the datasheet correctly, the chip's max clock frequency can range from 2.5MHz to 8MHz, for a Vdd value ranging from 2.5 to 8V, so obviously, the display segments resistors will need to accomodate the Vdd you'll use.BTW, I'm also "playing" with some CD4026B and CD4017 chips these days. I added a little extra to my CD4026 based counters. When the Display Enable is LOW (Segments not lit) and the Clock INHIBIT is LOW too (Counter incremententing on raising edge of the CLK input), I set the CLK INHIBIT of a CD4017 to LOW allowing it to light the DPs (decimal points) in rotation. Obvioulsly, the CD4017 is using a different clock input, a 555 oscillator ranging from 1 to 100Hz in my case.That little extra gives me a visual feedback telling me that the counter still running, even if the segements aren't lit and overall, it adds a little personnal touch !Have fun !

author: fcb
author_rank: Super Contributor
timestamp: February 03, 2014, 11:51:23 am
content: Quote from: rdl on January 11, 2014, 05:42:09 amCan you actually get "4000A" series logic? I'm not sure I've ever seen one, and I've got 4000 series dating back to the 70's (in nice cerdip packages) in my logic bin.

author: oPossum
author_rank: Super Contributor
timestamp: February 03, 2014, 08:43:04 pm
content: The original 4000 series chips didn't have ESD protection. They where very fragile and quickly succeeded by the B series.

author: mattybigback
author_rank: Contributor
timestamp: February 03, 2014, 09:26:13 pm
content: Quick update!As per usual I ended up overcomplicating things and I extended the scope. I'm using an AVR, some shift registers and some 4511 chips. Electrically it all works, and 5v from the 4511 will power the displays with no problems.The advantage of using the AVR is that I can add in all of the debouncing in code, and I've added some audible responses to set and reset using the arduino Tone library. I'm using an ATMega168 at the moment, but I'm going to port the code to an ATTiny2313. Lovely little chips those!