Connect with us

Mechanical Counter - Debounce

Discussion in 'General Electronics Discussion' started by Sadlercomfort, Oct 15, 2015.

Scroll to continue with content
  1. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Hello,

    I am currently using a mechanical counter which counts every time the circuit is made (See attached Type AW 15.01). The circuit is made as a mechanical arm slides a butterfly metal contact on a matching metal strip.

    One end of the counter is essentially connected to GND and the other to the metal strip. The butterfly contact is +24VDC and completes the circuit to GND through the counter. I have connected a diode to protect the counter because its a coil. In an attempt to debounce the circuit i have put a 1uF capacitor across the counter.

    Is there anyway to debounce this circuit using discrete components?

    Thanks,
    Ash
     

    Attached Files:

  2. GPG

    GPG

    452
    66
    Sep 18, 2015
    Whats the timing involved in the contact?
     
  3. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    The metal strip is approximately 40mm and the butterfly contact is approximately 20mm. It just under a second, from the initial contact to its rest point. During this time the contact is bouncing.
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    11,442
    2,628
    Nov 17, 2011
  5. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Could i use the schmitt trigger to operate the base of a transistor? Switching the 24VDC through the counter?
     
  6. GPG

    GPG

    452
    66
    Sep 18, 2015
    Are the contacts floating ? A picture would help. A 555 makes a good schmitt trigger and suits long close/open times.
     
  7. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    The butterfly contact is floating 24VDC.

    I can't release a picture I'm afraid because it's work related and have to get permission to release details of our contacts.
     
    Last edited: Oct 15, 2015
  8. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Hi Guys,

    Here's an update to how I solved the problem. The solution is very simple, but i get the impression some of you might not agree with it. o_O
    Debounce Circuit.png

    The circuit uses a 470uF capacitor and a diode in parallel with the coil. As the contact is made the capacitor charges quickly, once the capacitor reaches 8v any bounce in the contact would not affect the counter. I tested the counter and found that it requires a minimum of 8v to count on/off. The diode protects the coil when the contact is broken.

    I used an online RC charge time calculator to work out that it takes the capacitor 190.6us to reach 8v (Assuming a 1 Ohm resistance). Therefore 190.6us is the bounce time, any bounce faster than this and my counter will register incorrect counts.

    A 190.6us debounce is perfect for my application. Because there is a lot of weight behind the butterfly contact as it meets the metal strip the bounce should be much larger. Plus, I only seem to have this problem when the entire setup isn't secured down properly because of untighted bolts or no bolts.

    Since I regularly use PIC microcontrollers, I could test this using a relay. Which I hope to do whenever I have more time.




    [​IMG]
    • Where:
    • Vc is the voltage across the capacitor
    • Vs is the supply voltage
    • t is the elapsed time since the application of the supply voltage
    • RC is the time constant of the RC charging circuit
     
  9. Harald Kapp

    Harald Kapp Moderator Moderator

    11,442
    2,628
    Nov 17, 2011
    It is not elegant and you'll have to take into account the tolerances and aging of the electrolytic capacitor. Also the high inrush curent to the capacitor may put lots of distortion on your power supply which may (but doesn't have to necessarily) affect other parts of the circuit.

    But if it works in your aplication satisfactorily, why not? Any circuit is as god as any other as long as requirements are fulfilled.
     
  10. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    I see.. But does this satisfy my requirements if I have an aging capacitor?

    Now this counter may count up to 50,000 cycles, if it doesn't last that long there's no point in using this circuit.

    I suppose I could put a resistor in series with the coil and capacitor to limit the current, but that means reducing the charge time of the capacitor. Clearly its about balancing the value of that resistor to get a smaller inrush of current, but with a prompt charge time.

    My power supply is sophisticated and can handle the surge of current, but I still need the capacitor to live a long life.
     
  11. Harald Kapp

    Harald Kapp Moderator Moderator

    11,442
    2,628
    Nov 17, 2011
    A resistor in series will increase the charge time, not reduce it.

    Depends on your requirements. How long shall the circuit last? Defnitions of elko-lifetime vary. You can expect anywhere between 5000hrs and 20000hrs, depending on operating conditions. Typically a designer will use an overrated capacitor (higher nominal voltage, higher nominal capacity) where possible to end with still suitable values after a few years. This is probably not an option here as higher capacity means higher inrush current and longer filter time.

    Have you ever tried the counter without any debouncing circuit? A mechanical counter is probably so slow it ignores contact bounce of the sliding contacts completely.
     
  12. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Ah, sorry that's what I meant the charge time will increase. Which Is why it would be a compromise between how fast the circuit can denounce the signal and the inrush of current.

    Now is that lifetime when the capacitor is continually being charged?

    Or the total time of the discharge and charging of the capacitor? If this is the case it would suit my requirements, because the contact is only made and broken inbetween long delays.

    The capacitor is much higher than I need already, typically a 100uF will still denounce the circuit nicely.. But do I go for a higher rated one or lower?

    I definitely need to debounce the counter, I only seem to get the problem when my whole setup isn't secured down properly. . But in the workshop there's no other way to secure it down, so the vibrations are caused most of the bounce for this particular application. But the bounce is really small, like 1 in every 600 counts, but i can't risk getting inaccurate counts.
     
  13. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    651
    May 8, 2012
    IMHO you would be wise to put a low value resistor in series with the cap only. I'm talking about ~4.7Ω. Your switch contacts will thank you for it and though lesser, so will the cap during its charge cycle. ;)

    Cheers,
    Chris
     
    Harald Kapp likes this.
  14. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Thanks Chris,

    Will try it out Monday, I might use a smaller cap aswell.
     
  15. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Hi Guys,

    It all seems to be working nicely now. I've used a 100uF and 2.2Ohm 1W resistor in series with it.

    I noticed before I was testing the circuit and using two wires for the contact, I was getting sparking across the two. Now there isn't any sparks.

    The circuit still seems to debounce the contact nicely aswell. Here's my circuit:
    Debounce Circuit.png
     
  16. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    651
    May 8, 2012
    Yup, your switch contacts and the cap will live a long life now.;)

    Cheers,
    Chris
     
  17. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Hi Guys,

    I've recently designed a circuit with the help of you guys, to create a debounce circuit to operate a counter. In order to switch the counter I need to use a reed switch, so i thought maybe i can use a transistor.

    I need to switch the base of a BC337 transistor using the 5W reed switch. The transistor is operating as a switch so needs to be switched 'Fully On' and 'Fully Off'.

    I'm using a 24V supply so would like to use this for the reed switch, but at very low amps (Ideally 150mA or less).

    Here's the circuit I designed:

    Screenshot_2.png



    The problem is I've simulated the circuit and the transistor doesn't switch 'Fully On', as only 72mA operating the base. But I dont want to put to much amps through the reed switch.

    I've attached the datasheet for the reed switch and transistor.
     

    Attached Files:

  18. Harald Kapp

    Harald Kapp Moderator Moderator

    11,442
    2,628
    Nov 17, 2011
    Put the transistor in the ground leg of the counter or use a PNP transistor. 330Ω is way too low -> to much base current. As a rule of thumb take Rbase=Rload*gain, a bit less to ensure saturation. In this case Rbase ~ 8kΩ, use e.g. 4k7.

    We have a ressource covering more details.
     
  19. Sadlercomfort

    Sadlercomfort Ash

    424
    55
    Feb 9, 2013
    Thanks, I didn't think of using a pnp transistor.

    On the datasheet, how did you find the gain? The hfe Value changes according to the load right.
     
  20. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    For a switching application, where you want saturation, a good rule of thumb is to use 10 for the gain, i.e. supply 1/10 of the collector current as the base current.

    Bob
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-