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.

Step 1: Things you may need...

Some things you will need to build this.
1. Arduino board (you choose)
2. two (or one) servos
3. jumper wires
4. Visual Studio 2008 Express -- link (optional)
5. Arduino IDE -- link

Sorry Linux and Apple fans, my program only runs on windows for now, but you can still manually send serial commands to the arduino without changing the code.
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.
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)?
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).<br><br>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)<br>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)<br>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 :/
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 &quot;<em> #include</em> &quot; instead of &quot; <em>#include &lt;Servo.h&gt;</em> &quot; (without quotes), but this should be added only if you copy the code from the page, if you download the file attached &quot;radio_protocol_fix.pde&quot;, it should compile just fine. Just thought to point it out for someone else doing copy/paste from the code. :) Janux
10: error: #include expects &quot;FILENAME&quot; 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
the error code is &quot;10: error: #include expects &quot;FILENAME&quot; or In function 'void setup()': At global scope: Bad error line: -3 &quot;
the code do not work with the arduino software :(
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

About This Instructable


27 favorites


More by mattie95: Arduino based serial servo controller
Add instructable to: