Controlling 35W load from microcontroller

Thread Starter

Trip1

Joined Jan 28, 2012
9
Hello,
A few months ago I posted a question about controlling the intensity of a car headlight from a microcontroller. I ended up using a PWM signal from a microcontroller to turn on/off an N-channel MOSFET, as shown in this circuit:

http://i.imgur.com/Ca8kJce.jpg [1]

It ended up working great.. except for one major problem. I was planning on using the car headlight as a solar simulator to shine onto a solar cell. The issue is that the current generated out of the solar cell is also flickering at the same frequency that the transistor is turning on and off, which is a big problem for my application.

This method of controlling the intensity of the car headlight results in a flicker in the light source - one that is not noticeable to my eyes, but the solar cell picks it up quite well. I was able to increase the PWM frequency from 500Hz to 62.5KHz, but I still have noticeable flicker in the current being generated by the cell.

I need a new method to control the intensity of the light source from a microcontroller, one that does not cause any flicker in the light source. Does anyone have any ideas?

I was thinking of putting a large capacitor in parallel with the light source to smooth out the flicker, similar to a filter capacitor in a rectifier circuit. The problem is that when i simulate this in SPICE, I end up with a filter capacitor with extremely large values (on the order of 100s of mili farads!) in order to convert the waveform to DC. Also, i'm not sure what type of capacitor I would need.. the current through the light source is around 3 amps.

If anyone might be able to provide a suggestion or to steer me in the right direction, it would be greatly appreciated!

Thanks.
 

wayneh

Joined Sep 9, 2010
17,498
... I end up with a filter capacitor with extremely large values (on the order of 100s of mili farads!)
"Extremely large" is an objective term. To some - the competition audio guys come to mind - that size would be "extremely small". They use multi-farad caps.

But rather than integrating the power signal, you could instead integrate the PWM signal to a steady voltage, and use that to control a constant-current supply to your load.
 

#12

Joined Nov 30, 2010
18,224
Faster switching needs smaller capacitors.
Wait. You already did that. How about a capacitor in parallel with the mosfet?
How about filtering the sensor instead of the lamp? It certainly uses less current, doesn't it?
 

Thread Starter

Trip1

Joined Jan 28, 2012
9
So whats the problem with the solar cell picking up that?
Just wondering..
It's a problem because my goal is to use this light source as a solar simulator to characterize the cell under test. Cell characterization is typically done by measuring its current - voltage relation under specific test conditions (one test condition being a specific incident light intensity). If the current out of the device is changing rapidly, then I can't make an accurate characterization of the cell. If i apply a voltage to the cell and measure the output current, then my measurement of current might happen at the peak(which is good) or it might happen at the zero level (which is bad) and there's no way to tell which one my measurement is going to give.

Faster switching needs smaller capacitors.
Wait. You already did that. How about a capacitor in parallel with the mosfet?
How about filtering the sensor instead of the lamp? It certainly uses less current, doesn't it?
I did try the cap. in parallel with the mosfet, which is where I found the large required capacitance. If I were to filter the output of the sensor (solar cell output), well, that would ruin the point of the instrument as I would no longer be making an accurate measurement (it would be more like an average I guess?)

Someone on another forum suggested I use a buck converter after the MOSFET, like this:

http://i.imgur.com/1jq7Q8t.png

And it looks like this may be my solution. Thanks for everyones input!
 

#12

Joined Nov 30, 2010
18,224
Hang on...if a lamp goes on and off at 60 Hz, a human can't tell it's flickering, but that is about persistence of vision. Now I'm thinking about how a metal headlight filament changes temperature as fast as 62 KHz (thermal inertia of mass). Are you using a lamp with a metal filament?
 

wayneh

Joined Sep 9, 2010
17,498
...I still have noticeable flicker in the current being generated by the cell.
I wondered the same thing as #12. Perhaps that flicker is coming from somewhere else, like induction from the power supply. I'll guess the bulb is fairly close to the PV panel. A headlight filament should do a pretty good job of integrating the current at 62kHz.
 

Thread Starter

Trip1

Joined Jan 28, 2012
9
So does the freq of the "flicker" always match the PWM freq?
It does. I think you guys might be on to something.. perhaps there is some crosstalk in my circuit somewhere. I never stopped to think whether or not it made physical sense for an incandescent lamp to heat up and cool down in such a short amount of time
 

wayneh

Joined Sep 9, 2010
17,498
Trying turning the panel over and seeing if the flicker remains unchanged. Or put the panel in the sun with the headlight nearby.
Isolation is what I'm suggesting.
 

MikeML

Joined Oct 2, 2009
5,444
I think you have a ground loop. Is any of the headlight current flowing along the grounds that connect to the micro-controller?
 

Thread Starter

Trip1

Joined Jan 28, 2012
9
I think you have a ground loop. Is any of the headlight current flowing along the grounds that connect to the micro-controller?
Hmm

have a look at this:

http://i.imgur.com/Ca8kJce.jpg

I connect both the arduino ground and the headlight ground together when i built the circuit. Is this not correct? What should i do with the arduino ground- leave it out of the circuit completely?

EDIT: the above might be confusing, what i meant is that I connect the PC power supply ground and the arduino ground together.. headlight 'ground' (negative side of headlight) just goes to the drain of the mosfet.

EDIT: The circuit is essentially shown here: http://bildr.org/2012/03/rfp30n06le-arduino/ the third one on the right
Thanks so much for everyones help!
 

MikeML

Joined Oct 2, 2009
5,444
Do not connect the source of the NFET to the Arduino board! Run the wire from the source directly to the negative side of the 60V supply. Connect a separate jumper from the neg side of the 60V supply to the neg side of the Arduino power supply (not to the terminal on the Arduino board).
 

Thread Starter

Trip1

Joined Jan 28, 2012
9
Do not connect the source of the NFET to the Arduino board! Run the wire from the source directly to the negative side of the 60V supply. Connect a separate jumper from the neg side of the 60V supply to the neg side of the Arduino power supply (not to the terminal on the Arduino board).
The arduino is being powered from USB at the moment (preferably want to keep it that way) so no way to connect the negative side of the high power supply to the negative side of the arduino supply. Is there another option?

Thanks so much!
 

MikeML

Joined Oct 2, 2009
5,444
Then try running the NFET source to the neg side of the 60V supply. Then run a separate wire from the neg side of the 60V supply to the chassis of the PC that the Arduino is plugged into.

Else get a real 5V supply to run the Ardino and get the PC out of the loop.
 

Thread Starter

Trip1

Joined Jan 28, 2012
9
So i have been doing some research and most examples do have the source of the n channel mosfet connected to the negative high power supply and the arduino ground. For example, at the bottom of this link: http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

Now, I don't necessarily have a negative side to my power supply. I'm using an ATX PC power supply and so my + voltage is coming from the +12V pin from a 4 pin molex connector (http://www.helpwithpcs.com/courses/power-supply/atx-psu-pinouts.gif) and then I am simply using the ground connection for my negative side of the power supply.

So this ground from the molex connector goes to the source of the n channel mosfet, and the ground pin of the arduino is connected to the source as well..

I drew the circuit again making things more clear:


http://imgur.com/Bfcbg4G

EDIT: Will give what you suggested a shot.
 

wayneh

Joined Sep 9, 2010
17,498
That's definitely a problem. Even the wires from the connector back to the PS can cause mV shifts in "ground". I was switching a 4A peltier and saw that problem affecting my circuit's comparator that was acting as a thermostat. My molex connector had multiple ground pins, so combining them all helped mitigate the problem.
 
Top