# Power Mosfet - Unreliable High Speed Switching Behavior

Im having a peculiar problem with my circuit, your help is very appreciated :)

## My Set-Up

I am using an FQP30N06L N-Channel MOSFET to pulse an array of LEDs at 38 kHz. A micro-controller (Arduino Uno R3) is used to send 38 kHz pulses at a 27% duty-cycle to the gate of the MOSFET (I am using a 100 Ohm resistor from the micro-controller to the gate of the MOSFET and a 470 k-Ohm resistor from the gate of the MOSFET to GND). With each pulse the MOSFET connects the circuit from the LEDs to ground thus allowing the current to make a complete proper path.

To power the LEDs I am using an LM317 voltage regulator set-up as a constant current supply with an out-put of 100 mA per string of 7 LEDs (300 mA total for 3 strings of 7 LEDs/string) Later on I plan to upgrade my circuit to have a total of 3 strings of 7 LEDs per string (a total of 21 LEDs). At a 27% duty-cycle the current through one string of 7 LEDs should be approximately 27 mA.

Here is my schematic....

simulate this circuit – Schematic created using CircuitLab

## The Problem

The current flowing through the LEDs is not steady. It starts fine then exponentially drops and levels-off. For example I connected my multimeter between one string of 7 LEDs and the MOSFET. The multimeter starts reading around 27 mA and exponentially decreases to 17 mA where it seems to stable off.

Sometimes when I place my hand the circuit (without touching the circuit) the current significantly changes from a few milli-Amps to 10, 20, 30 mA change. When I remove my hand it returns to normal.

## Diagnosis

I think the problem lies with the MOSFET. I checked the output of the LM317 and that remains stable at 100 mA. Do you happen to know why the circuit is performing this way and how to remedy it?

This is how I connected the multimeter to verify the LM317's output....

simulate this circuit

Thanks!

## Pictures

### Picture 1

The small green module is the power supply. The TO-220 next to the Arduino with the two terminals and the diode is not used in the circuit. It is disconnected.

### Picture 2

The TO-220 on the upper left of the board is the N-Channel MOSFET FQP30N06L used to pulse the LEDs at 38 kHz. The TO-220 on the upper right of the board is the LM317 voltage regulator.

The white wire connected from the Arduino is connected to the gate of the MOSFET. It is pulsed at 38 kHz.

You may also notice the CAT5e cable (ethernet cable) on the upper right. I will be using it to connect a second string of 7 LEDs. As of right now the wires of the ethernet cable are only soldered on but not connected to any circuit.

### Picture 3

The larger square of aluminum foil covers the infrared LEDs. The foil is completely covered with clear tape. I use it to prevent the infrared receiver from receiving unwanted signals from with-in the the circuit housing.

The smaller square of aluminum foil covers the rear of the infrared receiver and is also completely covered with clear tape.

The three wires (red, black, blue) are for the infrared receiver. They are completely disconnected from the circuit during testing.

### Picture 4

On the left is the infrared receiver. On the right is the string of 7 infrared LEDs

## Resources

Voltage Regulator datasheet: http://www.mouser.com/ds/2/149/LM317-64104.pdf

MOSFET datasheet: http://www.mouser.com/ds/2/149/FQP30N06L-244344.pdf

BJT Transistor datasheet: http://www.mouser.com/ds/2/149/2N3904-82270.pdf

• According to your schematic, you have a battery in a short circuit loop. – Dmitry Grigoryev May 15 '15 at 0:10
• Why do you want to use fixed duty cycle PWM when you could accomplish the same thing open-loop? – EM Fields May 15 '15 at 0:15
• @EMFields, can you elaborate your comment please? I'm new to these techniques. I suppose it's a fixed duty cycle because it is infrared emitter and receiver system. What do you mean by "open-loop"? – hsan May 15 '15 at 2:58
• "I recognize my battery is shorted. That is an error on my behalf in the schematic but not a reality in the physical set up." 1. So fix it and the other drawing mistakes you've made so we won't have to guess as to how it's really wired. 2. If your hand's proximity is causing the LED current to fluctuate, I suspect you have a high-frequency oscillation in there. Can you post a photo of your circuit as-built, and do you have an oscilloscope you can use to troubleshoot your circuit? 3."Open loop" means operating without feedback, which is what your circuit is doing, so belay that comment. – EM Fields May 15 '15 at 8:44
• @EMFields Thank you for your response. I updated the schematic and posted photos of my circuit and links to the datasheets. Unfortunately I do not have an oscilloscope. – hsan May 15 '15 at 22:21

## PART 1

2.) The input to your Arduino supply doesn't have the battery across it.

3.) You should be switching the input of the LM317 and current-limiting its output using the voltage dropped across an output resistance to ground.

4.) You don't need Q1, Q2, or Q3

5.) 10.5 volts across 7 LEDs is 1.5 volts per LED, which won't work.

## PART 2

Thanks for cleaning up your schematic.

A new problem which comes to mind is that even if the circuit itself wasn't flawed, I don't think the LM317 is quick enough to give you a faithful 7.1 microsecond pulse every 26.3 microseconds, which is what a 27% duty cycle signal will look like at 38kHz.

Not only that, your circuit isn't a current regulator it's more like a HMMM....

The trick to getting the LM317 to regulate current is to wire it like this:

where with the current desired through R1 (your LED array) and R2, the drop across R2 will equal 1.25 volts, which is what holds the output at whatever voltage it needs to be to push 100mA (in this case) through the load and the sense resistor.

The rub here is that with E3 needing to be at 1.25 volts and the LED array dropping 10.5 volts with 100mA through it, E2 needs to be at 10.5V + 1.25V = 11.75 volts.

Then,from TI's data sheet:

It becomes apparent that you need at least 3 volts of headroom for the LM317, so your supply voltage must be at least 14.75 volts.

With that in mind, and considering that the LM317 might not be able to switch at the rate you need, it seems to me that a much more sensible arrangement would be a vanilla LED pulser using a single MOSFET, where each of the 100 ohm resistors is the equivalent of a string of 7 IRLEDs in series, and the 20 ohm resistors are their current-limiting ballasts, like this:

Finally, here's the LTspice file you'll need to run the simulation of the pulser and play with the circuit if you want to.

## PART 3

I can't help but think that at least part of your problem is the circuit layout, which could easily be causing the oscillation you seem to be experiencing. You should watch your lead dress and place the components on the board with at least some care.

Here's an example of
an old, nicely laid-out wire-wrapped prototype which gave us no trouble at all during testing. Notice that all of the components are securely anchored close to the board, and that the wire-wrapping is roughly equivalent to PCB traces.

Not as stable, but not bad.

• Where can I find info on your point number 3? I would like to try this. Thank you. – hsan May 15 '15 at 3:07
• What do you mean by point number 5? This set up works but the current fluctuates starting at the expected 27 mA but then decreasing to about 17 mA. The LM317 is used as a constant current source not a voltage regulator. I isolated the LM317 and connected the output directly to GND to verify its output. It is a steady 100 mA as expected and desired. – hsan May 15 '15 at 3:15
• @hsan: Point 5: I could be wrong since the LEDs are infrared emitters and might work with a Vf < 1.5 volts. So which LEDs are you using? A link to a data sheet would be nice. – EM Fields May 15 '15 at 9:12
• @hsan: If you're switching the LM317's load in and out of the circuit then the LM317 can't be running in constant current mode since when the load is disconnected the output current of the LM317 will fall to 0A and its output voltage will rise to its full unregulated voltage, and when the load is connected the LM317's output will fall to whatever voltage is required to allow 100mA through the load. Can you post a schematic of how you isolated the LM317 and determined its output current, please? – EM Fields May 15 '15 at 9:14
• These infrared run on 1.5 Volts. Here is the spec sheet [link]{mouser.com/ds/2/311/…} – hsan May 15 '15 at 15:42

## Put a bunch of decoupling caps (0.1 - 1uF, ceramic, 50V) on all of your IC/supply stuff.

1. Supply to GND
2. Regulator IN to GND
3. Regulator OUT to GND
4. Battery + to Battery -

This is something that removes a vast majority of 'unexplained' phenomena, like your hand messing with your stuff.

Once that's done,

## Remove the regulatory IGBTs

They aren't going to do anything. It's a voltage regulator. With a single reference voltage, it will keep things constant across all of your loads. I see that you want to make sure you don't get a situation like, "I need to have 5V on this one, and the LEDs will drop voltage, so I need to make sure I have 6V for the next one, and 7V for the one after".

Doesn't work like that, though. Again, voltage regulator. You want to put 5V across ten fusion reactors and a space shuttle? Your voltage regulator is going to do everything it can in order to do it, including immediately destroying itself.

Since it's just LEDs, just make sure you meet the current capacity of all three of your LED-strips and you're fine. I'm going to assume you will, so just remember to limit it with a $P = I*I*R$ wattage resistor for each row, and you'll be fine.

1. Remove Q1, Q2, Q3
2. Replace with a resistor (or some way) to Vadj from Vout