Need guidance... :) (with RS232 and Arduino protocols)

Hello All ! !

I am very new to Arduino, and need some guidance.... :cold_sweat:

What I am about to build is a robot with:

4-6 DC motors
1-2 Servos or Stepper motors (with position feedback)
3 LED Light channels (with dim, and maybe color adjust)
3 axis Gyro with Compass

All this will be controlled by a laptop via a cable...

My "problem" is that I have to use RS232 out from the laptop...
And preferably :cold_sweat: on the robot it self...

Can anyone guide me with what cards I need, and possibly how I will find the signal strings on the laptop?

The cable delay spec for USB might become an issue, no?

I'm guessing this is for a remotely operated vehicle in an underwater environment.

If you will be using an actual RS232 port (mostly extinct), keep in mind they use +12V/-12V levels which will fry your arduino. In that case you must use a RS232 level shifter / transceiver IC such as MAX3227 between the RS232 port and Arduino in order to bring the RS232 voltage level signals to TTL/CMOS levels.

Also, RS232 is pretty slow, so I'm not sure a cable delay on USB would even be an issue.

HTH
-Igor

Thanks for the replys !

The reason for rs232 is the length... I need a cable up to 7-800 meters....and maybe more...
Are considering using F/O, specially because of HD camera...
What Arduino boards do I need? please specify...

And as my subject says, I need guidance... :roll_eyes:

I am familiar with RS232/485, and I think it would be "easiest" to find "pre-made" software to use...?
Dont have much experience with programming at all...
But please correct me if I am wrong !

Any specific recommendations for this?

igor86:
Also, RS232 is pretty slow, so I'm not sure a cable delay on USB would even be an issue.

HTH
-Igor

USB fails out of spec

I think it would be "easiest" to find "pre-made" software to use...?

There may be tons of premade software... or none. It is not clear from you description what you intend to do?

I can guess...

  1. You want to have a progam on your PC that talks serial RS232 -- Locate and download PUTTY.EXE, it contains and RS232 Terminal Emulator. (free)
  2. You want to control an Arduino 800M away. -- Get a USB-RS232 adapter for the PC side. On the Arduino Side, you can get one of these: http://www.schmartboard.com/index.asp?page=products_populated&id=84 or build yourself a Severino http://www.arduino.cc/en/Main/ArduinoBoardSerialSingleSided3
  3. Send simple commands: Firmata, Bitlash are two examples of "pre-built". Or code your own, it's not that hard. I have an example of remote RS232 control here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1293046321

if it were my project i would try and do most of the commands/video via ethernet and ethernet protocols. especially since there already exists a very nice ethernet shield made by arduino. but maybe thats because i know more about ethernet protocols than serial....i could be way off base though :smiley:

what kind of overhead do you mean? What other ways would there be to get the video from the submarine to the computer? I thought serial was too slow for that

what kind of overhead do you mean?

unnecessary data that is transmitted

yeah im not sure what i was thinking at the time. i just mentioned ethernet as i have a nice little telnet server running on the arduino right now that can communicate over the internet rather well so i was suggesting along those lines. but i hadn't even thought of just using a pair of cat5 for the video (how simple). i knew ethernet was a complex protocol but i didn't think it was that bad. anyhow this isn't my project so i don't want to sideline it anymore, the subject matter of the project is interesting though

Just to explain some more about my project...

It is not a ROV (I am a ROV Pilot and commercial diver by profession, and don't need to "make" my work tools), however, I would like to get more knowledge of Arduino, and at the same time try to "invent" something new. (don't want to say more here now, but I will release more info when it is finished) :wink:

I want to use RS232 to control this "thingy", but it is going up/down with RS485. This if ONLY to control hardware etc...
Picture will come on a coax...or maybe fiber-optics...with all the signal implemented in fiber...

My "problem" is to assembly hardware downstairs, that work with RS232 protocol (servos, motors, LED lights etc...)

So, my question is, what boards do I need to get Arduino to talk with RS232/TTL?
Do I need a "motor board" to control DC motors? Are not sure of how much current they will draw yet.
I want to dim the LED`s, can this be done with a simple I/O board with Arduino? Or do I need another board for this?
I also need feedback from the servos (position) and a gyro (and if possible from the motors also) is this possible) If so, how and what boards do I need?

And, finally, can I build all this "Arduino style" and put on/make a "converter" so this "thingy" will work with RS232?

Hopefully this is more "understandable" for all now :wink:

Also, does anybody know where I can find a nice, free, easy to use program to make electrical drawings?

For the drawings: EAGLE Cadsoft, great easy circuit software and FREE

For RS232 converting, this may work: USB to RS232 Converter - 6ft - CAB-11304 - SparkFun Electronics

Pololu Qik 2s12v10 Dual Serial Motor Controller This is a relatively high power DC motor serial controller (15A)

http://www.pololu.com/catalog/product/1110 Here is it's lower power sibling (1A)

You can dim the LEDs directly from the arduino, although depending on the amount you may need some external circuitry (you've only got 40mA from each I/O Pin)

There are alot of nice serial controlled servo controllers out there.

Muchos Gracias !

Now I have a beginning :smiley:

BTW: I have all I need of hardware from the laptop (USB to RS232/RS485 Cable RS485/RS232 "Thingy") it is only the "Thingy" that I need to work out now.

Arduino pins 0 is serial Rx and pin 1 is serial Tx.
Keep in mind that the USB serial can't be used at the same time as these pins.
UNO and earlier version have only on Hardware serial port.
Mega version have 4 Hardware serial ports one shared with USB.

You can use the soft seriallibrary to emulate hardware serial but it's baud rate is limited and is software polled.
Hardware Serial have a receive buffer to allow application to run while serial data is received (up to buffer limit)

Hope this helps,
Neal.

I want to use RS232 to control this "thingy", but it is going up/down with RS485.

Then you are not using 232, RS-232 specifies hardware stuff like voltage levels, slew rates etc. It has NOTHING to so with the format of the data. RS-485 is the same, it only specs hardware stuff.

So as I understand it you want to use RS-485 to talk async serial to the "thingy".

So, my question is, what boards do I need to get Arduino to talk with RS232/TTL?

Assuming my last comment is correct, you need a TTL->RS485 converter. There may be a board that does this but there are certainly a sh1t load of chips that do. So all you really need is a chip and a resistor at each end of the wire. The chips will output 5v async serial that you feed into the Tx and Rx pins of the respective Arduinos.

Do I need a "motor board" to control DC motors?

You will need something. You can roll your own motor controller but in this case there are several Arduino sheilds that can do this.

I want to dim the LED`s, can this be done with a simple I/O board with Arduino?

You can to this by driving the LEDs from the Arduino (often via a high-current driver chip or transistors, depends on the LED and the brightness you want). Once again there are shields that do this.

I also need feedback from the servos (position)

If you are controlling the servos you should know where that are at.

and a gyro

Plenty of breakout boards for these, probably look at sparkfun.com

and if possible from the motors also

Not sure what you mean there.

So in a nutshell, you can probably find shields to do all the above functions, but you may have trouble getting them all to work together as the Arduino backplane doesn't have shield addressing and often shield X uses the same pins as shield Y.

Have a look as shieldlist.org for a good collectio of available shields.

There may be a single shield that does all this, but i doubt it. So another option is to make your own if you have the hardware experience.


Rob

Wow, look at those Eagle prices!
That's why I stick with expresspcb.com
I suppose if I was going into high volume production and needed Gerber files & stuff it would be good.
For schematic capture over unlimited sheets and for laying out boards to check placement before building up a perf board by hand for example, expresspcb is just fine, for example a promini, shift register, couple of 7-segment displays, MOSFET wired up as an audio amplifier:

EAGLE Light (Limitations: 1 schematic sheet, 2 signal layers, 100x80mm routing area)
Modules 1-User
Layout+Schematic+Autorouter 49.--

EAGLE Standard (Limitations: 99 schematic sheets, 6 signal layers, 160x100mm routing area)
Modules 1-User 3-User 5-User 10-User 30-User 50-User
Layout+Schematic+Autorouter 747.-- 1120.50 1494.-- 2241.-- 3361.50 4482.--
Layout+Schematic 498.-- 747.-- 996.-- 1494.-- 2241.-- 2988.--
Layout+Autorouter 498.-- 747.-- 996.-- 1494.-- 2241.-- 2988.--
Layout 249.-- 373.50 498.-- 747.-- 1120.50 1494.--
Schematic 249.-- 373.50 498.-- 747.-- 1120.50 1494.--

EAGLE Professional (Full featured version)
Modules 1-User 3-User 5-User 10-User 30-User 50-User
Layout+Schematic+Autorouter 1494.-- 2241.-- 2988.-- 4482.-- 6723.-- 8964.--
Layout+Schematic 996.-- 1494.-- 1992.-- 2988.-- 4482.-- 5976.--
Layout+Autorouter 996.-- 1494.-- 1992.-- 2988.-- 4482.-- 5976.--
Layout 498.-- 747.-- 996.-- 1494.-- 2241.-- 2988.--
Schematic 498.-- 747.-- 996.-- 1494.-- 2241.-- 2988.--

Hmmmmm.............. Many good reply`s here....

I will try to go more in dept on my plans...

It will be controlled by a joystick connected to my laptop (will send signals on COM1) as RS232.
Will be converted to RS485 (due to length PC-Thingy), in the Thingy it will be RS232 again, here it can be +-12v or +-5v, its not a problem to adjust this to the right level.
So, when this signal is coming in to the Thingy, I need to control several things (mentioned earlier) and send feedback from the servos (positions) and from the motors (RPM and current), the gyro will send XYZ and compass readings back to the PC...

What I want is a "main board" where I can connect a "motor controller card" and a "servo controller card", OR if I can get this on the same card...

As I have mentioned earlier, I am VERY green on this, so I need to see the boards before I order (please put in a link, or specify names on the boards)

Can somebody try to guide me in the right direction please?
I know what I want when I can see it, and read about it.... :blush:

Do a google search for MAX485. It will convert the TTL levels on the Arduino to RS485. You'll have to do tests with the cable you want to do, but if you lower the speed enough you'll be able to go 850' that way. Even if you have to go down to 1200 Baud that's still 12 ten-byte commands a second.

You mentioned you want to send HD. There is no way you are going to be able to send HD over RS485. Just aint gonna happen. You have two options: either two cables, one for HD and one for control, or a different protocol that will allow you to share the cable.

I think you will find that sharing the cable is far cheaper than two cables. If you go the sharing route, by far the simplest way is to run TCP/IP over ethernet. Ethernet and TCP/IP were designed exactly for this purpose and there's no need to reinvent the wheel. At the far end you put an Arduino with an ethernet shield and a Max485. It receives commands over ethernet and translates them to RS485. This would require a trivially simple Arduino sketch.

At your end this allows for a very elegant interface where you have a browser window showing your video with buttons you click on to control your device. Also trivially easy to program.

You can get megabit ethernet speeds over plain phone wire over thousands of feet, it's how DSL works. Google "Cisco LRE" to get started.