Let's Make Robots!

How do I control 18 digital servos with a 28x1?

How do I control 18 digital servos with a Picaxe 28x1?

I have the microcontroller board with the 28x1 mounted and I've tried building the "start here" robo. 

 I now would like to know how to be able to control 18 digital servos since I am building a Hexapod :)

All I really need to know is what extensionboard I need.

Thanks in advance :) Please let me know if you need more info.

Comment viewing options

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

Don't get me wrong, for  BASIC stuff Picaxe is great! To this day the 14M is my favorite for simple applications,

For more than 8 servos, why waste time with the picaxe when an Arduino Mega or a Dagu Spider is capable of up to 48 servo's




 This is my plan so far :) All I need to figure out is 

  • RX/TX Unit 
  • Battery

wow, that really IS simple :P

Thanks for the help. I consider my question answered. I will return if I have troubles ;)

The sd20 is actually simple as shit. It is basic i2c and there are really only 2 commands. The 28x will run it fine. Consult the manual about hooking up to i2c lines... they need a 4k7 resistor on each line going to + (pull-up). The 2 lines are clock and data and you don't need to know what that means, just be sure the D on the pic is going to the D on the servo driver and the C --etc.etc. You can build a circuit for the SD20 based on it's data sheet, it is really just pwr, a resonator (included), one pull-up resistor and that's it.


Put this at the top of your code:

I2CSLAVE $C2, i2cslow, i2cbyte

This just says to the servo driver that "hey,I'm talking to you" --Don't worry about what this means, just cut and paste it

To move a servo:

writei2c x,(y)

x is the number of the servo and y is the posistion you want it in. That's it. Instead of using the servo command, you will use this command. The posistion numbers are the same a with the servo command... 150 is centered, 1 is all he way one way and 255 is the other end. If you send number 0, it will turn the servo off. That's it.

 Do u guys know how to hook up sd20 to pic28x1 projectboard?

i hooked it up the way it shown on the manual....then i wrote this:


i2cslave $C2,i2cfast,i2cbyte     

writei2c 1,(1)


wait 1

writei2c 1,(254)


wait 1

but its just not working at all..


Well that is certainly another option for controlling more servos, however I do not know how to use i2c. I am aware of its excistence but that is it.

Lets say I do use the SD20, will I be able to controll it with a 28x ? 

Edit: I plan on making the hexapod controllable through some gamepad, so I will need room for this too.

You know that picaxe has a board that will run 20+ servos and has a space for a 18x. You can also use this board as a stand-alone i2c device with whatever picaxe chip you want (as long as it has an i2c out). I am using (2) SD20 chips from acroname. This is a simple chip with next to no extra components and will control up to 20 servos. It costs about 20 bucks.



The protoboard you are refering to is this?  http://www.robotshop.ca/picaxe-28x-40x-proto-board-2.html

I was going for a design with minimal usage of external controllers and I think the 28x would do for the control for 16 digital servos, but if I later would want to attach a remote I am not sure anymore.


Thanks so far :)

Yep, that's the bunny I'm talking about. Just keep in mind if you use all 16 outputs for servos, you have no other outputs for anything else (lights, speaker, etc.) Some sensors (like the SRF05 ultrasound) need an output to operate.

If you are buying, the cost of a 40x is not much more than a 28x.

Ooh, wow that was just the basics I needed thanks mate :) I think I will go for the 40x2 to save physical space