LED light Project questions, MOSFET Gate question first....

Hi guys, I'm pretty new here. I have an arduino uno, a mosfet and a need to use it. I read another thread that ended in 2017 and the system encouraged me to start a new topic instead of replying to that one.

I will try to include the relevant information, but again "I'm new". If I state something that is not the case, please by all means correct me. If I say I'm using arduino uno pin 9 because it automatically operates at 980 hertz instead of 490 like most of the pwm pins, but i'm wrong for some reason.

I want to switch a meanwell power supply, specifically the HLN-40H-15B, it is part of the HLN-40H line rated at 15volts and 2.67 amps.

I have lots of questions but this is the mosfet thread, I'm intent to use 256 bit PWM via a look-up table to produce 32 levels of linearly perceived brightness. I do plan to use pin 9 due to it's higher PWM frequencey of nearly 1khz, reducing visible flicker.

the Mosfet I will be using is irlz34npbf. This was originally to switch a LM338 to power an xhp-70.2 led however the led will now be powered by the meanwell power supply (we lost access to etching and have run out of time for our school project).

My question regards the information I've been reviewing regarding how to choose my gate resistor and how this work at all.

First, I never hear it said but I wonder is it assumed everyone already knows to use a resistor from gate to ground to empty the capacitive gate when i do not send it 5v signal? or is this unnecessary and this is why it's not mentioned?

Second, what resistor do I need for this job, (the one that my output pin 9 will hook up through in series to get to the gate pin of the mosfet)

the irlz34npbf

(are these even the things that refer to the capacitance of the gate?? or did I need to be looking at Qg Qgs and Qgd, measured in nanoCoulombs)???

Ciss input capacitance 880 pF
Coss output capacitance 220 pF
Crss reverse transfer capacitance 94 pF
(under conditions of Voltage Drain->source of 25v and Vgs of 0V at a 1 mhz frequency)

I'm thinking of using a 220 ohm resistor, the gave capacitance seems to be very small of the gate so this might make things acceptable for speed of response.

the pdf is really easy to find for this one but I'm happy to answer other questions.

I'll be starting another thread addressing the meanwell power-supply and how I am to use this. I often read conflicting information on datasheets, this means I do not understand what I'm reading but I think I do understand (not good).

Thanks in advance to everyone for time and assistance, I look forward to learning more stuff : )

Hey guys, I've got questions about the HLN-40H-15B meanwell power supply.

I intend to PWM dim this thing, but I understand from the datasheet that as I duty cycle the signal wires the meanwell does not duty cycle the output, instead it actually adjusts the current by percentage (Surly I read this wrong? this changes lots of things about led performance??)

I intend (intended? did I screw up?) to use this thing as a sort of lamp, I intend to operate this off of arduino uno PWM pin 9.

I want to be able to control total output of my LED. I see that in the output section under current adjust range I see thatmy range is 1.6-2.67 amps. How can I dim this very much if I can only dim from 2.67 amps (a bit much but tolerable for our purposes I think) down to 1.6 amps.

I understand that as I ramp up or down the duty cycle to the mosfet I place in between the DIM+ (blue) and DIM- (white) I will be passing or blocking a 10 volt signal source that is provided by the meanwell for me to conveniently use (learned that here to : ). As I PWM the transistor and therefore the meanwell, I see that at 10% dutycycle I get 10% rated current, 20% = 20% and so on. My question concerns the relationship between this statement and the previous one. perhaps my initial understanding about current regulated output by PWM control is way off. If this is the case can i configure the meanwell to max out at a lower current that 2.67 (such as anywhere between 1.6 and 2.67) and then I can actually duty cycle that output as well? I don't think there is enough connections for this to be the case.

Help : )

Thanks guys!

PWM means switching the light (driver) fully on/off very fast, with a certain duty cycle.
You can do that with an opto coupler, with the transistor part connected between Dim+ and Dim-
Make sure you connect the opto collector to Dim+
PWM the opto LED with 1k current limiting resistor from an Arduino PWM pin.
Use 470 ohm if you're using a 3.3volt Arduino.

If you want to limit max LED current, then also add a resistor across the Dim pins.
You can find the right value in the datasheet. Example: 50k for 50% of the driver's rated current.
Leo..

You are using an N Channel MOSFET so yes, a Gate resistor to ground in your case is fine. The idea being make sure the MOSFET turns off when it should. Most applications like yours I would use a 10K resistor. The resistance is not derived (calculated) in the same manner a transistor base resistor is. Don't worry about parameters like gate capacitance unless of course you really want to get into how a MOSFET works. :slight_smile: Actually some may suggest 100K so as you can see it's a large window.

Ron

I understand I can use an optocoupler, i plan to use a transistor in this case since this is what I have.

I should bridge the Dim+ and Dim- with an appropriate resistor to limit max output current, then further regulate that current by using PWM through mosfet controlled by arduino. This will give me 10-100 percent duty cycle of whatever output current I pick that falls within 1.6-2.67 amps.

is this correct?

And I just want to make sure that I understand you to be saying that I should do Both of these things with this meanwell.

also, if you know, does the PWM actually regulate the output current or does the meanwell also output a PWM current supply?

Thanks for your help! : ) (love this palce)

oh, I thought I needed to basically calculate how much capacitance the gate had so i can consider how fast I can raise it’s voltage and how fast I can drop it’s voltage using 5v arduino while not exceeding 20 (or certainly not 40) ma current rating.

I can just put a 1 k resistor and this solves that, the capacitance is so small that at 1 kHz a simple 1kOhm resistor is suitable (easily more than protect the arduino i’ve no doubt from what I read about calculating gate capacitance and operational thresholds), and this will not interfere with the PWM digital signal getting analog averaged so much that duty cycle is affected.

Do I understand all that correctly, i’m just trying to see if I understand what you’re saying before I proceed with things in hardware (parts are still on the way but some are here : )

HarmlessJohnny5:
I understand I can use an optocoupler, i plan to use a transistor in this case since this is what I have.

Did you read the warning about the Dim pins in the datasheet.
Better get an opto coupler first.

HarmlessJohnny5:
I should bridge the Dim+ and Dim- with an appropriate resistor to limit max output current...

Correct, that's analogue (current) dimming.

HarmlessJohnny5:
then further regulate that current by using PWM through mosfet controlled by arduino. This will give me 10-100 percent duty cycle of whatever output current I pick that falls within 1.6-2.67 amps.
is this correct?

No, I did not mention a mosfet.
The opto coupler will switch the driver on/off very fast, between OFF and the current you have set with the resistor.
If you vary the ON/OFF time (PWM), then you just see it as a dimmer light.

PWM does NOT regulate the current.
Leo..

Which LEDs are you actually using.
These drivers are meant for 'bare' LEDs (without resistor).
Star-base LEDs, COB LEDs, etc.
Not for LED strips.
Leo..

Confused about your multiple threads for this project, which is against forum rules for that reason.

I hope you do understand that you shouldn't/can't use a mosfet to PWM LEDs powered from that constant current mains power supply.
You should PWM the LED supply with an opto coupler, as I explained in your other thread.

I doubt you can dim (with) that supply low and/or with a high PWM frequency.

As I asked in your other thread, WHICH LEDs are you trying to dim.

Give us ALL the information, and keep it in ONE place.
Leo..

It'll be an xhp-70.2

Ok I hate to overly clarify but you *are saying that a mosfet is completely unsuitable for this purpose. If this is *not correct please let me know. (if this is not what you're saying then i'm pretty confused by your response to the information I provided).

Second, "No, i do not know what you are talking about regarding the DIM pins on the data sheet". I have looked it back over. If you can describe more directly what you mean by this it would be helpful.

I need to understand something before I just do it, else why am I here to learn (else am I even hear to learn).

What makes a mosfet inapplicable for this application, I still don't get it.

Thanks

Edited for relevance:
I think I understand how the meanwell works, I certainly understand what you have said regarding my questions of this driver. Thanks. I'll focus on the other thread for now unless I hear something in here from someone that contradicts what you have said.

Thanks again for your information

MODERATOR REQUEST
PLEASE COMBINE THE THREAD “Re: Meanwell power supply, how do I PWM this thing?” WITH THIS ONE IF THAT IS POSSIBLE.
Thank you in advance.

I’m thinking more and more that you are not actually reading what you are replying to. As stated in the original post, this is an xhp 70.2.

Your quote:
“You should PWM the LED supply with an opto coupler, as I explained in your other thread.”

I am confused by this, you really did not. you never explained why, you just said to do it and then alluded to the datasheet. How much do you understand the details I posted here regarding mosfets and in particular this one?

You never explained those questions as well. I understand you don’t think that information or understanding is important but to me it is. If this is not something you know about, that’s cool too. Not a big deal. Honestly I don’t know it myself about it,

THIS IS WHY I AM ASKING; I don’t want someone to do my project I want people to Help Me Learn and Understand.

I Am Here To Learn

Topics merged

I bet if I had an oscilloscope (and knew how to use it) I could see exactly how fast I'm triggering on and off the mosfet, heck I could probably see how long I was in any kind of 'transition' phase between on and off (very briefly I imagine). I think I could even work out how much current was flowing at any given moment during the pwm signal to the mosfet. Well one thing at a time, but one day I will deff have to get a scope, they seem amazing.

Sorry, did not see the xhp 70.2 part.
You should have included a click-able link, to make that more obvious.
And another one to the LED driver.
So people wanting to help you don't have to scrape Google for the right datasheets.

You are using a CONSTANT CURRENT power supply with BUILD-IN DIMMING,
Meaning it will fight back if you don't use it's dimming capabilities, but add your own instead (a mosfet).
You MUST leave the LED permanently connected to this supply (as in the datasheet),
and use one of the dim modes that the supply can work with (voltage, pot, switch), on the DIM pins.

Page 4 of the datasheet:
" Please DO NOTconnect "DIM-" to "-V"
Safer to use an opto coupler, to avoid the above warning.
Combining LED ground and Aduino ground could blow things up.
Leo..

I'm just wondering....

do you think I intend to put that mosfet between the OUTPUT of the DRIVER and the LED?

Yes, I was assuming that (shouldn’t have).
A diagram (also recommended when posting) would have stopped the confusion.
Sure you could use a mosfet (or NPN transistor) between the Dim pins, as long as you keep that LED ‘floating’.
Leo…

Thanks for your help understanding that meanwell power supplies can be dimmed by Both a current regulating resistor and a pwm regulating pwm signal causing the output to be current regulated to a new maximum and for it to also be PWM regulated by the meanwell in accordance with the PWM signal sent to it.

This is why I did NOT combine the threads Wawa. Can you quote me the rule that says these two topics must be merged; since you specifically told me that I was violating forum rules?

Remember the topic of this thread (now merged with the power supply thread…), this has not been addressed, even now as you say ‘yes a transistor is fine’, the original topic of this very thread has been lost to your focus on the power supply questions I had. I saw your many posts and had confidence in the validity of what you have been saying, I was honestly worrying that people would see you had responded and think my question has been answered. I am actually still concerned about this.

I MIGHT HAVE TO START A NEW THREAD DUE TO THIS (@ moderator), which as I understand IS against the rules.

I suppose all I can do at this point is restate my question in the next post as clearly as I am currently able, I thank you for your advice on what the results of my post should be (links, proper quotes, etc). Though these things might be obvious to do, I am unsure how to. The links, I thought were not allowed so thank you again for clearing that up.

I mean no offense, I only want to try to get answers to my questions. You know your meanwell information and that’s great. Your explanation of these aspects of the meanwell was exemplary, my speculations were (obviously) all unbelievable for a $40 power supply.

Quote from Me: (I gotta learn how to do this properly, I understand)
If this is the case can i configure the meanwell to max out at a lower current that 2.67 (such as anywhere between 1.6 and 2.67) and then I can actually duty cycle that output as well? I don’t think there is enough connections for this to be the case.

you then explained that you simply use those two connections (DIM+ and DIM-) for both tasks, this makes total sense for a $40 power supply. I’ll buy that one and believe it as totally plausible.

I’m still interested in the relationship between resistor and transistor and arduino 5volt signal current output (which I understand in concept really well) and specifically the question this thread is dedicated to regarding the datasheet and these pieces of information. I’ll restate that next post, if you know this please let me know if not then please let this thread be focused on MOSFET and reading/interpreting the MOSFET datasheet as described and originally titled for.

Ron_Blain:
You are using an N Channel MOSFET so yes, a Gate resistor to ground in your case is fine. The idea being make sure the MOSFET turns off when it should. Most applications like yours I would use a 10K resistor. The resistance is not derived (calculated) in the same manner a transistor base resistor is. Don't worry about parameters like gate capacitance unless of course you really want to get into how a MOSFET works. :slight_smile: Actually some may suggest 100K so as you can see it's a large window.

Ron

dude, I should have commented earlier (was late, got distracted). Thank you, that is 'gold' information.

and strangely enough... :slight_smile: I do want to know more how a mosfet works. I understand the 'concept', lotta explanation of how that FET part works and I understand it's metal oxide in this case.

I intend currently to operate with the 1k resistor you suggested as from what I read elsewhere (where this is explained in detail, but I'm not fully understanding how to apply in my own case), a 220 ohm resistor should adequately protect the pins under a much larger capacitance gate. My gate seems to have a very low capacitance compared to what I read may common in this situation (1 pF instead of 20 nF).

I still want to know how to calculate this so I have confidence in how much margin I have in in-rush current or how much margin I have in frequency of operation. I assume the output resistor should be the same at the input? I can think of reasons you want it higher as well as lower and am uncertain which way to go and why.

RESTATING THE QUESTION REGARDING OPERATION OF MOSFETS

when the arduino outputs signal to the mosfet at 5volts, it will produce an 'inrush current' as it fills the capacitor. EDIT, "AS IT FILLS THE CAPACITANCE OF THE GATE" This is based on several things including the capacitance of the capacitor (and I now suspect the total coulomb capacity of that capacitor is also relevant and must be considered?) and any current limiting resistor.

the speed at which the trigger can be raised or lowered (how fast you can fill that capacitance and empty that capacitance) is also going to be limited by that very same resistor.

all of the information necessary to calculate this behavior (speed and current limits) and choose a resistor is contained in the data sheet.

I do not understand what parts I should be using from that datasheet for what purposes. If someone understands the things I just outlined above and also knows the answer to the following question please let me know:

(are these even the things that refer to the capacitance of the gate?? or did I need to be looking at Qg Qgs and Qgd, measured in nanoCoulombs)? I suspect I don't quite understand how capacitance of the gate is determined (what that 'means' : ) perhaps I need both.
Datasheet for the IRFZ34 (the pb just means mine has some lead in/on it)

Ciss input capacitance 880 pF
Coss output capacitance 220 pF
Crss reverse transfer capacitance 94 pF
(under conditions of Voltage Drain->source of 25v and Vgs of 0V at a 1 mhz frequency)

As to our friend the MOSFET

“A metal–oxide–semiconductor field-effect transistor (MOSFET, MOS-FET, or MOS FET) is a field-effect transistor (FET with an insulated gate) where the voltage determines the conductivity of the device. It is used for switching or amplifying signals. The ability to change conductivity with the amount of applied voltage can be used for amplifying or switching electronic signals. MOSFETs are now even more common than BJTs (bipolar junction transistors) in digital and analog circuits”.

The above quote was taken from here:

You can likely find a few dozen explanations of how they work and more important applications for them. Just as an example comparing a BJT (Bi Polar Junction Transistor) to a MOSFET.

http://www.differencebetween.net/technology/difference-between-bjt-and-mosfet/

The sad part is I watched the transistor evolve during the 50s and 60s to where things are today. :slight_smile:

Ron