Hey guys, it's been a few years since i've used a servo with the arduino. I know i should use a transistor to power it, but i can't recall how to wire it. I've tried doing a few searches, but didn't find anything useful.
Lets say i want to use pin 4 on the arduino, i know pin 4 is the signal but should i also use that pin as the base of the npn transistor? If i used the constant 5v pin at the base, would it have to dissipate all of the power when the servo is not on?
A servo has three connections power, ground and signal. Connect power to +5V, ground to arduino ground and signal directly to the arduino.
You might want to power this from an external power supply rather than directly from the arduino.
You don't use a transistor to operate a standard R/C servo from an arduino. You just wire an arduino output pin to the servo's control wire, a ground wire from the servo ground to an arduino ground pin. Then you need to supply a +5 vdc voltage source to the servo's power wire. If it is a small enough servo and you don't have a large mechanical load applied to the servo you MIGHT be able to power the servo from the arduino 5V pin, but as current is somewhat limited at that pin the usual recommendation is to use an independent +5vdc power supply to the servo power wire, and the ground of this external supply has to wire to a arduino ground pin.
I think there has been a misunderstanding. I am fully aware there are three pins, +5v, signal and gnd. What i am asking is do i use the same signal wire, which for this hypothetical question is pin 4, at the base of the npn transistor? The servo will have a decent load, so i am sure that i need a transistor.
ThatGuy007:
I think there has been a misunderstanding. I am fully aware there are three pins, +5v, signal and gnd. What i am asking is do i use the same signal wire, which for this hypothetical question is pin 4, at the base of the npn transistor? The servo will have a decent load, so i am sure that i need a transistor.
Your are incorrect, the servo control input pin is just a logic signal input that draws almost no current. The working current comes from the +5vdc power wire of the servo.
Okay, allow me to try again. An npn has a collector, base and emitter. A servo has a signal, +5v and gnd. I want to use pin 4 on my arduino to drive the servo. With no load i can attach pin 4 to the signal, the arduino's +5v to the servos +5v and have them share a common ground. But since the servo will have a load, and i dont want to draw all of the current from the arduino itself, can i use that same singal wire, pin 4, running in parallel to the base of the npn and the servo while the collector is connected straight to the battery and the emitter connected straight to the +5v of the servo.
So common ground, collector connected to battery, emitter connected to servo +5v, and pin 4 connected to both the base and the signal of the servo. Will that work?
Zoomkat, that is basically what im asking, but my battery is 11.1v so i need to step it down, and i wanted to use a transistor to do that. I know it would step down to like 4.3v with the drop across Vbe, but i am not sure on how to correctly set up the transistor.
ThatGuy007:
Zoomkat, that is basically what im asking, but my battery is 11.1v so i need to step it down, and i wanted to use a transistor to do that. I know it would step down to like 4.3v with the drop across Vbe, but i am not sure on how to correctly set up the transistor.
To step down a 11.1 voltage source to 5 volt requires a voltage regulator chip. You can't do that with simply a single transistor.
Why wouldn't it function? With the collector at 11v and the base at 5v, the emitter should put out approximately 4.3v. I would think the servo would be seen as a variable resistance, depending on how much current it draws, making the circuit as a whole a common emitter with emitter degeneration amplifier. Upon doing more research i've found that it would be dissipating a lot of heat, depending on current draw. What exactly is the flaw with function here?
ThatGuy007:
Why wouldn't it function? With the collector at 11v and the base at 5v, the emitter should put out approximately 4.3v. I would think the servo would be seen as a variable resistance, depending on how much current it draws, making the circuit as a whole a common emitter with emitter degeneration amplifier. Upon doing more research i've found that it would be dissipating a lot of heat, depending on current draw. What exactly is the flaw with function here?
Draw and post a schematic of what you are proposing so we may better understand.
I just drew this up in paint, but it illustrates what i am thinking. Upon more research i think a regulator will be the way to go, but im curious why this wouldn't function. I think at low current draw it would work perfectly, but at high current draw it would dissipate too much power.
ThatGuy007:
I just drew this up in paint, but it illustrates what i am thinking. Upon more research i think a regulator will be the way to go, but im curious why this wouldn't function. I think at low current draw it would work perfectly, but at high current draw it would dissipate too much power.
And what happens to the servo power when the signal from the arduino on pin 4 goes to 0 volts? The signal is a PWM signal at a 50 Hz switching rate and is High only for a variable 1000 to 2000 microseconds every 20 milliseconds, and it is a continuous signal. I can't see this possibly working.
Awesome, you guys answered my question perfectly. I didn't have the intention of using pwm but i hadn't thought about when the signal goes low. I will be looking into switching regulators then.
It's somewhat strange though, i vividly remember using a darlington transistor on a servo to provide enough current a few years ago at the advice of my professor. Any ideas how it could have been implemented?