3 Digit Up / Down Counter

Discussion in 'The Projects Forum' started by kelvinmead, Feb 1, 2012.

  1. kelvinmead

    Thread Starter Member

    May 15, 2011
    30
    0
    Hi,

    no circuit diagram at the moment, but i will endeavor to create one...

    i'm using a 3 * CD40110BE to drive 3 7 segment displays, linked using the Carry / Borrow lines, triggered by 2 push button switches. One switch counts up, and the second counts down.

    The clock input is generated from a 555 monostable circuit (of which the button is attached to). There are 2 * 555's one for the up, and one for the down.

    I have the circuit assembled and all seems to tick over fine, except a single tap on the button and the counter will count randomly (in the right direction) but not for one count but anything between 10 and 200 a time. although, if i hold the button down it doesn't count any more or any less.

    Am i going in the wrong way for this, is there a better clock than using a 555?

    How can i make the 555 output one clock cycle? or is it that i have it wired all wrong?

    thanks!
     
  2. BSomer

    Member

    Dec 28, 2011
    433
    106
    By your description, you seem to be having a problem with switch bounce. You are going the right way as for trying to set up the 555 "output one clock cycle". What that is referred to is "One Shot" or "Monostable Multivibrator". Look up the data sheet for the 555 and there will be examples of this circuit set up towards the back. You might want to consider about a 50 -70 ms time delay in the one shot, this should take care of most switch debounce.
     
  3. Paul Kerry

    Member

    Jan 9, 2012
    36
    4
  4. BSomer

    Member

    Dec 28, 2011
    433
    106
  5. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    An SR latch is always a cheap, small and reliable de-bouncer. Ask wikipedia.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    Buttons are notorious for causing switch bounce. We covered this up/down circuit a couple of months ago. I would have to find the thread for you.
     
  7. kelvinmead

    Thread Starter Member

    May 15, 2011
    30
    0
    thanks guys, i did see a thing about debouncing, and wondered if that was the problem, but i was convinced that regardless of the length of time i had set the 555 for, it would be one cycle, so its set for about 250ms now.

    i will reduce the time, and debounce the switch!

    also, im still putting the circuit together on express pcb! its quite easy now ive got going, just slow!!:rolleyes:

    http://i216.photobucket.com/albums/cc175/syndicatebristol/3digitupdowncounter.png

    [​IMG]
     
    Last edited: Feb 1, 2012
  8. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,363
    Kelvin, that's a really nice schematic diagram. What program did you use?
     
  9. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    He mentioned Express PCB. I should really give it another look. It's said to be really fast for simple schematics.
     
  10. kelvinmead

    Thread Starter Member

    May 15, 2011
    30
    0
    as said, expresspcb... 'tis free, but (i would say) hardly any components, but... you draw a box, define the size, add the pins, name them, highlight and "save custom component" POW... component made.

    easy when you have datasheet!

    that was my first ever schematic! (hence the multiple +ves and grounds!:D
     
  11. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    Another way to do debounce is something like this...

    [​IMG]
     
  12. kelvinmead

    Thread Starter Member

    May 15, 2011
    30
    0
    ok, so ive debounced with a 2meg and a 330k (separately, not together!), and a 47nF capacitor... and my test output drops to about 30%. debouncing shouldnt drop the voltage that much? is there a good rule of thumb for working out the capacitance / resistor settings?

    edit, and the click rate is reaaal slow... away from the debounce i can click as quickly as i want (which is about how fast i need it) but with the debounce, click one is 30%, then 15%, then 5% and you can only click once every .075 seconds.

    edit 2, ah, i was drawing too much power from 1 9v battery to test, so i had 2 9v batteries, 1 running the 555's and the other running the 40110's, and it seemed there was interference / ambiguities between the 2 batteries. linked the 2 circuits and increased the input and its starting to work fine.

    i realise that i'm not getting answers as i'm working, but i'm just going to carry on regardless and someone can pick it up later :)

    the debounce is now working to a degree, using the 2meg resistor is just too unresponsive, and the 300k skips a number every so often, moving up to 900k and i still get skipping.

    ah, ha! 0.1uF skips even more, so 20nF is about right!
     
    Last edited: Feb 3, 2012
  13. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
  14. kelvinmead

    Thread Starter Member

    May 15, 2011
    30
    0
    firstly, apologies for the bump

    ok, im 3 months down the line on this build, and after a few rebuilds (5) i am built into the stripboard.

    when i built this thing i was running 2 9v batteries, so 18v

    the large digit displays are 12v, with a max forward of 160mA, wired in parallel, and ranging when the "1" is lit to when the "8" is lit.

    im happy now that the circuit is working fine, but either i have a voltage leak somewhere, the batteries im using to test are running low, but the system is erroring slightly.

    the best dc power supply i had was 500mA, 12v, and for the majority this was adequate (testing the 555's, the 40110's and the individual seven segments), but when completed on the low consumption numbers "111", the display would be static... more hungry numbers would start the segments flashing (this i assume from a lack of voltage, seeing as it was running at 18v on the batteries.

    i tested this with 2 9vs and it didnt light up the segments, added a 3rd 9v, and got it flashing, then added a 4th, so 24v (which is what the multimeter was saying) and everything is awesome! fully lit, no flashing, no excess heat from any chips for a prolonged period, segments staying at a cool temperature.

    so i bought a 24v dc 500mA power supply and plopped that on, and im back to flashing with the added extra of random number adjustments.

    what is this ramble for then?

    is there a more scientific way of seeing the required voltage / ampage needed to run the system?

    do i just purchase a 24v 1A power supply and plug it in?

    this should be a clickable link to the rather large schematic
    https://www.dropbox.com/sh/zmkh41ks3r8k761/CeOzQVPfWT/room2updowncounter10.bmp
     
Loading...