Instructables

Arduino based serial servo controller

Picture of Arduino based serial servo controller
rcsrvdemo.JPG
This is a simple serial controller for multiple servos based on the Arduino. (my first instructable too :) )

Most of the work in this came from getting the software to talk with the arduino and making a protocol for the data to be passed over. As for the hardware aspect all that I used was two servos (Parallax standard servo here.) A Sparkfun Arduino ProtoShield and an Arduino Duemilanove with ATMEGA328, but most of these parts can be substituted with similar items.

I thought up this project as part of a RC system, but setting up the communication took a lot of time. If anyone has any improvements, ideas, or bugs please feel free to comment.
EDIT: I wrote this awhile ago, just got to publishing it recently.
 
Remove these adsRemove these ads by Signing Up
aroc1 year ago
How do you control 2 different servos with the same serial port? I've been tryig to do that but i can't make it work....
Much as I detest mono and .net, It would have been nice to see your mswindows source code to see if it could be ported to either linux or osx.
demonxkid3 years ago
quick question i have 2 servos controlled by a serial write and read system. do i have to have the arduino plugged into a computer or can i use an external power source(9v with barrel jack slot)?
mattie95 (author)  demonxkid3 years ago
Well, for the serial write and read to work, you'll need the USB connection (or another device to forward the serial data, be it bluetooth, Xbee, etc.)... so yes, it'll need to be connected to the computer somehow (if that's what you're doing).

However, as far as power is concerned.. it'll work as long as the servos aren't too big for the 5v regulator on the Arduino (although, even then it's not a bad idea to use a larger regulator separate from the Arduino's to run just the servos, I've seen some odd things happen when the servos get to be too much for the Arduino's power supply, but not enough to actually shut it down)
If it does need a larger regulator, you can use something like a LM317 regulator to supply power to the servos (or another regulator, I just happen to like the 317)
Thanks, Matt
Thanks it is not a power problem im just tryimg to end the dependance on my laptop but I guess it will take comeplete reprogramming :/
Janux3 years ago
Hi there :) First, thanks!, for posting this mattie95, and regarding the issue that Dannne11 has (or had) to compile the code is because the first line of the code posted in the page says only " #include " instead of " #include <Servo.h> " (without quotes), but this should be added only if you copy the code from the page, if you download the file attached "radio_protocol_fix.pde", it should compile just fine. Just thought to point it out for someone else doing copy/paste from the code. :) Janux
Dannne114 years ago
10: error: #include expects "FILENAME" or In function 'void setup()': At global scope: In function 'void setup()': Bad error line: -5 This is the code. posted the wrong code first srry
Dannne114 years ago
the error code is "10: error: #include expects "FILENAME" or In function 'void setup()': At global scope: Bad error line: -3 "
Dannne114 years ago
the code do not work with the arduino software :(
mattie95 (author)  Dannne114 years ago
what's the error? I'm away from home so I can't test it out, but it definitely compiles fine in arduino 18.. Sorry for the trouble, Matt
(removed by author or community request)
dont you mean instructable?
mattie95 (author)  DELETED_evilfrogie4 years ago
Would you mean something like: "Serial.println("Hi Arduino Here!");"
right after the Serial.begin(38400)?
When the port is opened it will usually reset the arduino so it should work when the port is first selected.
I will update the current file here to support this.
--matt
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!