Hello everyone.
I'm trying to finish a project that involves connecting an Arduino UNO to PLC (Siemens S7-200 CPU 212), which can be accessed and programmed via PC. It's supposed to be a new lab for my school. The program for Arduino is quite simple, as it only really reads a state of a certain pin and turns the flag inside the program on or off and updates the information on the connected LCD screens. My problem arises when finally trying to connect the two together (Arduino and PLC), because the connection doesn't do what I hoped for.
The input for PLC is fine, I've used a relay to lower the voltage and everything seems to be working. Output is something I'm having trouble with. In Arduino software, I've declared the pins as input. I've powered the PLC output with 12 V and run that signal through a voltage divider, that is supposed to give me ~4 V, which I believe should be enough, pin still doesn't recognize the change and remains off. I've also tried using an optocoupler, but I'm having trouble figuring out how to physically connect the two devices.
What could be the issue? If needed, I can post necessary parts of code and some photographs. I would love to hear any tips, as I'm new in this field and would love to continue tinkering with this project and more in the future.
Did you connect the common GND?
What does your DVM say about the voltage levels?
Hi,
Can you please post a diagram of your connections, and link to the I/O modules you are using?
There are many configurations of I/O modules, and Siemens is no exception.
Thanks.. Tom...
I thought about it for a little while and came up with a solution consisting of powering the outputs of a PLC straight from an Arduino with 5 V and GND pin. I will be able to test it on Tuesday, but is it something that would be possible? It should take care of a common GND problem if I understand it correctly. Documentation for S7-200 says that range of voltage for relay outputs start at 5 V, so there might be a chance.
If my idea doesn't work, how do I check if both devices are connected to the common ground? I never thought about it, so it might be the issue I'm facing. Can I just connect the -12 V wire to the common rail on a breadboard and connect it to the PLC outputs and to the ground of a voltage divider?
A digital Voltage meter reads the 12 V connecting to the breadboard, but it reads ~0 V when trying to forward that signal to Arduino.
Thanks for the response and patience with probably a rookie mistake
Hi, @veern
That should be okay, the outputs it seems are just relay contacts that are refered to as "dry contact" in some quarters, which means you supply the power your project needs to be switched.
Tom...
PS. I like the idea of Arduino and group of displays to show I/O in a teaching situation.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.