I am trying to build a counting system that will display a running total of the sum of the times a switch was pressed. I am using a 7 segment Common Cathode display. If I have the display and chip hooked up correctly, before any pulses are input, what should the display show? Is it supposed to be blank, have all the segments illuminated, or something else? I am using 3.3 Vdc as an input source.
Without a schematic it is pretty much impossible to tell. Are you aware there is a display blanking pin on the CD4026?
If I took a picture of the bread board and posted it, would that work? I wasn't aware of the display blanking pin. I will look at the spec sheet again and see if I can determine which pin it is. Thanks!
If it is a good picture. Also, 3.3V is very low for the IC, but within spec. How bright your led segmetns will be is a question. What value are your current limiting resistors to the leds?
But where did you get the instructions to build it? Can we refer to them here?
When I first started building the circuit, I used 12 Vdc, but I am pretty sure I over heated the chip because it smelled bad and was hot to the touch. I tried 5 Vdc, but the chip was already damaged. So, for my second chip, I am using 3.3 Vdc, but when I took pictures of the circuit, I smelled the chip starting to burn and it was geting hot. I could have something hooked up backwards, but haven't figured it out yet.
I keep trying to attach pictures to this message, but explorer crashes when I do. I will work on another way to post them. I am trying to build a triple digit pulse counter, but started with a single digit to learn. Here is the website that I am using to model my configuration.
My 7 seg display is oriented horizontally instead of vertically. I didn't buy a large enough part to have the pins oriented like the one on the website. In place of the NE 555 timer, capacitor, and resistor to feed pulses, I put in my SPST switch. I am not using any resistors between the chip and the 7 seg display.
Here is a link to pictures of the circuit...https://sites.google.com/site/7segdigitalcounter/
The number 1 pin for the chip has a green lead from the switch going into it. The number 1 pin for the 7 seg display is diagonally opposite of the decimal LED. There is a red lead connecting the number 7 pin on the chip to the number 1 pin on the display. The part number for the display is LTS-4301JR, common cathode.
Thanks for you interest and help.
It is a very bad idea to drive the display segments directly from the CD4026.
With a 3.3V supply, you probably won't get enough current to light the segments,
and you always run the risk of drawing too much current and frying the CD4026.
It is better to use a buffer for each line as shown on the attached diagram, and
current limiting resistors. With a 5V supply, R should be about 270 Ohms. This
will also work on a 3.3V supply with R=82 Ohms. The value of R is chosen to
not exceed the total current limit of the buffer chip of 100 mA.
When you power up the circuit the CD4026 can come up in any state, so
you can't predict the number you will see. If you include a power-on-reset RC
(POR) on pin 15, the initial value will be 0. An additional switch as shown will
allow you to reset to 0 at any time. It is always a good idea to bypass the
power supply at each chip with a 0.1 uF ceramic capacitor to keep noise off the
power supply line.
The problem you get with a SPST switch for counting is that switch contacts
bounce, so you will get several counts each time instead of one. If you
must use a SPST switch, you can fix this using a 555 pulse generatot as shown
to make the count pulse longer than the bounce time. A better solution is to use
a cross-coupled gate (shown as an alternative) and a SPDT switch.
Damed board just lost a big post for you!
Take out the chip. Adjust the power supply to 5V +/- a quarter volt.
Test each segment with a resistor conected to V+. Do not use only wire, use a 220 - 1K resistor to V+! If you are more comfortable, take the resistor from V+ to an unused node, and a wire from there to the display pins one at a time. All should light as expected from the datasheet. If not, a segment or more could be shorted causing the problem. Disconnect that segment, the rest should work fine. If none light, check for a good ground to pin 3 (or 8) of the display.
If they all work, power off, put the ic back in. power up and check that the ic is not heating, if it is, replace it. If it isn't, you should have led segments lit.
I put a led and resistor on all my proto boards in an isolated corner, trimmed nicely close to the board to verify power on or off.
Do not make connections with the power on.
Observe static precautions with this chip, and any 4000 series ic's.
Be sure pin 8 of the display is not connected, or only connect ot ground, not the ic. (hard to be sure in the pictures)
The switch won't work as connected. Add a 10k pulldown from pin 1 to ground. Improve debounce with a .1 -1uf across the switch, (ic pin 1 to V+) to remove some of the switch bounces. You will still get bounces, but less of them.
(mikeweed's circuits are better for this) Bounces will show as multiple counts for a single push of the switch.
Are you SURE the switch is a normally open switch? (open when not pressed, closed when pressed) Verify with an ohm meter, led and resistor, or continuity tester.
The V+ and ground connection to the ic look fine in the pictures. You can verify the rest after you get some segments to light!
Hope this helps,
One quick correction-
If you use the CD4001 debounce circuit, I got pins 4 and 6 switched in the
diagram. The gate outputs are pins 3 and 4. The two gates in the other
half of the CD4001 are not used.
Thanks Mike and Fab,
I have been learning about debouncing circuits, but hadn't gotten to that point. You both have been very helpful. It looks like I need to start over and try this (the chip to 7 seg display) again. I really do appreciate your help.
I am unfamiliar with buffers, so I will have to read up on them. Do you recommend the exact part number from the diagram? Also, did you make up the design just to help me with this problem? If so, thanks! How did you determine the resistance values for the current limit and input voltage? Another question is about the CD 4001. Do I need two of them, or in the diagram is that how one unit is represented?
Thanks in advance,
There are 4 independent NOR gates in one CD4001 chip, and since you need only
2 gates, you need only one CD4001 chip. Remember to power the CD4001 by
connecting pin 7 to ground and the + power to pin 14.
I chose the 74AC541 buffer because Digikey has it in stock, it will run on
either 3.3V or 5V, and the outputs can drive enough current for the
display segments. (I was wrong about the total chip current limit being
100ma - a footnote in the data sheet indicates that you can get 25 ma per
output, provided the supply voltage is high enough). Digikey says they will
not stock this chip in the future, but a chip with the same properties is the
74AC241, but different pinout. The '241 needs a pullup resistor (10k will work)
from pin 19 to + power, and another pulldown resistor from pin 1 to ground.
The inputs and outputs are also different - see the data sheet (the inputs
are driven by the CD4026 and the outputs go to the current-limiting resistors
that drive the segments). Both the '241 and '541 are spec'd to supply up to
12 ma per output with a 3V supply, and up to 24 ma with a 4.5V supply.
I assumed you could get 14 ma with a 3.3V supply, and I assumed that the
minimum forward voltage drop across one segment is 1.2V with 14 ma, but
you shpuld check the display data sheet to be sure. With these values,
the voltage across the resistor is 3.3-1.2=2.1V, and Ohm's law gives
R=2.1V/.014 A=150 ohms (so my 82 ohm figure was wrong). The 14 ma
shpuld provide adequate brightness for the segments, but check the data
sheet for the maximum allowable segment current. If it is 20 ma, for
example. you can provide this if the buffer is powered by 5V. The resistor
in that case would be (5.0-1.2)/.02=190 ohms (use the next higher standard
5% value of 200 ohms).