I have been having an issue with my project. I am trying to make something simple, that allows me to turn the servo a small amount in one direction when the potentiometer is turned to that side, and turn it the other way, when the potentiometer is on the other side. It was working before, only occasionally, like right now, it just doesn't move and just buzzes.
I've researched it a bit and no, it is not an inadequate power source, I am using the power from my macbook pro via a USB 2.0 cable. In the future I would plan to power it with something like on of these:
I have been using Tinkercad's circuit simulation to simulate it, and with the exact same circuitry as in this design, it has not been working:
You should make a direct connection from the PSU to the servo, so that the current does not flow though the Arduino board at all.
What voltage does your servo require? It looks like you are (trying to) run it at 5V at the moment. If 5V is sufficient (provided current is also sufficient) then get an external 5V PSU. This can then power the servo and the Arduino (through the Arduino's 5V pin).
The Arduino is not suitable for converting 9V to 5V for anything but itself, so you'll need a 5V supply for the servo regardless. Just use that to power the whole project. Connect the ps ground to the Arduino ground and the servo ground, connect the ps +5 to the Arduino + 5 and the servo +5, and the signal from the Arduino to the servo. Connect the LED and the pot as you had done previously.
C
It needs 7 - 12V at the Vin and power jack inputs for the onboard 5V regulator to work properly. Unfortunately the on board 5V regulator is not heat sinked so will handle limited current before it overheats and shuts down. If one wishes to power anything more than a few LEDs one should power the Arduino through the 5V pin with a power supply that outputs a well regulated 5V and enough current capability to power the Arduino and all peripherals that connect to the 5V. The external power supply bypasses the weak 5V regulator.
Although I agree with @groundfungus that you should power the Arduino via the 5V pin, bypassing the regulator, I understand your comment given that Arduino.cc still has this advice on their website:
* Vin. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
* 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
I can think of no damage mechanism, but it's their advice, so be aware. Thing is, on this forum, we constantly advise people to power their Arduino via the 5V pin, and no one has, as far as I know, come to grief.
C
An alternative is to provide 7-12 via the barrel jack just for the Arduino, and power the rest with an external 5V source. If you do this, make sure you tie the ground of the external supply to the ground of the Uno.
C
So could I power this all via an AC to DC power converter like this one:
And then just strip a section of the cable and connect the ground and power to the servo? Or would I need one with a higher current to power both the board and the servo?
Also on several sites it says that the servo needs much less than 1A to work, but for some reason when connected to the 5V which supposedly has a 0.8A max.
Edit: Nevermind. I realised that the USB cable method of powering can only have a current of 550mA.
Also on several sites it says that the servo needs much less than 1A to work
What confuses many with servos is that there are many different current ratings for servos. Read on, for a brief summary. You need to find the spec for your particular servo, as the available devices are all over the map.
Specifications of interest from that page:
Running current (at no load): 400±30mA (4.8V ) 500±30mA(6V)
Stall current (at locked): 1300±40mA (4.8V ) 1600±50mA(6v)
Idle current (at stopped): 6±1mA (4.8V ) 6±1mA(6v)
Commentary:
Idle current - when your servo reaches the end of travel by achieving it's setpoint, you will then draw the 'idle' current. It's more or less irrelevant, as other worst-case numbers are much larger.
Operating current - usually, stated operating current is "no load" - literally, with no plastic horns even, but certainly with no coupling to any mechanical/physical process. That's the 450 mA (ish) above, once the servo is moving at the "Operating speed"; any resistance to movement increases this value.
Stall current - if your servo perchance doesn't achieve it's setpoint, then you've got a servo in 'stall' until the next time you move it.
Starting current (not listed) - When a servo starts moving, the current surge is very large; it's the same as stall, because it hasn't overcome inertia and friction to start the move. Starting current decays away as the device starts moving; but, if you try to move too slowly, for example in 1 degree steps with too much delay between steps(see the 'sweep' example in the Arduino IDE, change it's delays to 100 or more ms per step), you can actually have that starting surge repeatedly during a move, as the servo 'jitters' from A to B. So, 1350 mA more or less for this servo to start from rest.
So you need to find the specification for your particular servo.