I have a line pulled to +5V. When a button is pressed, it should ground the line after a 100ms delay. How would I implement such a delay?
Answer
simulate this circuit – Schematic created using CircuitLab
OA1 is an open drain comparator who's output is your line that's pulled up to 5V. The value of R1 will determine the length of the delay with larger values resulting in larger delays. The delay can be calculated as t = -ln(.5)*R1*C1.
If there are debounching issues, use a comparator with hysteresis (schmitt trigger).
Another, maybe better, way to change the timing is to change the voltage on the non-inverting input. This could be done with a DAC for digital control of the timing.
No comments:
Post a Comment