Powering a transistor with single 5V source?

Hi all,

I am planning a project centered around an arduino Uno and a small solenoid that uses 5V DC and draws 1.1A. I am a mechanical guy, so I'm learning as I go about transistors. Most of the reading shows transistors being used as switches for higher power levels than the arduino is made for... and I understand how those are set up when coupled with an external 12VDC source and the 5V arduino rail.

However, if my solenoid runs on 5V, can I just hook up a transistor as a current amplifier instead? Why is it that no one talks about that? I've seen it stated that it is advised NOT to run a transistor on the arduino voltage alone... why?

Thanks

if it is a switch that you want, why not use a relay?

also have you came across this?

bpmirsch:
Most of the reading shows transistors being used as switches for higher power levels than the arduino is made for… and I understand how those are set up when coupled with an external 12VDC source and the 5V arduino rail.

Define power levels :wink:

The main problem is that the Arduino can not sink or source enough current; the outputs of the Arduino will therefore have a very short life if you directly connect a motor or relay.

The second issue (not applicable in your situation) is that the Arduino does not like voltages higher than 5V on its pins.

The solution with a transistor caters for both situations; it allows for more current and it can adapt the voltages (drive 12V from 5V).

I find it advisable to keep the power for the Arduino separated from the power for the motor, even if both are running on 5V. When a motor starts (or a relais is activated), the initial current can be very high and this can cause a dip in the voltage. If both the Arduino and the motor/relay are powered from the same power supply, this dip in voltage might cause the Arduino to reboot.

A 1.1A solenoid draws too much current to be powered directly from the Arduino. It's regulator can only handle an absolute maximum 800mA, and at least 50mA will be used by the board itself, (I forget the exact amount). On top of this, power dissipation of the regulator must be taken into consideration, further limiting the available current.
ie P = V x I , so if 12V is applied to Vin, and 0.5A total is drawn, the power dissipation will be (12-5) x 0.5, which is 3.5W. (Too much.)

If using USB power while connected to a PC, 1.1A is still too much for a USB port.
So you must use an external power supply.

Regarding transistors, rather than a bi-polar transistor, you're better off considering a "logic-level" MOSFET to switch your solenoid while connected to the external 5V power supply. One with a low "Rds on" value preferably, although that's not especially critical for 1.1A.

Or put another way, 90% of problems people have with motors/servos/solenoids is due to inadequate
power or sharing power with the processor. Keep power for motors etc separate from logic supply rails,
otherwise its like an elephant and a brain surgeon sharing the same trampoline! Logic chips need clean
reliable voltage supply, motors bash their supplies around mercilessly...

MarkT:
its like an elephant and a brain surgeon sharing the same trampoline!

Well put. :slight_smile:

Sounds like a Japanese game-show perhaps?

However, if my solenoid runs on 5V, can I just hook up a transistor as a current amplifier instead?

What do you think a current amplifier actually is?
A transistor just controls the flow of electricity it does not amplify anything.

Why is it that no one talks about that?

Because it is not something that makes sense.

I've seen it stated that it is advised NOT to run a transistor on the arduino voltage alone.

You have misunderstood what you have read. As others have pointed out this current needs to come from somewhere, you can not magic it up.

The solution is quite simple.

You have a 12 V supply. OK, measure the resistance of the solenoid. Multiply it by 1.4. Obtain a 10 W resistor of that approximate value and put it in series with your solenoid, connecting it to the 12 V power supply. Put a 1N4004 or better rectifier diode across the resistor and solenoid combination, cathode of the diode to the 12 V supply. Now find a logic level (N-channel) FET with the appropriate ratings (20 V or more, 2 Amps or more) and connect that source to ground, drain to your solenoid-resistor combination.

Feed the gate from your Arduino with a 330 Ohm resistor and put a 47 k resistor from the same Arduino output to ground.

All sorted.

hi all, thanks for the replies! I'm sorry for taking so long to check in again, I kind of forgot I had posted this!

I do have the solenoid firing using a NPN transistor as a switch. the system is working as planned, although I still don't fully understand the 'current amplifier' terminology used in some explanations.

so, if I was going to transition this current breadboard prototype into a consumer electronics device (battery powered), would I still want two separate supplies, or could you get away with having let's say 12V in battery voltage and using some simple voltage regulators to provide separate 7V and 9V (or whatever is deemed the best for my arduino and solenoid)?

What circuit? You haven't posted anything yet.

i'll post some info tonight after work.

simple schematic showing the audio board, solenoid, and arduino… i’m not using any resistors with the NPN transistor, it seems to be working fine? (that’s why I have a long white jumper wire leading to the base of the transistor, because when I had a 330Ohm resistor in series, the solenoid did not work, but with no resistor, it does?)

Yep, the base of that tiny TO-92 needs about 75mA for 1.1A solenoid current.
So no base resistor (~100mA) will work.
Don't know for how long though.
Prepare for the bang and magic smoke.

Use a darlington power transistor for a 1.1Amp solenoid.
Then you can drive the base with a high value pin-current limiting resistor, e.g. 1k.
Leo..

Wawa:
Yep, the base of that tiny TO-92 needs about 75mA for 1.1A solenoid current.
So no base resistor (~100mA) will work.
Don't know for how long though.
Prepair for the bang and magic smoke.

And prepare to buy a new Arduino or ATMega328P. They just love supplying 100mA from an I/O pin.

Use a darlington power transistor for a 1.1Amp solenoid.
Then you can drive the base with a high value pin-current limiting resistor, e.g. 1k.
Leo..

Or a logic-level MOSFET.

now, the datasheet for the solenoid (https://cdn.sparkfun.com/datasheets/Robotics/ZHO-0420S-05A4.5%20SPECIFICATION.pdf) notes 1.1A @ 5V. I am now (after this thread) running the solenoid on more than 5V (~9V) so is the current draw less? sorry if that's a stupid assumption... not sure why the power would stay the same, necessarily. but if it does, it's 1.1A@5V = 0.6A@9V

No if you run it off more voltage you get more current drawn. It's called ohms law.

What he said ^. (About 2A.)

first of all, i want to again say thanks for the input from everyone. this is my embarrassing "plug it all together and see if it works" attempt, but I will take your advice and really look into the components i have sized up. i thought maybe the arduino pins would somehow regulate the current if it was above the 20mA per pin limit (another dumb assumption, obviously)

second of all, i welcome the sarcasm! P = IV is not actually ohm's law, but no one's paying attention to semantics. electronics is not my forte and I'll spare you my educational or professional resume otherwise. :slight_smile:

but i'm learning!

bpmirsch:
second of all, i welcome the sarcasm! P = IV is not actually ohm's law, but no one's paying attention to semantics.

We weren't referring to P = IV. No one mentioned power (edit: except you). We were referring to V = IR, which is ohms law.

V = IR therefore R = V/I and I = V/R.
5V / 1.1A = 4.55Ω (R = V/I)
9V / 4.55Ω = 1.98A (I = V/R)