I am newbie to electronics, let me explain the scenario.
My project contains Arduino with atmega328. Need to control 3 servo individually. I have given outer powersupply for servo power and signal from arduino. Joined ground from outer to arduino.
Now what happens is when i reprogram my arduino all servo tries to go to 0(zero) point. Which is not desirable for my project because all servo has to move in given area only, even in programming stage, for example servo1 should move from angle 110 to 150 only, but it goes to 0 when reprogrammed or restarted or serial communication established.
For this issue i have added 4 NPN transistors and the first one connects from arduino to three other for signal. All transistors has to act like switch. Should switch off servo signal line when board is restarted or programmed.
Now the issue is none of servo moves. when I checked output of transistor it ranges from 2.00 to 3.20 volts. Hence i cannot move forward from this point.
I need your advice in this transistor module. Is this implementation correct or I should try something else. Is my transistors used are correct( current transistor are BC5478). Or there is any software solution for servo moving to 0 problem.
I am attaching images of transistor module.
A circuit diagram of what you have made would be helpful.
I can't see any resistors. You need them between the arduino outputs and the base of the transistor.
The transistor should be wired up as the first diagram here:-
I didn't understand, my transistors are already reducing my 5 volts to 3.5 volts, do i need to again put any resistors? Or can you suggest me npn diode which works on lower voltage. As my rest 3 transistors are not getting proper voltage they are not activating and hence my servos are not moving(according to my checkings of transistors voltage).
As i have written in my previous post, that i am using transistor as a switch which is "on" only when i need to use my servo, else i turn it off. This concept was working with 1 servo, but my project needs 3 servos, so when i attached 3 transistors for the same concept and there it goes down. all three transistors shares voltage and non of them activates.
I am also pasting here my project diagram with use of transistors for 3 servos.
My target is, my servos should not flicker when i reprogram or reset my board. Tell me if i am wrong somewhere.
What is a BC5478? Cannot find a datasheet.
Tell me if i am wrong somewhere.
Sadly, you are sort of wrong everywhere. I think you don’t really know how an NPN transistor works. As mike said… resistors… where are the resistors… they are not optional.
Actually you really could be able to use servo.detach() to Detach the Servo variable from its pin, stopping the sending of signals. That would technically STOP the servo
If you want to use YOUR approach, with switching… this may work. (see drawing) Without ground, the servo won’t run. (while simple, it’s not really good practice though) See if you get what you want though.
If you just want control over the Servo Signal pin… you could use a CD4066 analog switch to make or break the connections to the servo signals.
my transistors are already reducing my 5 volts to 3.5 volts,
No they are not.
I don' know what you mean by this but then you don't either.
Transistors do not reduce voltage.
do i need to again put any resistors?
Yes a resister limits current NOT reduces voltage.
If you want to use YOUR approach, with switching... this may work. (see drawing) Without ground, the servo won't run. (while simple, it's not really good practice though) See if you get what you want though.
Not good practice? It'll burn out the Arduino pins - don't do this, its trying to power the servo's via the ARduino signal lines!
At the very least switch the power on the high side to the servos and use protection resistors inline with the signal lines (4k7 perhaps).
Clarification: I thought it was implied that servo V+ power was coming from an external source... as was shown by bforu_gs' drawing. (not the pins) The servo PWM lines are signal lines... not power sources and will not be significant load on a pin.
I followed your suggestion, and its seems working now, though i need to give individual separate power to each servo, otherwise servos were not moving.
Thanks everyone for help.