Hello. I have a button connected to 12V and want to fire a solenoid 24V ONCE every push of the button. No matter if the button is pushed 1 sec or one minute. The solenoid should fire more or less 1 sec and then go low EVEN if the button is still pressed. It's like a Trigger on the rising edge only. Is that text clear? I managed to do it with a microncontroller but I want to do it without a microcontroller. The examples using a 555 monostable with one shot didn't work if the button is still pressed (it keeps the solenoid ON until button is relased and I don't that that like that). Can you help with a solution with real values that I can simulate in Proteus? PS: I know it is a little off topics of this site. Thank you
Please, post your 555-based one-shot circuit.
...and also ask a moderator to move this topic to a more appropriate forum section
Moved to a more appropriate place.
Hello. Thanks for the help and the "moving" of the topic. I saw this circuit:
In Proteus it didn't work because it's ONE SHOT but you HAVE TO relase the switch or it triggers HIGH the output until switch is open. I just want the solenoid active 1 second every time a rising edge is detected.
Try the following 74LS221-based one shot circuit of Fig-1. Check the functionality of the one-shot by connecting a R(1.5k)-LED circuit at the output to see that the LED remains ON for 1-sec every time you press and release K1.
Figure-1:
74LS221 contains two one-shots. You choose the other unit (U1:B).
Hello. This one?
Pinout still not the same.
Look at the following diagram and accordingly get the right part/section from the Proteus.
Hello. I don't think I can manage to find the right part. I will try. Thanks for the help and patience.
Then you can get the part, build the circuit, and test.
Just be careful with @GolamMostafa's circuit as it does not like 12V.
Thank you for the observation and notifying the OP. In this case, the 555-based one-shot (Vcc = 5V to 15V) is the practical choice (Fig-1).
R2 = 2.2k, R1 = 10k, C1 = 100 uF/25V, C2 = 0.01uF
t ~= 1 sec.
Figure-1:
In the "good old days", we used a capacitor - say 1 mF 25 V - and a resistor - say 12 times the resistance of your solenoid.
Press the button, the capacitor discharges into the solenoid which actuates and releases as one tenth of the current is insufficient to hold it. Release the button and the capacitor charges again.
Hello @Paul_B . The RC doesn't work like I want because if I DIDN'T release the button, the solenoid is always ON untill I release the button.
The circuit that works so far is the one sugested by AnalogKid in another forum and uses the CD4093. Of course I haven't tested ALL the circuits so far so... I'm still looking. Thanks for the help guys and special thanks to @GolamMostafa
If the circuit in post #5 is modified so that the switch is capacitively coupled to the trigger input, then you only get a narrow pulse to do the triggering.
You can choose the time constant of the capacitor and extra resistor to give the desired pulse width - it can be say 1ms or even less to give your desired operation.
Clear flag at start
Poll in loop
Only run if rising edge and not flag
During run, set flag
On falling edge, clear flag to rearm for next pass
int runFlag = false;
...
loop()
{
if (!digitalRead(btn_pin) && !runFlag)
{
// Button down
fire1shot();
runFlag = true;
}
//
// Sometime later in code - wait for button release
while (!digitalRead(btn_pin) ) { wait or do something else }
runFlag = false; //Allow process to happen again
}
That generally does not matter since the continuing current is too low for the solenoid to hold on (since you make the resistor sufficiently high) and causes no significant heating in the solenoid.
Not sure what that circuit is supposed to illustrate - certainly not what I described!
@Paul_B It was a response to ...
In the "good old days", we used a capacitor - say 1 mF 25 V - and a resistor - say 12 times the resistance of your solenoid.Blockquote
I tested the cap and res circuit in Proteus and instead of a solenoid I put a led just to have some feedback.