# How to get a 24 V signal generated when the input circuit state changes?

So I'm an IT guy with no electrical experience trying to figure this out.

How do I set up a circuit that puts out a 24 V signal for a short time or puts out a continuous 24v signal that quickly turns off whenever the inbound circuit state changes? Like when the inbound turns on I need a signal and then when the inbound turns off I need a signal.

I have an incredibly stupid industrial molder that will put out a 24 V signal that changes states at the end of every cycle that did not trigger a tolerance alarm. A good part is made, it turns a 24 V signal on. When the next good part is made, it turns it off. If its on and a bad part is made, it remains on, and if it's off and a bad part is made it remains off.

We have a LED pace counter that increments the part count whenever it receives a 24 V signal. A continuous 24 V signal will increment it once until it is turned off and back on. I need to figure out how to get this hooked up.

I know how to handle this if I had to write a computer program but I have no idea where to even start with relays, circuits, and switches etc.

I've tried playing with the setting on the molder device and even contacted the manufacture and they are no help. When I use the settings they tell me to, I get a continuous 24 V out after one part is made. The only consistent cycle I can get that also uses the built in tolerance is by changing some settings and arriving at the above situation.

Simply doubling the count increment and having it increment every 2 cycles is not an answer either.

I currently have it wired into the circuit that gets triggered every time the safety door gets closes but when line workers get behind, they just open and close the door like 20 times and claim ignorance to what happened.

Also, I'm open to any solution, IDK if there's some other product out there that can add some logic to it. Budget is around $100 but as low as possible is best. The post tags may not be appropriate, I honestly have no idea what to tag it. • If I understand your description, a good part is indicated by the 24 volt signal changing state. There's no change if the part is bad. There are edge detection circuits that traditionally work in the microsecond range, but I'm sure we can come up with a equivalent using relays or similar parts. – gbarry Nov 13 '18 at 16:08 • What sucks is the manufacturer is pretty much useless. They explained some settings to me as said if I set a cycle count to 1 it would generate a signal after every good cycle. However it shows a continuous signal and does not trip the counter(after 1 count) when hooked up. I honestly don't know if the "continuous" signal is really continuous or if there is a microsecond drop. so IDK if an edge detection circuit would work. when I set the int count to 2, I get the state change I described above. – JJ09 Nov 13 '18 at 16:56 • I'm still doing more research. Is this something a plc can do? Originally they were going to put a computer in and use a DAC box and a custom program used on a few other lines (with different machines) but I came in 1 day and they had an LED board installed and said make this work. Can a PLC store a var like past state, and check current state against past on a timer of like every second and send a signal out if different? If not a PLC is there some other device with some basic logic ability? – JJ09 Nov 13 '18 at 16:56 • Yes - that is what PLCs do. Some of them are under$100 and one of the ways they can be programed is with a BASIC-like language called Structured Text. – George White Nov 14 '18 at 1:09

simulate this circuit – Schematic created using CircuitLab

Figure 1. A circuit based on industrial timers. Top: the desired timing diagram. Centre: the circuit. Bottom: the timing diagram again but showing the internal operation.

Industrial timers are available with DIN rail mounting, etc., and 24 V is the standard operating voltages. They are robust and have plastic enclosures and screw terminals. This solution uses an ON delay and an OFF delay timer.

• The on-delay timer output turns on some time after the input turns on. It turns off immediately supply is switched off.
• The off-delay timer output turns on immediately with the trigger input. It holds on for some time after the trigger signal has been removed. To maintain output it needs 24 V power.
• The changeover contacts of T1 and T2 are wired in opposition so that the output turns on when the status of each does not match.

If I have misinterpreted your requirements then please add a timing diagram into your question. You can do this quite well using ASCII art and the code tags as shown below.

   _____      _____
__|     |____|     |_____
_     _    _     _
__| |___| |__| |___| |___


Response to PLC answer:

You can streamline your PLC solution using the Rising Edge and Falling Edge contacts. These are edge triggered and remain on for one scan of the program.

  X1                   Y0
--|^|---+-------------(SET)----
|
X1    |
--|v|---+

Y0              +TMR-T1---+
--| |-------------+   1.000s|
+---------+

T1.Done                Y0
--| |-----------------(RST)----


To answer your comment, yes, this is something that can be done with a PIC and some additional circuitry, but if you want to go with transistors or relays it is also possible to implement. The main "problem" is the voltage level of your signals, most circuitry works at lower voltages than that, so voltage conversion becomes necessary for both your input and your output.

This is the basic idea (that can be implemented in either hardware or software, I chose the CD40xxx logic family as this is the highest voltage CMOS family, some gates can directly handle 15V):

simulate this circuit – Schematic created using CircuitLab

I would use Schmidt triggers as you might have to deal with relatively slow-changing signals and noisy thresholds. It will also reduce power dissipation in analog elements such as the delay.

Note that this can be implemented also with transistors or even relays. The tricky part with relays is possibly the delay element, as a long time constant is not compatible with the relatively high currents needed to operate the coils.

Here is a transistor implementation (I might have mixed the connections on the final XOR which would invert the output pulse, but this is the general idea):

simulate this circuit

• The OP was talking about a PLC not a PIC. PLC's love 24volts. – George White Nov 14 '18 at 1:10
• I guess I need glasses. But last time I checked PLCs are not less than $100. – Edgar Brown Nov 14 '18 at 1:18 • lower case plc and pic do look alike. I googled low cost PLC and see many at$50-$60 and one at$33. – George White Nov 15 '18 at 17:29
• If PLCs have reached that price range, why do people still bother with making Arduinos do these types of jobs? – Edgar Brown Nov 15 '18 at 18:41
• I think they are weird to program – George White Nov 15 '18 at 21:38

So, I found the Ace PLC from Velocito for \$60 but luckily I guess they keep some proper PLC's laying around. I downloaded the do-more software and PLC sim, did a quick tutorial and I think I wrote ok logic to get what I want done. I just need to get it on one of the PLC's they have laying around and make sure I have the voltage right coming out.

Thanks so much to everyone who responded, I honestly expected to get flamed for incorrect tags, posting location, and general lack of knowledge and I am very happy with all of the help. So thank you!

• See the update to my answer for a streamlined version. – Transistor Nov 15 '18 at 18:14