So Im trying to use my Arduino to communicate with a PLC using discrete I/O. The Arduino obviously outputs 5v but my PLC needs 24v. I was thinking a simple TIP120 transistor would solve this problem but Ive never used transistors with my Arduino before so I wanted to verify before I go and ruin something. I also want to add a simple LED as signal to show which outputs are on. Ive drawn a little picture to illustrate how I was thinking this would work. The load would be the PLC.
do you need to control 5 amps ?
is this just for communication ? maybe you could use an opto-isolator ?
This is just for communication. I have never thought about or worked with an opto-isolator but I just did a little Google search and it seems like a perfect fit for this application. If you have any recommendations on specific opto-isolators (part numbers) that would be much appreciated!
I found this optoisolator from Sparkfun that I think will work, could anyone give me a confirmation on it?
What frequency is your communication running at? If it is low frequency or DC, then you are good. If you are trying to do some form of serial communication, then you should compare it to the datasheet.
Its just DC, thanks for the warning on serial though
It appears that you have the Arduino connected to the Collector ("C"), it should go to the Base.
So if Im going with the optoisolator from Sparkfun (https://www.sparkfun.com/products/314) and Im using the following input module from my PLC (Productivity3000 high performance PLC), do I need a current limiting resistor on the receiver side?
here are two options. one is a repeater, the other is an inverter.
these are only one way signals. this will not see a signal from the PLC
Yes, the resistor is needed, but will invert the signal (Otherwise it will burn out the opto-isolator probably). Its a basic Open Collector circuit. You use the resistor as a pull-up and then measure at the collector. See Dave's Drawings.
Thank you guy so much!
Thanks everyone for all the help, thought I would share the mostly finished product. It handles 28 individual 5vdc signals and turns them into 24vdc. I just finished testing each one and they work like a charm! I'm going to add screw terminals which is why there are a bunch of lead wires everywhere. They will arrive tomorrow so hopefully I will get that done tomorrow and get a few pics up. If anyone wants any further detailed info just let me know!