Homemade Timer - Debounce

DIY timing systems
Post Reply
dna1990
Master Pine Head
Master Pine Head
Posts: 360
Joined: Wed Jan 09, 2008 8:16 pm
Location: Houston, TX

Homemade Timer - Debounce

Post by dna1990 »

Considering a homemade timer and looking thru the various plans available, it appears that none do much to debounce either the IR phototransistors or the start gate switch.

I don't know for sure, but are phototransistors pretty fast and clean to switch from on to off? When I hear about occlusion considerations, I would guess not.

I do know that the typical mechanical mini switch I see on most start gates, definitely will chatter a few times before going full on or off.


Or is this debounce done in software at the PIC level?

Or, is it that for a timer app, we simply want the very first inkling of a switch change (seems some false starts would occur, sun spots might set one off).



I have done some software debounce before, but it usually on the order of several milliseconds. I don't want to introduce such a delay in a PWD app where I would want sub-millisecond resolution.
User avatar
Stan Pope
Pine Head Legend
Pine Head Legend
Posts: 6856
Joined: Sat Jul 05, 2003 7:01 pm
Location: Morton, Illinois
Contact:

Re: Homemade Timer - Debounce

Post by Stan Pope »

One of the good disigner/manufacturer of finish lines (was it John?) talked here about finish line sensing ... about requiring three missing pulses before certifying the finish gate occlusion.
Stan
"If it's not for the boys, it's for the birds!"
knavekid
Journeyman
Journeyman
Posts: 32
Joined: Mon Jan 07, 2008 2:17 pm
Location: Orlando, FL

Re: Homemade Timer - Debounce

Post by knavekid »

Since only the first transition of the microswitch is required to start the elapsed time counter, the subsequent contact bounces may be ignored by the software. If the start is indicated by switching from a closed to open position, there may not be any bounce to worry about.

The photodiodes should not exhibit any bounce-like anomalies. The photo sensor implementation can introduce latencies depending on the design. For instance, the devices used for garage door electric eye sensors are fairly immune to stray sunlight because they use a modulated emitter and a frequency detector on the receiver. This design is great for stray light immunity at the cost of latency in the output signal.

With any system, fixed latency may be measured and subtracted out in the final calculation.
Post Reply