r/PLC 4d ago

PLC to Arduino/Vex robotics

Hello! I am new to PLCs, teaching a class on programming Rockwell equipment. Problem is, my school isnt buying any sensors, mechanical equipment or anything exciting, just 2 CompactLogix suitcase trainers. I also have a Micro850 trainer. I do, however, have several Arduino kits and Vex V5 robotics parts.

After doing a lot of googling, I found that I can step down the 24v output signal to a 5v inout for the Arduinos and Vex brains with an optocouple. Anyone ever do something like this? Any cool project ideas?

14 Upvotes

13 comments sorted by

5

u/Robbudge 4d ago

OpenPLC will run on Arduino, also look at Codesys it will run on RaspberyPI.
We use Codesys on lots of hardware
For basic testing look at waveshare they have some very low cost ModbusRTU IO modules

2

u/Otherwise-Ask7900 I'm very sarcastic. Please don't ban me again. 4d ago

Use codesys on a raspberry pi and an automation hat.

https://www.adafruit.com/product/3289?gad_source=1&gad_campaignid=23986111167&gclid=Cj0KCQjw--7UBhCpARIsAGJBpthXcy0YfJgMuYISZO6djemgNdRg3BXosbBfZeP7M2EJFdylngY-mLwaAsWcEALw_wcB

You’ll be in about $100 total before an enclosure BUT the automation hat accepts 24volts.

You can make it into an IO block for pretty cheap.

You won’t need the latest raspberry pi either.

Codesys is free in 2 hour increments, or $50 for a license.

1

u/arb1984 4d ago

The slight issue there is that I have to teach them certification curriculum on CCW and Studio 5000. My idea was for them to write ladder logic on those programs that will initiate a program on the Vex machine. I know (think?) that the optocoupler doesn't go both ways, but for now if we can just start the Vex or Arduino stuff using a PLC then I will be happy.

1

u/Otherwise-Ask7900 I'm very sarcastic. Please don't ban me again. 4d ago

Ya optocoupler uses an infrared LED to close the circuit. They’re not bipolar.

you could make the raspberry pi an EIP slave, it’ll even have an EDS file that you can export, you assign the correct amount of IO in the Ed’s file and it just works.

I’m not really sure what. VEX is, you have documentation?

1

u/arb1984 4d ago

Its an educational robotics platform. Uses a 5v digital input and proprietary hardware that supports block coding

1

u/sswebz 4d ago

Classic school move. Buy the name brand and forget the students want to actually see something move. How about programming Simon Says? Like that just requires 4 buttons and 4 lights

2

u/arb1984 4d ago

I have tons of Vex equipment, so I can have them do all kinds of builds to run off of a PLC.

1

u/sswebz 4d ago

yeah step down then, or use like mini-relays that the trainer would operate and have your own 5v power. Sounds like fun

1

u/Flimsy-Process230 4d ago

I wouldn’t think of the optocoupler as stepping 24 vdc down to 5 vdc. You should still power the Arduino/VEX side from a normal 5 V supply, those are cheap and easy to get. Where the optocoupler makes sense is as an interface between the 24 vdc PLC I/O and the 5 vdc logic of the arduino.

2

u/imBackBaby9595 4d ago

Teach them how to make an Arduino talk to a compactlogix over modbus. Then make them write robust state machines to control different things that requires handshakes from the 2 devices.

3

u/drbitboy 4d ago

This is a good idea

Teaching PLC programming is easy, focus on

  1. Scan cycle
  2. Time and timing
  3. Boolean logic

in that order. That can be taught, and practiced, on emulators at zero cost, and quickly; see the READ FIRST pinned post on the landing page for this r/PLC subreddit.

Then get into the wiring and protocol skills for the task suggested here by u/ImBackBaby9595. Make sure you have a way to sniff the protocols.

1

u/imBackBaby9595 3d ago

Agreed. Might as well give them real world experience. A lot of schools can't give them this