Simple pulse generator from switch state change

Thread Starter

Francesco Boscarino

Joined Jul 4, 2018
6
Hi,
I'm trying to figure out how to design a simple circuit (RC + BJT) which could output a low pulse (10ms) whenever a switch is opened and closed.

Any idea?
 

AlbertHall

Joined Jun 4, 2014
12,347
You want this pulse to happen when the switch is closed and then another pulse when the switch is opened?
One problem to be solved is that some switches 'bounce' for longer than 10ms so when the switch closes you might get multiple output pulses triggered.
 

AlbertHall

Joined Jun 4, 2014
12,347
In this circuit V1, R1, Q3 and R7 are just for the simulation. Your reed switch would connect where Q3 collector and emitter are. The collector of Q4 would connect to the controller reset pin.
It would be a good idea if someone better at LTspice checked this out. I haven't tried using 1MΩ resistors in this type of circuit before. Given that this circuit is to wake up the controller from deep sleep clearly current consumption needs to be minimised.
upload_2018-7-4_17-4-44.png
upload_2018-7-4_17-3-56.png
 

Attachments

Alec_t

Joined Sep 17, 2013
14,330
Assuming the reed switch closes when the gate is in the closed position, here's an alternative which draws only 5uA with the gate closed and virtually zero current with the gate open :
DualPulser.PNG
Only two of the four gates in the IC are used.
C2 suppresses switch-bounce. R2 limits the C2 discharge current. R3,C1 set the output pulse width.
This circuit should work on a 5V supply or a 3.3V supply; whatever suits your MCU.
 
Top