Let's Make Robots!

Driving servos from GPIO

The next challenge is to drive a servo from the RouterStation board.  This servo will eventually turn the box around a pole.

I understand that there are lots of serial and usb servo control options for servos. But I also understand that one can use a GPIO pin to directly signal a single servo, which is all I need.  Save some dollars :)

Looks like I can use the linux kernal module gpio-pwm through OpenWRT.  From the looks of things it does what's needed, use the CPU's timer to generate PWM output on GPIO pins.  Any comments about that would be much appreciated. I suppose the thing needed is to generate the appropriate width signals to move the servo based on signal strength indication and then figure out the gearing so that the servo positions accord to positions in the rotation around the pole.

As for power and ground, here's the spec on the pins available on the board.  There are multiple gnds available, either through the UART, JTAG or USB pins (ideally I'd like to save the USB for eventual addition of 3G wireless modem). Power is more of a problem.  Looks like we have 3.3v from the UART or JTAG pins or 5VDC from the USB (checked with a multimeter).  Is it wrong to think about using these voltage sources? Can they put out the needed amps?  I was thinking of something like the Hitec 311 seems like it doesnt draw more than 200mA. Would it screw with regular USB if the servo was also driven off the 5VDC?

Should I be thinking about pulling 12-18VDC off the PoE before it enters the device and stepping it down somehow? Conversely is it possible to step the 3.3VDC up to the 4.8 that the servo needs, to avoid messing with the USB?

Comment viewing options

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

Since you don't have specs on how much current the board will supply on any of it's outputs, it is hard to say. 200mA doesn't sound like a lot, but if your board isn't designed for it than it can be damaged.

It looks like your board uses passive Power over Ethernet (PoE), which is different from active PoE. Read more about it here:


That site also has cabling needed to inject power into the Ethernet port. As such, you can supply whatever voltage and current you need (up to 50V), as long as the Ethernet cable wires can handle it.

Are you going to use the Ethernet cable for signaling as well? Servo power is usually very electrically noisy. If you are running your servo power from the PoE, and also trying to use the Ethernet cable for data, I wouldn't be shocked if you had some errors in your data.

Another approach would be to build a small DC power regulator. Se the OddBot's post, Once you've decided on batteries, how do you regulate the voltage? Just be sure to join the ground from your regulator to the ground of your board.

Thanks.  That makes a lot of sense.  I was wondering about the electrical noise issues.  One complication is that the whole thing is spinning, so I have to decide between some cable-wrap logic (ie unwind after three full rotations) and a pass-through power technique capable of rotation (like the 3.5mm plugs suggested on this site, or a brush motor).  I'm sure that any rotating connection will create electrical noise. (I'm not planning to use the PoE for data as well, but it's good to know about that as an issue; a fully rotating ethernet connection would be at least 6 separate wires, very expensive, better to just go wireless!)

In any case I decided to go with a stepper motor and I'm using the stepper motor controller from Pololu that has voltage regulators on-board, so that's definitely going to help.  I'll split the power from the PoE and feed it to the stepper controller before the RouterStation, so any noise from the motor shouldn't effect the RouterStation.

that you should pull the power you need from PoE. I would think that the Hitec servo you mentioned would still get power hungry if it stalled and that, I would guess, would easily overwhelm the power abilities of USB. The 3.3V line probably doesn't supply much current either. I believe that the current trend to drop voltage is an attempt to save power overall, which includes dropping the amperage that is supplied to the chips as well.

The above is just my penny's worth. I don't even think it is worth 2 cents. :)