For a school project I need to control an Arduino with a PLC. I have programmed an HMI (with a Siemens S7 PLC) with buttons. When I touch a button on the HMI, an PLC output will become HIGH.
I want to attach this output to my Arduino, so that it will make a digital input high. Then I will be able to program actions in the Arduino IDE software.
But, the PLC has a 24V output. I'm pretty sure that I can't connect this directly to the Arduino. Do you guys have any suggestions?
Hi,
What about using negative logic? We have a common
signal. The PLC high is about 24 volts and the low is
about 0 volts. The arduino high is about 5 volts and
the low is about 0 volts. When the PLC output is
not high, it must be low. When the Arduino input
is not high, it must be low. We can not connect
the two pins together since the 24 volt signal will
damage the input. So, let us see if we can use
the low signals. Now we must block the 24 V signal
so the Arduino does not see it, but let it see the low
signal. We can use a diode to do that if the input
pull-up resistor is enabled on the Arduino. So, there
you have it. The input does not see 24 V, it sees
the pull-up to 5 V. When the PLC output goes low,
the input sees pull-up pulled low through the diode.
The only question I have is: does the PLC output go
close enough to 0 Volts to allow the diode to work.
Herb