Voltage "Switch"

Hey guys, I have a project I am making where I need to both power an LED that operates with a 9V supply and an Arduino with the same 9V. However, I need the LED to turn on when a port on the Arduino sends an output as "HIGH". How can I go about wiring this, and what do I need to make this work?

Constraints: The solution needs to be as compact as humanly possible, so the fewer items, the better!

Diagram-ish

Control an NPN transistor or N channel logic level MOSFET low side switch with an Arduino output (pin) to control the power to the LED if the LED will tolerate low side switching. Connect the 9V to the power jack or Vin. You will need one or two resisors with the transistor. Current limit for the LED depends on the LED. Choice of transistor depends on the current requirement of the LED. So, I guess we need to know more about the LED. You failed to state the Arduino model that you are using. That could affect the choices, too.

Ahh yes, my apologies. The forward current on the LED is ~1000 mA, and the controller I am using is a Pro Mini 3.3V

http://www.pighixxx.com/test/portfolio-items/cluster-led/?portfolioID=610

Thank you for your suggestion on the Transistor. I have a PN2222 rated for 1000 mA that I used, and here is how I wired it up (two 10K resistors in series for 20K).

Transistor diagram

However, I still cannot get the LED to light (it does work with the 9V directly). What am I missing?

Transistor wiring

Hi,
OPs Images


I think you have the PN2222 the wrong way around.

20K as the base resistor may be to high, try 10K or even 4k7.
The reference you looked at uses 2K2.

(A prime example for using 2K2 terminology over 2.2K, difficut to see the dp.)

What are you using as your 9V supply?

Tom... :slight_smile:
(2K2 terminology was bought in in case the dp disappeared in multiple photocopies.)

Oh my.... That's quite embarrassing. Switched it around and changed resistors, but now I'm having a power issue to the LED. It's now barely visible. Tried it again with no resistor at all, and same issue.

Hi
If we do the maths.

PN2222 .. DC Gain == beta of 100 minimum.

beta = Ic/Ib

Ib = Ic/beta

Ic = LED current at collector = 1000mA

Ib = 1000mA/100 = 10mA base current.

3.3V from the arduino, 0.7 base-emitter volt drop.

voltage across base resistor = 3.3 - 0.7 = 2.6V

V = I x R

Voltage across base resistor = base current x base resistor

base resistor = Voltage across base resistor / base current = 2.6V / 0.01A = 260R

So 270R or 220R would be more suitable to get the transistor to saturate and pass full collector current.

Tom... :slight_smile:

Hi,
That LED needs some current limit resistor as well, it is not a 9V LED.

Do you have a spec/data sheet on it, or where did you get it.

Do you have a DMM?

Tom.. :slight_smile:

Hi,

  • Drive Voltage:9-12V;Chip Power:10W;Cool White.Color Tempreture:6000-6300K
  • Forward Current(IF):900-1050mA ;Lumen:700-850lm;Size:29 x 20mm/1.1 x 0.8 Inch(L*W)

It should be okay with out a limit resistor on 9V

Does the LED light up correctly directy to the 9V supply?
What is the 9V supply?

Don't connect the output of the Arduino directy to the transistor base.

Check your connections, protoboard does not like high continuous currents through it

Tom... :slight_smile:

Yes it does when connected straight to the 9V, and quite brightly as well at the full 815 lumens (measured). However, with a 2K resistor from my pin 11 on the Transistor base, I get at best 0.5 lumens in a dark room, and 5 lumens with a 200 resistor

Thank you guys a lot for helping by the way, I appreciate your advice

AceofWWII:
Constraints: The solution needs to be as compact as humanly possible, so the fewer items, the better!

Then don't use an Arduino, not even the still bulky Pro Mini, but an ATtiny25/45/85 or other 8-pin AVR, preferably in VSSOP package. All you have to add is a regulator (SOT23-5 SMD package is tiny), filter cap (can come in tiny package - like the 0604 SMD) and indeed a MOSFET for switching (get one in SOT-23 package) and a resistor to protect your pin (can also be 0604 size).

Making it like this will make your LED look big.

Hi,
Please post your code?

Do you have a DMM?
What is your 9V supply?

Thanks.. Tom... :slight_smile:

Of course, it's just that you said "as small as humanly possible" and apparently left out some essential information on the project as a whole, such as what else is to be connected to the Arduino.

TomGeorge:
Hi
If we do the maths.

PN2222 .. DC Gain == beta of 100 minimum.

beta = Ic/Ib

Ib = Ic/beta

Ic = LED current at collector = 1000mA

Ib = 1000mA/100 = 10mA base current.

3.3V from the arduino, 0.7 base-emitter volt drop.

voltage across base resistor = 3.3 - 0.7 = 2.6V

V = I x R

Voltage across base resistor = base current x base resistor

base resistor = Voltage across base resistor / base current = 2.6V / 0.01A = 260R

So 270R or 220R would be more suitable to get the transistor to saturate and pass full collector current.

Tom... :slight_smile:

Guys, a 2222 will not be comfortable with a 1A collector current. End of story. And a DC gain of 100 applies only if the Vce is well above saturation. At saturation you'd be looking at more like Beta is 10 to 20 at best.
My advice is a FET, something with a Vgt (gate threshold voltage) around 2V and has its RdsON performance at less than 5V actually declared in the data sheet as FDD8447 does. When fets warm up the on resistance of the channel can double if it gets really warm so make an allowance for that as well.
If you are not looking to switch this load at any kind of frequency then any fet with the right on resistance specified in the data sheet with a 4.5V drive (assuming a 5V arduino?) could be fine without heatsink and without even getting warm itself.
A BJT as you were trying to use will drop a greater voltage than a MOSFET and either require a higher base current than you can provide or to be a darlington circuit arrangement with potentially slightly higher saturation voltage and definitely will not be a super fast switch and will likely require some heatsinking or at least surroundings that will tolerate some warmth.
Look at FDD8447 as a good example of what will do the trick if you have the drive voltage (5V) to use it.

PE

My apologies Marle, I did not intend to come across aggressive.

Thank you for your response PE. I don't believe heat should be a concern for this project, as it is just going to be turned on for short periods of time (1min or so) a couple of times per day. As far as the drive voltage, I should have plenty for the drive voltage (9V), and my gate voltage is going to be at 3.3V with a 3.3V Arduino. As you can tell, I have never used a FET before so I thank you for clearing up that. You said that the FDD8447 would work well assuming I had a 5V Arduino, and the minimum gate voltage would be at 2V. I'm assuming this would also work fine with a 3.3V gate voltage, would I run into any issues with that?

So, to clear up any misunderstandings, I am running a 3.3V Arduino with a 950-1050 mA LED. My gate voltage is going to be 3.3V from the arduino, and my drive voltage will be 9V from a battery (not a supply). The LED will be connected to the 9V source.

Hi,
@PedantEngineer ,I stand corrected.

A MOSFET that will switch ON at 3.3V gate will need a site with a good parametric search.
A close look at characteristic curves of Vgs vs Rds(on) may be needed.

For example
NTD3055L170
IRLB8721PbF

This one is just about ideal, just need some steady hand soldering, SMD.
SQA410EJ file attached.

@PE suggestion of FDD8447 has a very good graph of Vgs and Rds(on)
and it is in an easy solderable package.


The normalized Rds(on) is about 10mOhms so by the graph at 3.3V, Rds(on) would be about 1.5 x 10 = 15mOhms.

Tom.... :slight_smile:

sqa410ej.pdf (220 KB)

695790.pdf (514 KB)

TomGeorge:
The normalized Rds(on) is about 10mOhms so by the graph at 3.3V, Rds(on) would be about 1.5 x 10 = 15mOhms.

Tom.... :slight_smile:

Only at low current! Try to switch a few amp with it and resistance goes up, fast. Doesn't look that great to me.

Later when I'm back home I can give the number of the MOSFET I use for 3.3V, can switch 8A and is fully on at 3.3V or even a little less.