Servo and LED controlled by an Arduino

I am trying to use an Arduino UNO to control a servo that spins 90deg and then back to the home position of 0deg based on the position of a switch as well as a seperate button that turns on 3x LEDs when it is depressed.

From what I have researched it would be optimal to use 2x different power supplies based on the needs of the components. One to power the Arduino and the other to power the servo and LEDs.

The design of the circuit is what I am having trouble with. Are there any good tutorials for this type of design or anyone that would be able to assist with the circuit diagram?

Arduino UNO Rev3
Hobby tech YM-2765
LED - Link

Do you want to use batteries or power supplies you need to plug into the AC mains?

Using batteries, from what I understand a 9v battery will be fine for the servo and LED’s but ill need another 5v for the arduino.

No it will not, the servo needs 4.8 to 7.2V @ 1.2A.
The Arduino will run from a good 9V battery for a few hours.
You can also run the Arduino from a 5V power bank and power the LEDs from the output pins, if you limit the curren to 20mA with a 91 ohm resistor

4AA batteries would be good for the servo

1 Like

Apologies I am very new to using Arduino and am not sure how it figures into calculating the resistors. If I wanted to run the Arduino using a 9V battery and power the 3x LEDs from the output pins it would be a 330 ohm resistor?

4AA batteries would be fine for the servo.

First, you connect the 9V to the Vin pin or the barrel jack on the UNO
The output pin voltages for an UNO is always 5V.
The forward voltage for your LED is 3.2V. For a current of 20mA: R = (5-3.2)/20mA = 90 ohms
100 ohms would also work

1 Like

Ahh, didn’t realise the output would be 5V but that makes sense. 91 / 100 ohm resistor will work.

Do you have any recommendations for any resources to help with designing/making the circuit with the Arduino?

You can do a google search for Arduino servo and Arduino LED, you'll get hundreds of hits.
Basically there is no real circuit design involved, except for putting the LED in series with a resistor.
Just make the grounds (GND) of all devices and power sources used are connected together.

@getrecht
Maybe you should start here:

One more tip: connect the 4 AA batterirs directly to the servo black and red wires, do not use a breadboard

1 Like

The LEDs I feel comfortable with but it was more the servo I had less experience with. I think looking through the basics would be best, thanks for the assistance.

In case you didn't notice my last comment:
One more tip: connect the 4 AA batterirs directly to the servo black(-) and red(+) wires, do not use a breadboard for those connections

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.