Skip navigation
TechXchange
Digi-Key TechXchange Communities > General > Discussions
12756 Views 14 Replies Latest reply: Jun 27, 2012 8:50 AM by MarkR RSS
Currently Being Moderated

Jun 24, 2012 11:21 AM

Building a 7 seg display with STSP switch and CD4026B IC

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.

Thanks!

  • fabelizer Novice 3 posts since
    Jun 24, 2012
    Currently Being Moderated
    Jun 24, 2012 2:00 PM (in response to MarkR)
    Building a 7 seg display with STSP switch and CD4026B IC

    Mark,

    Without a schematic it is pretty much impossible to tell. Are you aware there is a display blanking pin on the CD4026?

    -fab

      • fabelizer Novice 3 posts since
        Jun 24, 2012
        Currently Being Moderated
        Jun 24, 2012 9:04 PM (in response to MarkR)
        Building a 7 seg display with STSP switch and CD4026B IC

        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?

        -fab

          • MikeWeed Novice 51 posts since
            Oct 21, 2011
            Currently Being Moderated
            Jun 25, 2012 2:54 PM (in response to MarkR)
            7 seg display using CD4026

            Mark,

            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.

            Good luck!

            Attachments:
          • fabelizer Novice 3 posts since
            Jun 24, 2012
            Currently Being Moderated
            Jun 25, 2012 10:36 PM (in response to MarkR)
            7 seg display using CD4026

            Damed board just lost a big post for you!

             

            Short version:

            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,

            -fab

  • MikeWeed Novice 51 posts since
    Oct 21, 2011
    Currently Being Moderated
    Jun 26, 2012 8:14 AM (in response to MarkR)
    7 seg display using CD4026

    Mark,

    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.

      • MikeWeed Novice 51 posts since
        Oct 21, 2011
        Currently Being Moderated
        Jun 27, 2012 8:36 AM (in response to MarkR)
        7 seg display using CD4026

        Mark,

        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).

More Like This

  • Retrieving data ...

Bookmarked By (0)