Hi All,
Okay so I've had some help here recently getting my pin3 to a PWM frequency up around 100k. Now that seems to be working just fine, but I have another issue with that pin. It seems to be I'll call it floating around 0.020 volts which really isn't much, but it's enough to trigger the mosfet, at least a little. So I haven't really gotten on to building the rest of the project yet, just connected my new mosfet up with an LED. The LED is faintly glowing. Now when I press the PWM activation button the LED really lights up. The trouble is that I can't have this triggering the mosfet even just a little bit when it's not needed. I've connected a 1ohm resistor from pin3 to GND and it stops this small unwanted voltage but then it also stops the larger intended trigger voltage when the button is pressed. So I removed that and added the 1ohm resistor inline from pin3 to the mosfet gate. that didn't do the trick so I bumped it up to a 10ohm, the led is still faintly glowing. So I went to 10k. That did it. The LED stays off until the button is pressed. However, now I barely get enough power when the button is pressed to light the LED at all.
I need zero power and then full pass through on button press. What will I need to achieve this?
A 1ohm or 10ohm resistor to ground is a dead short for the output pin.
Way beyond the stress limit of 40mA.
It seems you want to PWM a LED with a 100khz base frequency.
For what purpose. IR remote control?
Surely not to just light up a normal LED.
The (unknown) mosfet couldn't do much dimming at that frequency.
Tell us more.
Leo..
That mosfet has a rather high gate capacitance of ~4nF.
Use a resistor between Arduino pin and gate to protect the pin.
220ohm is normally used, but you want the mosfet to switch as fast as possible for a converter.
Minimum theoretical safe value is ~100ohm.
A bleed resistor is needed to keep the gate firmly grounded if/when the pin is floating.
You already have discovered that.
Use 10k between Arduino pin and ground.
I hope you use a current limiting resistor for your test LED.
Leo..
Ok, much larger than 10k from pin to gate doesn't get enough power to the gate to really get any power through from source to drain. I have attached the 10k from gate to ground/source which doesn't keep the led from glowing in off time. No I have no resistor inline with the LED.
I've done exactly what you said. I have a 100ohm resistor inline from PIN3 to Gate. I have a 10K resistor from PIN3 to GND. Works great with an LED. LED is off when not pressing PWM button. Press PWM button and the LED comes on and I see 4.2V across the circuit (at A & C of LED). Remove the LED and there's always 4.2, pressing the PWM button makes the voltage go down. What the heck?!
This is my first arduino type project but I've been coding/programming for nearly 10 years. I've nearly 600 lines of code running this little project. There is an else statement in there. Just for simplicity I tossed up the if(button press){}. My code always compiles
At 100kHz you need to use a MOSFET driver to switch the MOSFET, something like a MIC4422
than can overwhelm the gate capacitance and switch the MOSFET fast (remember at 100kHz you
are switching every 5us, so you'd better switch in a few 100ns worst case). This is the sort
of frequency where gallium nitride MOSFETs start to be used because they switch significantly faster
than silicon.
Hi,
What voltage do you measure on the output PWM of the arduino.
(1) When you power up.
(2) When you push the button.
(3) When you release the button.
What voltage do you measure on the input pin of the arduino.
(1) When you power up.
(2) When you push the button.
(3) When you release the button.
If your arduino input that the button controls goes high when pressed, do you have a 10k resistor from the control pin to gnd to pull the pin to ground when the button is open?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Tom.....
If your sketch is too big, use REPLY rather than QUICK REPLY and it has an attachment facility, so you can post your sketch as an attachment, but try code tags first.