Convert constant input to pulse

Trying to convert a toggle input to a true pulse and a false pulse. Ive tried flip flops, if-else, and everything else I can think of. Basically I have a pressure switch, and I need to it output a .5 second pulse when it opens to one port, and a .5 second pulse to a different port when it closes. I have a 20hp rotary compressor that doesnt run in “auto” mode anymore, and you have to hit start and stop manually, which is terribly inefficient. I need a way to use the pressure switch which is a close/open contact to work as a digital input, and simulate the bottons being pushed via a 2ch relay board that will be tied to the control panel.

Maybe Im missing something, but everything Ive tried just doesnt work or works in the wrong fashion. Any help is greatly appreciated!!!

this is what i have so far, and it seems to be working ok

Do I understand correctly that the picture below works the same?

Should be the same. If you want to be more explicit, you could use pulse-on-true and pulse-on-false to feed the ‘delay’ nodes (but that shouldn’t change functionality). You might even be able to use output of pulse-on-true & pulse-on-false directly, but I doubt they would be “high” long enough for this application, so delay nodes are probably needed.

WOW, that worked exactly as my MUCH longer version. Thanks!!! I guess I was over complicating it a bit.

yeah, I need at least a .25 second pulse to trigger the button on the controls. the only issue I have now is the relay board is a low trigger, so i need to add some pull up resistors and another not gate to invert the output of the Nano

so this is where I am at right now. for some odd reason with the other setup, sometimes it would pulse both outputs at the same time, and sometimes it wouldnt pulse at all, which i think was a weird debounce/delay issue. this seems to work 100%

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.