Using Arduino to simulate a serial port

Hi,

I have a a sytem which contains 2 electronic cards: 1 card with 4 on/off relays and one card with 8 analog inputs and 2 analog output.
These cards are used to control high voltage power supplies and to set and readout different values related to these power supplies (actual voltages, supplied currents…).

Until now, I used a labview software to control these cards wich are connect to a USB hub and this USB hub is connected to my computer.

I would like to control my system by using only a serial connection between my system and any computer.

So the usb hub (and therefore the cards) would be connected to the arduino and then the arduino to the PC.
So basically, I would write a program embedded on the arduino which listen to the command send by my PC and operates the cards.
For instance if I send the command ‘‘HV1 On’’, the arduino will switch on the proper relay.
Or ‘‘HV3 read current’’, the arduino will return the current supplied by the high voltage power supply #3.

Here are my questions :
Is my project feasable ?
What is the condition on the drivers cards to make it work with the arduino ? Is a linux driver adapted ?
I was thinking to use an arduino mega, is it a proper choice ? At this point I am hesitating with a raspberry.

Thanks for your help !

Do you have a year or two of your time to make this work?

Paul

Try harder to describe what exactly you want. Without references to Linux, drivers, USB hubs...

Have you ever used Serial Monitor with an Arduino?

Willis238:
So the usb hub (and therefore the cards) would be connected to the arduino and then the arduino to the PC.

If these cards are intended to be connected by a regular USB cable then an Arduino is not really suitable. You need a device which is a USB Host - such as a PC. Arduinos are not USB Hosts, though you can get a USB Host shield. However I have no idea whether it would recognize your "cards".

IMHO a RaspberryPi would be a much better option as it is actually a Linux PC in a small package.

...R

DrDiettrich:
Try harder to describe what exactly you want. Without references to Linux, drivers, USB hubs...

Have you ever used Serial Monitor with an Arduino?

I am a total newbie to arduino but I have quite good programming knowledges (mostly Pyhton, C and Labview).

Here is a link to a schematic of what I want to do:http://ge.tt/3STQj5z2
The PC simply send strings to the arduino via a serial connection.
An embedded software on the arduino turns these strings into a proper command to operate the cards.

I am not worried about the communication between the PC and the arduino.
I am more concerned about controlling the card with the arduino.

The final goal is to a have an independant device which can be operated from any PC with any OS. No drivers installation, no configuration... it just requires a connection (serial in this case but it could be USB, ethernet...) to the arduino.

Robin2:
IMHO a RaspberryPi would be a much better option as it is actually a Linux PC in a small package.

...R

The more I read about both plateform the more I think using a Raspberry would be easier.

Robin2:
However I have no idea whether it would recognize your "cards".

That's why I am wondering how to deal with drivers with an arduino. Maybe it is a non sense, it is new world for me !

Willis238:
I am a total newbie to arduino but I have quite good programming knowledges (mostly Pyhton, C and Labview).

Here is a link to a schematic of what I want to do:http://ge.tt/3STQj5z2
The PC simply send strings to the arduino via a serial connection.
An embedded software on the arduino turns these strings into a proper command to operate the cards.

I am not worried about the communication between the PC and the arduino.
I am more concerned about controlling the card with the arduino.

The final goal is to a have an independant device which can be operated from any PC with any OS. No drivers installation, no configuration... it just requires a connection (serial in this case but it could be USB, ethernet...) to the arduino.

Any PC/any OS can support a USB connected device. If I understand your problem the real issue is that Labview and/or the device driver for your cards is not portable to arbitrary host platforms. It's not clear how adding an Arduino hardware/firmware layer fixes that.

I feel a misunderstanding in the "drivers" location. On a PC some software is required to serve an COM port, at least a terminal program or the Serial Monitor. An Arduino instead comes with full Serial support.

Once again and for the last time here: run at least one example on an Arduino that uses the Serial port. Then come back with questions related to your project.

Paul_KD7HB:
Do you have a year or two of your time to make this work?

Paul

So it is feasible :slight_smile: !
About time , it is more like 2 months !

Willis238:
The final goal is to a have an independant device which can be operated from any PC with any OS. No drivers installation, no configuration... it just requires a connection (serial in this case but it could be USB, ethernet...) to the arduino.

This is still a bit naive.

EVERYTHING connected to a PC (whether Windows, Linux or MAC) requires a driver to interface between the peripheral and the PC. Some drivers are automatically included with the Operating System - almost all in the case of Linux.

AND if you want a PC to communicate with something (whether Arduino or RaspberryPI or anything else) there will need to be a program on the PC.

Probably the simplest way to make a generic interface is to use a RaspberryPi as the hub that connects to your cards and which has a web server program that can take messages from a browser on the PC and send commands to your cards. Your PC could connect to the RPI by WiFi or by ethernet cable and the only program needed on the PC would be the regular browser. If you use Wifi you could control things with a browser on a smart phone.

I have created a few PC projects that use the Python Bottle web framework to create the user interface and the Python code can also talk to my Arduinos. You could develop something similar on an RPi using Python code to talk to your "cards". With Bottle you can have a very simple web server running in 10 or 15 minutes.

I don't see any role for an Arduino in this.

...R

MrMark:
Any PC/any OS can support a USB connected device. If I understand your problem the real issue is that Labview and/or the device driver for your cards is not portable to arbitrary host platforms. It's not clear how adding an Arduino hardware/firmware layer fixes that.

The origin of my post is I have a customer who bought our system.
This system is originally supplied with a labview software to be operated.

Now this client want to integrate this system in his own larger system.
There larger system communicates via all the other equipments via a serial connection. The customer wants to do the same with our system.

So I have to find a way to make our system compatible with their requirement.

We could develop a kind of driver to do that but it is beyond my knowledge.

Willis238:
Now this client want to integrate this system in his own larger system.
There larger system communicates via all the other equipments via a serial connection. The customer wants to do the same with our system.

That is a very much narrower requirement than stated in your Original Post

I would like to control my system by using only a serial connection between my system and any computer.

And it seems now that this is a development for a commercial product for which you are hoping to profit from our free advice. Why not just get professional advice.

Or even make use of the fairly extensive free advice you have already been given here.

...R

Simple solution: make your cards understand serial communication, too.

Else ask in Gigs and Collaborations for further assistance.

Robin2:
And it seems now that this is a development for a commercial product for which you are hoping to profit from our free advice. Why not just get professional advice.

Actually that was not my spirit when I posted. I just have the opportunity to work on insteresting project during which I can learn a lot of things (related to arduino and/or raspberry). And I like to learn by myself and find solutions.
But I understand your position and I really thank you for your advices.

Robin2:
Probably the simplest way to make a generic interface is to use a RaspberryPi as the hub that connects to your cards and which has a web server program that can take messages from a browser on the PC and send commands to your cards. Your PC could connect to the RPI by WiFi or by ethernet cable and the only program needed on the PC would be the regular browser. If you use Wifi you could control things with a browser on a smart phone.

I have created a few PC projects that use the Python Bottle web framework to create the user interface and the Python code can also talk to my Arduinos. You could develop something similar on an RPi using Python code to talk to your "cards". With Bottle you can have a very simple web server running in 10 or 15 minutes.

I don't see any role for an Arduino in this.

...R

Indeed I think I misunderstood the abilities of an arduino.
A raspberry seems to be better for my project.

Thanks again.