Let's Make Robots!

Interfacing a PICAXE with an RC Servo

test code 1.048 bytes
test code 2.0330 bytes

Update 26/04/2009

I have added a video to show the picaxe modifying the servo signal based on the output from a Maxbotix EZ0 (EZ1 version here at LMR). The following image is also from that setup. The new code is attached (test code 2.0).



A small, cheap and light-weight PICAX-08M can be used to interface/interfere with the signals sent from an RC receiver to a Servo, allowing for all sorts of autopilot-style projects with your existing RC toys/new projects.

The fiddly-bits

I have been wanting to play around with some sort of flying and semi-autonomous robot for quite a while. The only problem for me has been the weight of the microcontroller(s) and sensor(s) to facilitate this on a reasonably small flying platform (small RC Helicopter etc).

I had used PICAXE-08M's in previous projects, and loved the simplicity (and the lack of weight) of their packaging (8-pin DIL). The thing that worried me was the processing speed/accuracy of the chip in an environment as physically "harsh" as an RC Helicopter being flown by yours-truly :)

So, a test was in order. I cobbled together the following circuit on a piece of vero-board (see main pic), downloaded a simple program (attached at top) to the 08M, fired up my RC Helicopter and... 

 Circuit diagram for PICAXE and RC Servo

...it worked!!!

The 08M was perfectly capable of reading the servo-control pulses, and repeating them. It did this in a completely transparent way, with no change to the handling of the helicopter (see video). As an added bonus, the Servos on my particular helicopter (LAMA V4) require a 5 volt supply, hence the simplicity of the above circuit because I can directly connect the 08M inline.

Now, it is up to you. Turn this into something really interesting (RC autopilot...).

If you are interested, there is a bit more information on this and some of my other projects over at my blog.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Could you make an I2C slave device which, when queried, would return the position of the control stick on the transmitter?

Could you make an device which would be an I2C interface to a servo?

This would be the start of something pretty cool. A bunch of I2C devices hanging off a bus controlled by an I2C master...

 Sounds like the open servo project:


I haven't played with i2c, but I am sure it would be easy to do. The picaxe I used doesn't support it, but the 18X does, I think. It would be easy to encode the pulse size from the servo, and transmit it via i2c. If sending/recieving is as easy with i2c as it is with rs232/485 (which I have played with), it should be doable in a small number lines of code. It would be very cool to connect servos to controllers using i2c! I will look into the i2c when I get a bigger picaxe chip, soon.

cool! might be a good way to make a fail saif for rc stuff?
I just bought one of these: http://www.maxbotix.com/downloads.html#Order_EZ0 - the Maxbotix EZ0 sonar range-finder. I will be posting a proper robot post, and a sensor info post, when this gets hooked up and working on the helicopter, as it looks to be a phenomenally awesome sonar range-finder.
I made a PCB layout that should hold a Picaxe 08, connector from receiver and to servo and a connector for an analogue distance sensor. Dont know how to put it up but if somebody wants it just ask.
Sounds cool, see if you can convert it to jpg or pdf and post it. Your program might do that for you.


I'm new to this so hope this works!

Looks good, have you tried it out yet? What kind of robot is it for?
not yet, i dont have the materials to make the PCB so i need to find some way to get it fabricated. It isnt for a robot, it,s for my rc car, I need some security because it keeps crashing...