Go Down

Topic: Arduino as a PLC (Read 31165 times) previous topic - next topic


soryy cr0sh, I'm getting a bit cr0sh-eyed in my old age and picked the 5th line from the top in error.

Ok - that explains it...no problem.

I'm almost certain there are actually 10 logarithmic divisions, it's just that the ninth one is so close to 10th it looks like a thicker line due to the rather poor graphics. So each line upwards represents a power increase of 0.1, so the WGS of 3.5V gives a current of 10^^0.5 = 3.16A  ...

Hmm - and that explains that!

Based on this, it seems to me that I was understanding things correctly; with the exception of Vgs going up as Vds goes up (and likely, for the OPs purposes, this logic-level MOSFET would not be suitable for a Vds of 24 volts, since Vgs would likely need to be higher than 5 volts TTL - thus the need for either an optocoupler as suggested, or another transistor or FET to switch on the main one).

Does that sound right?

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


just as a side-note about PLC
I have been observing electricians and a PLC guy at my place of work trying to control a unusual multiple chainblock system (it can rotate and move in a sort of H pattern and they want it to go to a certain spot in a single keypress with no operator training)

and it's been absolutely painful to watch them work
they're almost done and the system's interface is a huge 8 button remote that you have to press button in sequence to switch between system of change the destination, clearly artifacts of the PLC way of doing things

also it's very unreliable, it goes into fault mode and stops moving and the only external communication is a blue and a green light that are on off or blinking (no one knows what they mean) it goes into fault the lights are seemingly random and there's no way to know why without calling the guy and he hook his laptop

in all I think the arduino would have been a much better option for this even though it's not "industrial"

I'm going to program my arduino with lcd to output relevant messages by keypress and show it to the guy next time he comes
really that remote should at least have a LCD display !!

but there's no denying there's a lot PLC installs out there and PLC is a lot like how an electrician would make a computer, it's like a thousand relays !!!

I think there is a lot of money in this and some PLC to arduino interaction would make a very good project that would certainly boost the reputation of the arduino as an industrial solution

(seriously, ladder programming ? it's all graphical and stuff, it's like programming with lego mindstorm, it doesn't strike me as professionnal !)


Mordern plc's use structured text a pascal like language which is a lot more modern than ladder. Also ladder is almost never used in europe. The last time I saw it was ehm.. yesterday. I have to convert a program from an old plc to a DCS system (proces control system for large factories) but before that the last time I used it was when I learned it at school more then 10 years ago. For user input there are nice operator panels availlable which range from a simple lcd display with a few buttons to full colour windows ce touch screen devices.

So, allthough I like arduinos a lot I don't think they can replace a modern plc.


If you want more technical details on MOSFET than Wikipedia provides, you can probably get a book on semiconductor devices from a university library. That said, if you just want a little more detail, here's a PDF from IRF: http://www.irf.com/technical-info/appnotes/mosfet.pdf



So, allthough I like arduinos a lot I don't think they can replace a modern plc.


I agree, the "PLC" I am replacing for this project is an ultra low-end TECO SG2. The Arduino simply blows this unit out of the water in terms of flexibility.


Let's start at 10^0; ok - next line up from that (closer to 10^1) is...? There are 9 subdivisions, so it should be 10^0.11, and the next 10^0.22...until 10^0.99999 (ie, for all intents, 10^1)...right? So, that line is actually sitting on the 10^0.5555 line, or about 3.6 amps...not 1.6 amps...???

9 subdivisions is correct, Let's start at 10^0(1); ok - next line up from that (closer to 10^1) is 2, next is 3 and all the way to 10, because is not start from zero but logarithmic division start from whole numbers... 0.01,0.1,1,10,100,1000


yeah I don't think and am not suggesting arduino can completely replace PLC

but in the specific case I witnessed, the arduino could have been a PLC device interfacing with the user and the PLC controller, instead of directly wiring huge, hard to press button to the PLC controller the interface could have been some better buttons and an analog stick for proportionnal control and a text LCD to give the user some feedback as to what is happenning or why it is not happenning

also things like data recording or handling analog sensors and interpreting them as a yes or a no are things I think that are hard to do with current PLC hardware and an arduino could be a nice complement

PLC isn't going away because it has a big user base

btw I talk to the guy in charge, he was using RsLogix 5000 in that graphical ladder mode thingy, and he was doing some kind of a loop, it wasn't really working well and I think he had to copy and paste it a lot because his whole "graphical program" was many many pages long (didn't care to count but way, way too much !)


Well everything you say is easly to do with a PLC. But I agree that ladder is horrible. It's made to be a replacement for relay automation (so just digital) and they have tried to get everything else which is possible in there as well.

But look at this proces panel which connects to a plc (those things can have data logging with trending):

That gives a nice user interface.

And some structured text as an example of modern plc programming:

Code: [Select]

i : INT;
i := 0;
i := i + 1;
UNTIL i >= 10;

Now that looks a lot like the arduino language.
So I think the problem is that someone who has programming ladder for ages doesn't want to switch to something modern which is more suitable for the task.


I agree, I did more research and PLC looks a lot more capable than what I saw implemented in the workshop

I think the only good reason I wouldn't use PLC is because of cost and reliance on the market for PLC hardware, but since that's also why PLC is supposed to be reliable (if all the hardware is thoroughly tested and certified it will be more reliable than a DIY installation, but with that said, the guy didn't test the reflective sensors in his labs before implementing in production and much of the ghost hunting has been faulty optical sensors)

I have no doubt that a competent PLC programmer can make these systems "sing and dance" to his will, it's probably just that the guy that did our system.. well .. sucked !


I have no doubt that a competent PLC programmer can make these systems "sing and dance" to his will, it's probably just that the guy that did our system.. well .. sucked !

I too think that is most likely the case. Before I retired from a Large Oil Refinery, it had hundreds of PLC installations. However the programming was done by professional engineers. The area electricians helped the installation, wiring check-out, assisted with system check-out and commissioning, but did not perform the programming.



Aug 08, 2010, 11:41 pm Last Edit: Aug 09, 2010, 06:28 pm by Pokey Reason: 1
I have been doing some homework and I have settled on the Arduino Mega and the optocoupler -> transistor configuration.

In studying the diagram kindly provided by AplhaZeta (http://www.kerrywong.com/blog/wp-content/uploads/2010/02/serialportctrl.png) it seems that I will need two IN4001 diodes, one 4N25 optocoupler, one IRFZ24NPBF transistor, three 1K resistors, and one LED for every high-power output connection.

I am trying to understand what is going on, so here is a list of really elementary questions (it's alright to laugh, I know I don't know much :-):

It looks as though the diode between the relay and the transistor is providing transient voltage suppression, is that correct?

What are the resistor and diode before the optocoupler doing?

In the diagram, it looks as though the transistor and relay are running on 5v, will I need to change the resistor value for a 24v circuit?

Do resistors have a specific direction, or can they be installed in any orientation?

My LEDs are 5v, can I install them before the optocoupler (after the diode) in the same way as shown in the diagram i.e. with a 1K resistor?

Thank you for your patience!


Do resistors have a specific direction, or can they be installed in any orientation?

Resistors work best when installed in a NNE direction. Which end points NNE and which points SSW does not matter.
The art of getting good answers lies in asking good questions.


Aug 09, 2010, 03:03 am Last Edit: Aug 09, 2010, 03:03 am by retrolefty Reason: 1
Resistors work best when installed in a NNE direction. Which end points NNE and which points SSW does not matter.

Doesn't that depend on if the device is located north or south of the equator?



Well, you both made me laugh. Thanks!



I just stumbled across this PCB SSR (VN05N) last night.


It looks as though it will do everything I need with plenty of overhead.

It supports 5v logic-level input and 60v 13 amp output. It features a status output and thermal protection, 2000v ESD protection, and it is actually quite affordable.

I think I will use this unless anyone has any objections.

Go Up