Will this work (trying again)

Hi,

I'm fairly new to electronics so this might seem like a really basic question but be nice please :).

I've designed a program to go through a number of light patterns with an RGB led, it seems to be working nicely in my prototype (see pic 1) (although it's hard to tell without using an RGB LED!) but I want to use it with a 3W RGB LED I have laying around (for specs see http://dx.com/p/3w-led-emitter-on-star-multicolored-rgb-4530). As I understand it arduino can only supply 40mA/pin, not the 350mA per colour required by the LED so I need to use transistors, I've never used them before so want to make sure the circuit I've designed will do the job.


Pic 1 (working prototype)


Pic 2 (proposed circuit)

Just in case it's not clear what is being used in the circuit:

Any questions just shout.

Thanks in advance.

Howard

No it won't work.

(1) Both the Anodes and Cathodes are connected to the Positive terminal.

(2) You have capacitors in series with the power supply. Capacitors are open circuit at DC.

I can't see pic1 - working prototype -
Pic 2 will not work as Tom Carpenter already told.

I have redrawn your circuit as a proper circuit schematic.

The circuit is exactly the same as what you show and is wrong (I've omitted the resistors for simplicity). Hopefully by drawing it in the way I have you can see where you went wrong.

[For anyone else looking at this image without reading previous posts, this circuit wont work]


Edit:
I have also just noticed that in your diagram compared to mine, I have swapped pins 2 and 3 of the MOSFET (Drain and Source) to make them the correct way around. I did that out of force of habit.

In the above picture, WTF ? means:

These are placed wrong.
They need to go parallel to the regulator, not in series with it.
The diagram by Tom Carpenter is clear to me, i can't say that about yours.
So try to use standardized symbols instead of the black box approach.
There's a learning curve, but for anyone reading your resulting schematics it will be much better to see what's (supposed to) going on in it.

High Power LEDs should be powered with a constant current LED driver, not a 1/4 watt resistor P=IxR^2 = .35 x 1= .35 watts > .25watts. Finding a high power driver circuit that runs on 3.3v might difficult, most of the ones have seen require a 12v source, (but I could be wrong.)
It is good practice to use resistors between the gate and output pin.
For the switches i would recommend using the internal pullup resistors.

Thanks Tom

In case it makes a difference I'm using PWM to turn the LED's on and off... when the cathode goes high the LED's turn off, or at least that was the plan... like I say I'm new to all this!

I think I can and have redrawn it (hopefully correctly) along with the circuit I currently have the code working on so you can, hopefully, see if it should work. I'm still not sure it'll work though because in PIC 3 when pin 9, 10 or 11 go high the LED will switch off, however in PIC 4 when the pins go high they will switch on, I can easily change this in my code but out of interest would there be a way to do it in the circuit? I think this is why I got pins 2 and 3 of the MOSFET switched around.

MAS3:
In the above picture, WTF ? means:

These are placed wrong.
They need to go parallel to the regulator, not in series with it.
The diagram by Tom Carpenter is clear to me, i can't say that about yours.
So try to use standardized symbols instead of the black box approach.
There's a learning curve, but for anyone reading your resulting schematics it will be much better to see what's (supposed to) going on in it.

Thanks MAS3,

I think I've sorted the capacitors out now?
I'll try and start drawing schematics properly now, like you say there is a steep learning curve with all this but I'll get there!

seanz2003:
High Power LEDs should be powered with a constant current LED driver, not a 1/4 watt resistor P=IxR^2 = .35 x 1= .35 watts > .25watts. Finding a high power driver circuit that runs on 3.3v might difficult, most of the ones have seen require a 12v source, (but I could be wrong.)
It is good practice to use resistors between the gate and output pin.
For the switches i would recommend using the internal pullup resistors.

Cheers Sean,

I've added resistors between the gate and output in my schematic, what value would you recommend?
I've left the switches out of the schematic for simplicity, I know they work so all is good :).

Again thanks for the help so far.

H

EDIT: might help if I attached the pics!

Pic 3


Pic 4

@sniffing1987

You may wish to consider any of the free SPICE programs for electronic:

http://www.falstad.com/circuit/
Or others... Some install on PC so you do not need Internet connectivity.

These do two things,

  1. you can play with parts without smoke
  2. they create a printable schematic

Most have virtual instruments- oscilloscopes, Ammeter, Voltmeter, Wattage calculation

Ray

Hi, I hope this is only a prototype, 4x AA batteries will not last long with at least 350mA being drawn from them, also if you are PWM the LED then you will have to make sure that the 3.3V has sufficient filtering.If the 3.3V rail gets to much PWM noise on it then it will cause the Arduino to reset during operation.
Tom

Hi again, look at the link for the tricolour (proper spelling) LED, it doesn't state if common anode or cathode.
Check out the first review at the sales site and it says that it is common cathode, the circuit will not work, it assumes common anode.
Further down the reviews it states that the markings are wrong and it is common anode.
Can you verify that it is common anode as in your circuit.
Very disappointing that spec sheet is not available.

Tom

ps, What is the final power supply voltage that you want this to run on?
Spec says if all three LEDs on full, then 1.050 Amps will be drawn. Low current will give still give you a full range of colours, but not as bright.

Why are fet's being used?!

Replace them for npn transistors, 2n2222 for example eg it's rated 800ma which gives plenty of scope for a 330ma draw per LED...

At 350ma VCEsat is approaching 1V, gain is <50
The package will approach maximum power dissipation.

That is not the correct symbol for a MOSFET. I can see it is based on a less-common way of drawing a MOSFET, but it is still not correct.

You have no dot to indicate a connection where the wire between the negative ends of the two 10uF caps crosses the ground lead on the voltage regulator.

Some helpful information on drawing schematics. See rule 4:
http://opencircuitdesign.com/xcircuit/goodschem/goodschem.html

In addition, an IRF540 has a gate threshold voltage rated to be between 2 and 4 volts. So your 3.3V Arduino may not even be able to start turning them on, much less turn them on fully. For a low voltage circuit such as this, I suggest using NPN bipolar transistors. Make sure you use transistors with sufficient gain that can handle the current and power. Effective gain goes down when a BJT is used as a saturated switch, so base resistors need to be chosen to allow sufficient current while not drawing more than 40mA each and 200mA combined from the Arduino outputs.

The circuit you gave in reply #6 won't run the LEDs at full brightness because you are trying to drive the LEDs from a 3.3V supply, and the blue and green ones need somewhere between 3.2 and 2.8V. It would be OK if you ran it from 5V instead of 3.3V (using a 5V Arduino) and increased the LED series resistors accordingly. Alternatively, run the LEDs from the 6V unregulated supply - but then they will get less bright as the battery voltage drops.

You will need a higher value series resistor for the red LED than for the other two, because the red LED has a lower forward voltage.

TomGeorge:
Hi, I hope this is only a prototype, 4x AA batteries will not last long with at least 350mA being drawn from them, also if you are PWM the LED then you will have to make sure that the 3.3V has sufficient filtering.If the 3.3V rail gets to much PWM noise on it then it will cause the Arduino to reset during operation.
Tom

It's not a prototype but it only needs to last 30 minutes to an hour at a time which should be fine on 4x2400mAh rechargeables.
How do I go about filtering the 3.3V rail?

TomGeorge:
Can you verify that it is common anode as in your circuit.

ps, What is the final power supply voltage that you want this to run on?
Spec says if all three LEDs on full, then 1.050 Amps will be drawn. Low current will give still give you a full range of colours, but not as bright.

I can verify these are common Anode.

The final supply voltage is 6V, it will be running on 4 AA's as explained above.

cjdelphi:
Why are fet's being used?!

Replace them for npn transistors, 2n2222 for example eg it's rated 800ma which gives plenty of scope for a 330ma draw per LED...

I saw them somewhere and thought they might be suited to this use, apparently I was mistaken?! do I just directly replace with NPN's?

LarryD:
At 350ma VCEsat is approaching 1V, gain is <50
The package will approach maximum power dissipation.

??

polymorph:
That is not the correct symbol for a MOSFET. I can see it is based on a less-common way of drawing a MOSFET, but it is still not correct.

I just copied Tom Carpenter's drawing of a MOSFET...

polymorph:
You have no dot to indicate a connection where the wire between the negative ends of the two 10uF caps crosses the ground lead on the voltage regulator.

Oops, there are 5 other places I missed the dots too :confused:

polymorph:
Some helpful information on drawing schematics. See rule 4:
How To Draw Schematic Diagrams

Rule 4: Wires and components are aligned horizontally or vertically, unless there's a good reason to do otherwise.

Have I not done that?

polymorph:
In addition, an IRF540 has a gate threshold voltage rated to be between 2 and 4 volts. So your 3.3V Arduino may not even be able to start turning them on, much less turn them on fully. For a low voltage circuit such as this, I suggest using NPN bipolar transistors. Make sure you use transistors with sufficient gain that can handle the current and power. Effective gain goes down when a BJT is used as a saturated switch, so base resistors need to be chosen to allow sufficient current while not drawing more than 40mA each and 200mA combined from the Arduino outputs.

http://www.irf.com/product-info/datasheets/data/irf540n.pdf

So the 2N2222 suggested above should be alright? how do I calculate resistors for Transistors, is there a good guide somewhere I can read?

Again thanks for the help guys :slight_smile:

The 2N2222 is a very old transistor with appalling saturation characteristics. Don't use it, the voltage drop will be too high. If you want to use BJTs instead of mosfets (which is a reasonable thing to do), then use a more modern medium-current transistor such as BC337, with base resistors of 100 ohms.

But I repeat, you cannot drive those LEDs from a 3.3V supply. Use the unregulated 6V supply instead, and increase the LED series resistors accordingly.

Your new schematics are much clearer and others can see what you are trying to do, it's clear you mean FET and not just some PNP/NPN transistor.
The different symbols will tell you something about the FET (the way it's constructed) and that's why there are a lot of variants to it.

One can't expect you to do your first (or second or third..) schematic perfectly.
So take those additional comments as a help or extra guidelines for future use, and not as a reject of this first one for you.

sniffing1987:
So the 2N2222 suggested above should be alright? how do I calculate resistors for Transistors, is there a good guide somewhere I can read?

The resistors for transistors are calculated exactly the same as for LED's.
You can find out what current will be needed for that specific transistor by reading it's datasheet.
In time you'll find that there's some standard values you'll be using all the time for this.

Oops, I meant Hint 4:
4. Don't attempt to bring all wires around to the supply rails, or to a common ground wire. Instead, use the ground symbol(s) and labels like +Vcc to indicate those voltages where needed.

MAS3:
One can't expect you to do your first (or second or third..) schematic perfectly.
So take those additional comments as a help or extra guidelines for future use, and not as a reject of this first one for you.

Yes! Absolutely. My comments and suggestions are meant to be helpful, not as a putdown in any way. We're all new at some time, and at something.

polymorph:

MAS3:
One can't expect you to do your first (or second or third..) schematic perfectly.
So take those additional comments as a help or extra guidelines for future use, and not as a reject of this first one for you.

Yes! Absolutely. My comments and suggestions are meant to be helpful, not as a putdown in any way. We're all new at some time, and at something.

Don't worry guys, even if you did mean it as a putdown I've got thick skin :slight_smile:

dc42:
The 2N2222 is a very old transistor with appalling saturation characteristics. Don't use it, the voltage drop will be too high. If you want to use BJTs instead of mosfets (which is a reasonable thing to do), then use a more modern medium-current transistor such as BC337, with base resistors of 100 ohms.

But I repeat, you cannot drive those LEDs from a 3.3V supply. Use the unregulated 6V supply instead, and increase the LED series resistors accordingly.

In that case I could use the on board voltage regulator for the Arduino and do away with the voltage regulator entirely, would that be a better way to do it?

Is it the Base Emitter On Voltage or the Emitter Base Voltage that I am looking for with regard to the voltage needed from the Arduino? if it's the VBE (on) the BC337 is looking good at 1.2V, otherwise it's 5V

polymorph:
Oops, I meant Hint 4:
4. Don't attempt to bring all wires around to the supply rails, or to a common ground wire. Instead, use the ground symbol(s) and labels like +Vcc to indicate those voltages where needed.

Ok, I'll bear that in mind, my block diagram was guilty of that but surely where it's all linear like the actual schematics I've now drawn it's ok? (looks neater IMO)

What have I done wrong in this one?


Pic 5