How to generate a short pulse(5~50ms) when a switch is on

Thread Starter

garudaone

Joined Nov 22, 2022
16
Hi guy. This is your circuit simulation result.
Since the pulse time is very short, and the amplitude is not very high. I think you should an additional circuit behind to rectify the wave, something like a GATE logic nor complicated like a voltage comparator with a low threshold settings.

View attachment 281398
Thanks for your additional comment on this. I really appreciate it. However, so far the one from sghioto is working flawlessly with my RF433 module(from 5 volt to 12 volt). Sorry, I have no background on this electronics thing.
 

sghioto

Joined Dec 31, 2017
3,708
There's a problem with the quiescent current of 2.6ma when the switch is connected. As I want to run this on 9v battery, so 2.6ma is quite big. Do you have any suggestion to remove this?
You can increase R1 and R3 to 1meg and R2 to 100K or even larger possibly, that will reduce the current to appx 110 ua. Use a 9 volt lithium battery?
 
Last edited:

Thread Starter

garudaone

Joined Nov 22, 2022
16
This version will reduce the standby current to appx 5ua and was good to below 5 volts.
View attachment 281630
Thanks, it now consumes less than 20ua including the rf433 modules.
I have a question: as far as I know, the capacitor self discharge over time, so if the circuit connected for several days or weeks, when it's disconnected, can the capacitor still output its pulse?
 

sghioto

Joined Dec 31, 2017
3,708
Thanks, it now consumes less than 20ua including the rf433 modules.
I have a question: as far as I know, the capacitor self discharge over time, so if the circuit connected for several days or weeks, when it's disconnected, can the capacitor still output its pulse?
Not sure what you mean by when it's disconnected.
As long as the 9 volts is connected to the switch the circuit will pulse every time the switch opens and closes no matter how long the time is between the open and close . If you disconnect the 9 volts you will get 1 pulse to K2.
Does that answer your question?
 

Thread Starter

garudaone

Joined Nov 22, 2022
16
Not sure what you mean by when it's disconnected.
As long as the 9 volts is connected to the switch the circuit will pulse every time the switch opens and closes no matter how long the time is between the open and close . If you disconnect the 9 volts you will get 1 pulse to K2.
Does that answer your question?
I mean the switch is on for several days and when it's off, will the pulse still sent to K2.

Yesterday, I kept the switch on for around 12 hours, when I switch off, there's no pulse sending out to K2. When I switch on again, also nothing happened to K1 and also no to K2. However, when I keep it off for around 2 minutes, then it's sending out pulse again to both K1 and K2, respectively.
 

sghioto

Joined Dec 31, 2017
3,708
Yesterday, I kept the switch on for around 12 hours, when I switch off, there's no pulse sending out to K2.
I don't see any reason for K2 not to get a pulse when the switch is OFF.
Capacitor C1 does require at least 5 seconds to discharge so the switch would need to be OFF for that amount of time before switching back ON.
Should add diode D3 back in the circuit for the K1 pulse, it was left out of the previous schematic by mistake but should not have any effect on K2.
I'll repeat your test and leave the circuit connected as you described. Will check in the morning after 12 hours.
1669780957971.png
 
Last edited:

Thread Starter

garudaone

Joined Nov 22, 2022
16
I don't see any reason for K2 not to get a pulse when the switch is OFF.
Capacitor C1 does require at least 5 seconds to discharge so the switch would need to be OFF for that amount of time before switching back ON.
Should add diode D3 back in the circuit for the K1 pulse, it was left out of the previous schematic by mistake but should not have any effect on K2.
I'll repeat your test and leave the circuit connected as you described. Will check in the morning after 12 hours.
View attachment 281801
My input is 9v, I try many different capacitors from 10uf(below this, it can't trigger the rf433 module) to 200uf, I use same uf capacitors for both side.

It stopped working after several on/off within 1 or 2 seconds apart, esp K1 will stop working first. And if I off them for a few minutes, it'll start working again.

However, the original design(the one that consumes 2.6ma) is working fine.

Thanks;
 

sghioto

Joined Dec 31, 2017
3,708
After 12 hours the circuit is still working fine.
It stopped working after several on/off within 1 or 2 seconds apart, esp K1 will stop working first.
That is normal as I explained in my previous post, you need a minimum of 5 seconds between ON and OFF because of the large value resistor R1 (10M). That value was chosen to reduce the standby current to a minimum.
As far as K2 is concerned what part # transistor are you using and diodes?
You can try changing R1 and R2 to 1M but should not need to change the cap values.
1669825283850.png
 

Thread Starter

garudaone

Joined Nov 22, 2022
16
After 12 hours the circuit is still working fine.

That is normal as I explained in my previous post, you need a minimum of 5 seconds between ON and OFF because of the large value resistor R1 (10M). That value was chosen to reduce the standby current to a minimum.
As far as K2 is concerned what part # transistor are you using and diodes?
You can try changing R1 and R2 to 1M but should not need to change the cap values.
View attachment 281848
My diode is 1N4007, Transistor: 2N3906
 

Thread Starter

garudaone

Joined Nov 22, 2022
16
Have you tried the circuit in my previous post?
Do you have any 1N4148 diodes you can use?
Yes, I have the zener diode. I try it but it looks the same. when using 1M Resistor, it is around 70ua(including my rf433 module)

I think the problem of K1 not working properly is due to there's some current from K2 port, which cause conflict to K1. When I connect only K1 pin to the RF433 module, it works fine.

5 seconds delay is a bit too long, anyway to reduce this to 2 seconds? I change to lower uf capacitor but this can't help much. The RF433 module has a feedback pin when it's sending data out(the red circle in my attached photo), can this be useful?
 

Attachments

sghioto

Joined Dec 31, 2017
3,708
Yes, I have the zener diode.
The 1N4148 are general purpose diodes not zeners.
Try the original circuit again as modified below.
In reality what is the minimum time the water pressure switch will stay open, more then 5 seconds?
The RF433 module has a feedback pin when it's sending data out(the red circle in my attached photo), can this be useful?
I don't think so.
1669941519977.png
 
Last edited:
Top