brandoncheah
Posts: 31
Joined: Thu Sep 27, 2018 9:52 am

Connecting Servo Motor and LEDs to Raspberry Pi

Sat Oct 03, 2020 3:08 am

Hi guys, I am connecting a Servo MG995 and 1W White LED to my Raspberry Pi with an external Switching Power Supply Unit 5V/5A.
Also having a MOSFET as a switch controlled by the GPIO.

I want to have the LED and Servo working at the same time but its not working well I think is because insufficient voltage or current?
When both are working at the same time, the LED lights up brightly but the Servo couldn't work, looks like its struggling for power.
But when i remove the LED, the servo works well.

The operating voltage for servo is 4.8V - 7.2V.
I measured the current passing through the LED is about 0.35A and servo 0.2A~

I am not sure about electronics stuffs, I mean should I purchase a 12V power supply? But will that overkill the 1W LED and servo motor?
The switching power supply unit i can only have 5V/12V/24V though...but I can purchase higher Ampere supply like 5V - 10A/20A

Also I would like to add another servo, any advice on what kind of power supply values I should get?

circuit.PNG
circuit.PNG (38.03 KiB) Viewed 246 times

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

Re: Connecting Servo Motor and LEDs to Raspberry Pi

Sat Oct 03, 2020 8:18 am

5 amps is plenty to power the servo, LED, and Pi.

What's the point of the MOSFET? Is that meant to be switching the power supply to the servo/LED on/off?

Photos may help.

brandoncheah
Posts: 31
Joined: Thu Sep 27, 2018 9:52 am

Re: Connecting Servo Motor and LEDs to Raspberry Pi

Mon Oct 05, 2020 2:26 am

yes I added MOSFET acting as a switch to turn on/off the servo and LED.

Please see the image for my setup here: https://ibb.co/F5Rxf8d

Even 5A is sufficient, but I don't know why it is not able to power my servo when the LED is used together in the circuit.

pidd
Posts: 1639
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Connecting Servo Motor and LEDs to Raspberry Pi

Mon Oct 05, 2020 2:48 am

Is it a 5V LED? ie is it current limited or should you have a resistor in series with it.

Switching the negative rail is not as good idea when you are passing signals, the servo expects its -ve to be at the same voltage as the -ve on the Pi but you have a mosfet in between - admittedly the voltage drop across the mosfet should probably not cause a problem ... but it could because the 3.3V might not be enough to drive the 5V servo - it all depends on the specs.

brandoncheah
Posts: 31
Joined: Thu Sep 27, 2018 9:52 am

Re: Connecting Servo Motor and LEDs to Raspberry Pi

Mon Oct 05, 2020 3:07 am

LED specs:
Voltage: 3.2-3.4V
Current: 350MA
Wavelength: 100-110LM
Switching the negative rail is not as good idea when you are passing signals, the servo expects its -ve to be at the same voltage as the -ve on the Pi but you have a mosfet in between - admittedly the voltage drop across the mosfet should probably not cause a problem ... but it could because the 3.3V might not be enough to drive the 5V servo - it all depends on the specs.
However when i remove the LED, the servo works fine...possible to advice me how should I proceed on getting the servo work together with the LED?

pidd
Posts: 1639
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Connecting Servo Motor and LEDs to Raspberry Pi

Mon Oct 05, 2020 4:54 am

brandoncheah wrote:
Mon Oct 05, 2020 3:07 am
LED specs:
Voltage: 3.2-3.4V
Current: 350MA
Wavelength: 100-110LM
Switching the negative rail is not as good idea when you are passing signals, the servo expects its -ve to be at the same voltage as the -ve on the Pi but you have a mosfet in between - admittedly the voltage drop across the mosfet should probably not cause a problem ... but it could because the 3.3V might not be enough to drive the 5V servo - it all depends on the specs.
However when i remove the LED, the servo works fine...possible to advice me how should I proceed on getting the servo work together with the LED?
Well there might be your problem, the LED needs a limiting resistor, it hasn't got one so is drawing too much current, luckily the power supply is probably dropping its voltage before the LED turns into a firework. You need a resistor of about 6 ohms in series with the LED, it can be higher but not lower.

brandoncheah
Posts: 31
Joined: Thu Sep 27, 2018 9:52 am

Re: Connecting Servo Motor and LEDs to Raspberry Pi

Mon Oct 05, 2020 9:08 am

Well there might be your problem, the LED needs a limiting resistor, it hasn't got one so is drawing too much current, luckily the power supply is probably dropping its voltage before the LED turns into a firework. You need a resistor of about 6 ohms in series with the LED, it can be higher but not lower.

I've put a 15ohm resistor (don't have 6ohms..) in series with the LED, but the result is still the same.
The servo still not functioning as usual, like is it lacking power.

Return to “Beginners”