Electronic – Debouncer with LED inside

debounceled

How It's possible to add a LED to a line that it's debounced (switch) with an RC circuit. If I place 2 LED, one on ground and one on VCC to know button position. Will they remove my charge/discharge rate of Capacitor since they have a low R load?

/* EDIT */

Of course with schematic is easier.

schematic

simulate this circuit – Schematic created using CircuitLab

Switch closed, D2 ON and D1 OFF
Switch open, D2 OFF and D1 ON

With debouncing on Input

This schematics is wrong, how can I correctly set it up?

/* EDIT 2 */

It's a reference for a Micro input.

Best Answer

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. D1 is normally on. When SW1 is pressed D1 turns off and D2 turns on.

Note that the input will fall to 0.7 V minimum. Check that this is OK. I've changed the R values so it will affect your debounce timing. Re-calculate those too.


I've split R1 in two: R1 + R4. This raises the INPUT voltage by \$ \frac {V_{cc}-V_{D1}}{2} \$ to address Dave Tweed's comment.


schematic

simulate this circuit

Figure 2. A better design?

How it works:

  • With SW1 open 'B' is pulled high via R2 and D2. Meanwhile D1 is lit via R1. VA will be whatever Vf of the LED is so D3 will be reverse biased.
  • When S1 is pressed 'B' will be pulled to 0 V. D3 will now be in parallel with D1 but it's 0.7 V forward voltage will steal the current from D1 so it will turn off.