2

I'm trying to learn more about making electronics making stuff. Right now I'm just trying to get a servo to move so I can go on to bigger things.

I have a Pi B+ running Rasbian and an HS-311 servo connected to a battery pack with 4 AA's in it. I've installed pi-blaster and as far as I can tell it is running but I can't get any movement out of the servo. Here is a diagram of my wiring. enter image description here

As you can see I've added an LED onto the control wire for the servo to see if anything is happening. If I run echo "17=1" > /dev/pi-blaster the led lights up but the servo doesn't move. Running echo "17=0.5" > /dev/pi-blasterdims the led and echo "17=0" > /dev/pi-blaster will turn it off but nothing I do will get the servo to turn.

I'm not sure at this point if I've wired something wrong or if I'm doing something wrong in code.

Update: Thanks to @joan I had forgot to ground the control circuit with the Pi. I did so and replaced the batteries as they were to weak to control the servo. The servo will now go to a few positions;

  • echo "17=.04" > /dev/pi-blaster gives position of 0
  • echo "17=.24" > /dev/pi-blaster gives position of 190

Values >0.04 <0.24 move the servo in equal increments.
Values <0.04 >0 and >0.24 <1 move the servo to 0 and 190 respectively
A value of 1 or 0 turns the servo off without moving it.
I'm not sure if missing something as I had thought that 0 would move the servo full stop one way and 1 would move it full stop the other way. Is there some defaults I should be setting?

2

You need to connect the grounds.

In this case there is no connection between the Pi ground and the battery and servo grounds.

Connect a wire between the battery ground (or servo ground, which is the same thing) and a Pi ground pin.

This gives a circuit to allow the control signal to flow.

| improve this answer | |
  • Doh, although that makes total sense it didn't make any difference. The LED still lights and the servo doesn't move. – mark Jan 4 '16 at 0:32
  • Oops I needed to update the batteries I was using. – mark Jan 4 '16 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.