D/A I/O over Ethernet

Hello everyone,

After unsuccessful search for some related posts on this forum, I have decided to ask you for a specific advice. I am a software guy with a little experience in electronics, so please be forgiving for any mistakes :). I would like to find out, whether Arduino is a good solution for my problem. People I know do similar stuff using PLC controllers with Ethernet module, but I'm looking for a cheaper solution.

  • I have a piece of software on a PC that needs to get/set the state of some physical buttons, switches, potentiometers, LEDs and gauges. Ideally I would like to connect at least 8 of each: DI (switches/buttons), DO (LEDs), AI (pots) and AO (gauges). I'd like to be able to expand the range to dozens in the future.

  • I need the numerical control/state values to be sent/received continuously via TCP/IP at a speed of at least 5-10 times per second.

  • I want it to automatically restart communication when the power is down and up again, so no user interaction is needed (the user does not need to press any button or something). Simply speaking, whenever I power it up, it'll immediately establish connection with my PC application and keep sending/receiving the state/control data.

  • The data I send or receive would ideally be a bit pattern for digital I/Os and 4 byte floating point values for analog I/Os.

I would be extremely grateful for advising me:

  • whether it can be done by Arduino (or could you suggest any better platform/solution)?

  • what hardware elements I need to buy (the cheaper the better! :)). I know that I can get a basic Arduino starter (which version would you recommend?) and something called an Ethernet Shield (right?...).

With pots, the device probably needs to convert resistance to data value, but what about analogue gauges with pointer, what signal would drive the pointer?

Thanks a lot in advance.

I don't see anything here you couldn't do with an arduino ... I would look at the EtherTen its a arduino clone with ethernet built in and a poe option

I would also have the computer pull the information from the arduino not the arduino push the information out

Yes, an Arduino can handle this. Because you have eight analog inputs you need to use an Arduino Mega; an Uno/etc. only have 6 analog inputs available.

You will of course need an ethernet shield, and there are multiple varieties of these at different price levels. Take care to research the libraries used with these modules so that you're sure you can understand how to use them.

An analog gauge would be controlled by pulsing a digital output (by using PWM). See the documentation for analogWrite.

Hi aselby,

Thanks for a quick reply :). There are actually two questions: who is going to be a server and who a client on a TCP/IP level, but on a data level, it's actually both sides that need to send and receive. The PC needs to send data that will turn the LEDs on and off and tell the gauge to move to a certain position, while the board needs to send states of post and buttons. Therefore, the communication needs to be bidirectional.

Chagrin,

What about expanding the number of I/Os to say 16 or 32, are there any expansion modules of some kind?

The PC needs to send data that will turn the LEDs on and off and tell the gauge to move to a certain position, while the board needs to send states of post and buttons. Therefore, the communication needs to be bidirectional.

So have you figured out how to do this on the pc side? The arduino with an ethernet shield can both operate as a web client and server at the same time. Telnet code might be possible to do the same thing. Don't think you will find an easy solution for your project if you are not already familiar with the issues.

rfvujm:
Chagrin,

What about expanding the number of I/Os to say 16 or 32, are there any expansion modules of some kind?

The Mux Shield or Jeelabs' Analog Plug come to mind. I guess it depends on just how many inputs you're looking for to determine what route to take.

Polling an Arduino at 5-10 times a second should be doable, and yes you are right that it might be easier to use telnet (or netcat ("nc") would be easier to interface with if you're on Linux/Unix) and develop your own simple protocol instead of using HTTP.