Saturday, 8 March 2014

pullup - How to create a 100ms delay between button pressed and line grounded?


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



schematic



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

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...