Maker Pro
Maker Pro

Mechanical Counter - Debounce

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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
 

Attachments

  • Mechanical Counter.pdf
    285.5 KB · Views: 115

GPG

Sep 18, 2015
452
Joined
Sep 18, 2015
Messages
452
Whats the timing involved in the contact?
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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.
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
Could i use the schmitt trigger to operate the base of a transistor? Switching the 24VDC through the counter?
 

GPG

Sep 18, 2015
452
Joined
Sep 18, 2015
Messages
452
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.
Are the contacts floating ? A picture would help. A 555 makes a good schmitt trigger and suits long close/open times.
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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:

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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.




rc15.gif

  • 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
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
but i get the impression some of you might not agree with it.
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.
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
a resistor in series with the coil and capacitor to limit the current, but that means reducing the charge time of the capacitor.
A resistor in series will increase the charge time, not reduce it.

But does this satisfy my requirements if I have an aging capacitor?
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.
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
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
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
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:
View attachment 22803
Yup, your switch contacts and the cap will live a long life now.;)

Cheers,
Chris
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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.
 

Attachments

  • Reed Switch.pdf
    48.8 KB · Views: 84
  • Transistor BC327-BC337.pdf
    632.5 KB · Views: 148

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
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.
 

Sadlercomfort

Ash
Feb 9, 2013
424
Joined
Feb 9, 2013
Messages
424
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.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
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
 
Top