tbd.pi
Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Pi restarts with servo attached

Sat Sep 13, 2014 12:48 am

I was following Gaven MacDonalds video (https://www.youtube.com/watch?v=ddlDgUymbxc) on getting a servo running off the pi. I got overambitious because I managed to get an LED or two to blink! I got a cheap Analog Servo with a bundle from Radioshack last night and decide to try it with that. I followed the directions right up to the PWM steps. When I ran it, for the first couple of cycles it seemed to go ok, then all it started to go faster.

I had a larger servo, a Tower Pro SG-5010. I plugged that in. When I ran the program with this, it did the first 7.5 pulse then restarted the pi.

What did I do wrong? Any clues?
Last edited by tbd.pi on Sat Sep 13, 2014 10:21 am, edited 1 time in total.

User avatar
joan
Posts: 14348
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi restarts with servo attached

Sat Sep 13, 2014 8:05 am

Almost certainly you tried to draw more current than could be supplied to the servo and Pi simultaneously. When the Pi doesn't have enough power it will stop.

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: Pi restarts with servo attached

Sat Sep 13, 2014 8:15 am

Try to use a separate power supply for the servo.

Laurens

tbd.pi
Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Re: Pi restarts with servo attached

Sat Sep 13, 2014 10:21 am

Thanks for the replies. Makes sense, drawing too much power.

I have the adafruit kit, with a 5v 2a power supply, how do I power the servo off that? Do I put the blue power connector on to my breadboard and then join the supply to that? (joan, I'm the same person who posted about servos on stackexchange the other day)

After the replies I got back from my SE post the other day, I thought I would try to do all this without the adafruit board first. The adafruit guide for using the PWM driver shows me attaching the power supply to that board then somehow (I still can't follow that wiring diagram and can't find pictures of it done) joining that to the breadboard with the cobbler on it. What I'm ultimately aiming for is driving 3-4 servos off of the pi and reading a motion sensor.

User avatar
joan
Posts: 14348
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi restarts with servo attached

Sat Sep 13, 2014 10:38 am

It's simplest to power your servos separately from the Pi.

You need to connect the servo ground wires (typically black or brown) to the -ve of your power supply, the servo power wires (typically red) to the +ve of the power supply.

You also need to connect the power supply -ve to a Pi ground pin.

The servo control wires (typically white or orange) may be connected direct to a Pi gpios.

https://www.youtube.com/watch?v=5luZQFxfLCo may make that clearer (control wires are connected via a ribbon cable).

tbd.pi
Posts: 34
Joined: Sat Aug 11, 2012 11:21 am
Location: NJ,USA
Contact: Website

Re: Pi restarts with servo attached

Sat Oct 04, 2014 8:17 pm

Just wanted to add a thank-you to this post to Joan. I finally understood what to do with the wiring and now have multiple servos running without using the adafruit board using pigpio which makes that task really simple!

My halloween project is coming along nicely, my daughter is very amused.

User avatar
joan
Posts: 14348
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi restarts with servo attached

Sat Oct 04, 2014 8:51 pm

tbd.pi wrote: ...
My halloween project is coming along nicely, my daughter is very amused.
Spooky ;)

scuffster
Posts: 1
Joined: Thu Apr 10, 2014 6:35 am

Re: Pi restarts with servo attached

Tue Oct 21, 2014 6:16 pm

tbd.pi wrote: My halloween project is coming along nicely, my daughter is very amused.
let us know how the halloween project turns out :)

Return to “Automation, sensing and robotics”