What transistor should I use to switch on/off current to servo

I want to turn on & off DC 1000mA current to a servo using a Pro Mini pin (e.g. digitalWrite(transistorPin, HIGH)). I'm wondering what type of transistor is recommended?

I have two different transistors in hand: IRF520 and BC547B (these came with my Arduino starter kit), so it would be great if one of these would work.

Sorry to ask a follow up question before anyone even answered my first question, but I gotta go to bed soon. :sleeping:

So here it is:

What would be a smart/simple way to allow two different amp levels to the same servo without dropping current to zero during the switchover?

For example, at one point, I would like to allow only low amps (e.g. 50mA) to the servo, then at some later time, I want to increase that allowable amp level to 1000mA.

My first thought would be two separate transistors, one passing 50mA to the servo when activated by transistorPin8, and then another one passing 1000mA when activated by transistorPin9 (for example).

The problem with this idea is that there would be a short gap with zero power going to the servo when I digitalWrite(transistorPin8, LOW) and then milliseconds later I digitalWrite(transistorPin9, HIGH). I am trying to avoid this "zero power going to the servo" situation.

Would it be OK, if I left pin8 HIGH while writing pin9 HIGH at the same time (i.e. allowing power to the servo at the same time via two separate transistors), then next step writing pin8 LOW???

In other words, the servo would have access to 50mA, then an additional 1000mA power (for total 1050mA), then after shutting down pin8, it would only have 1000mA.

Or perhaps there is some sort of special multilevel transistor that can shift allowable current from 0 to 50mA then later up to 1000mA depending on some signals I send to it from an Arduino pin?

As you can guess, I'm new at this... :blush:

Zimbu:
What would be a smart/simple way to send/control two different amp levels to the same servo

You don't send amps; devices draw amps.

Devices do work, and power is the rate at which that work happens and so it's the rate at which energy must be supplied. In the case of electrical devices, that power is the product of volts x amps. So for a given voltage, and a requirement to provide a given power (ie the ability to do work at a certain rate) the device draws current of power/volts. You don't impose that current on the device, it draws it: you do of course need to be able to supply enough current to meet its demand.

kenwood120s:
You don't send amps; devices draw amps.

Devices do work, and power is the rate at which that work happens and so it's the rate at which energy must be supplied. In the case of electrical devices, that power is the product of volts x amps. So for a given voltage, and a requirement to provide a given power (ie the ability to do work at a certain rate) the device draws current of power/volts. You don't impose that current on the device, it draws it: you do of course need to be able to supply enough current to meet its demand.

Fixed the wording in my post. Thanks!

Fixed the wording in my post.

You say the servo will "have access" to either 50mA or 1000mA. Let's assume you can somehow limit the current available. What leads you to think it will only want 50mA? A motor draws current appropriate for the rate of work it is asked to do, so what happens if it requires 1000mA at a time you're only providing 50?

kenwood120s:
You say the servo will "have access" to either 50mA or 1000mA. Let's assume you can somehow limit the current available. What leads you to think it will only want 50mA? A motor draws current appropriate for the rate of work it is asked to do, so what happens if it requires 1000mA at a time you're only providing 50?

That's actually the goal. I want to starve the servo of amps (for a short period) so that only the controller circuit in the servo is powered but the servo motor doesn't have enough current to move or it moves weakly.

So far, in my manual testing, this seems to be working as I hoped it would. I just need to figure out how to make it happen with the Arduino sketch and transistor(s) or some other electrical element.

In a device like this you cannot "control" the current, you can only control the voltage. Even if you built a current control circuit, it would control current by changing the voltage.

So questions:

  1. In your experiments what voltage was on the servo under the two conditions you are trying to create?

  2. What is your end goal for each of the two conditions?

  3. What is your servo mfg / model?

Zimbu:
I want to turn on & off DC 1000mA current to a servo using a Pro Mini pin (e.g. digitalWrite(transistorPin, HIGH)). I'm wondering what type of transistor is recommended?

I have two different transistors in hand: IRF520 and BC547B (these came with my Arduino starter kit), so it would be great if one of these would work.

Firstly you might need to address an issue with how you are powering your setup.
Sharing 5V rail between servo and Arduino is not a good idea - spikes and dropouts
may affect the arduino and cause unreliable behaviour (or in worst case damage).

Anyway assuming the servo and Arduino are both powered with 5V adequately, you need a
p-channel logic-level MOSFET to do high-side switching of the power to the servo.

Your IRF520 is not p-channel, its not logic level, and its borderline anyway due to the high
on-resistance of 0.27 ohms. The BC547 is a complete non-starter.

See this explanation of MOSFET switching, but remember you need a free-wheel diode across the
load if it is inductive. mosfet - High side driver and Low side driver - Electrical Engineering Stack Exchange

This thread should probably be read in conjunction with OP's other thread here.

MarkT:
Firstly you might need to address an issue with how you are powering your setup.
Sharing 5V rail between servo and Arduino is not a good idea - spikes and dropouts
may affect the arduino and cause unreliable behaviour (or in worst case damage).

What do I need to add to protect the Arduino (mine is a Pro Mini). Some sort of resistor on the raw pin?

Dear All,

Thanks for your suggestions and help. I have decided to "pause" this for a while and wait to receive some new servos from different manufacturers. I have a feeling that a different manufacturer might not have the same issue (sudden jump at startup) that I am trying to solve with this convoluted transistor approach.

Will receive some new servos on Monday, but if I can't solve the problem that way, I may be back here to continue down this potential solution road.

JohnRob:
...3) What is your servo mfg / model?

To JohnRob: FYI, I am currently using a Kookye DS04-NFC Continuous Rotation Servo. Link

To MarkT: In the meantime, hopefully, you will still be able to tell me how to protect the Arduino from spikes, etc. that you mentioned.