Controlling 35W load from microcontroller

Discussion in 'The Projects Forum' started by Trip1, Oct 30, 2013.

  1. Trip1

    Thread Starter New Member

    Jan 28, 2012
    9
    0
    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.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,094
    3,033
    "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.
     
  3. #12

    Expert

    Nov 30, 2010
    16,261
    6,768
    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?
     
  4. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Why is the "flickering" an issue in the first place?
     
  5. #12

    Expert

    Nov 30, 2010
    16,261
    6,768
    "The solar cell picks it up quite well."
     
  6. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    So whats the problem with the solar cell picking up that?
    Just wondering..
     
  7. #12

    Expert

    Nov 30, 2010
    16,261
    6,768
    We'll have to wait for Trip1 to answer that.
     
  8. Trip1

    Thread Starter New Member

    Jan 28, 2012
    9
    0
    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.

    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!
     
  9. #12

    Expert

    Nov 30, 2010
    16,261
    6,768
    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?
     
  10. wayneh

    Expert

    Sep 9, 2010
    12,094
    3,033
    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.
     
  11. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    So does the freq of the "flicker" always match the PWM freq?
     
  12. Trip1

    Thread Starter New Member

    Jan 28, 2012
    9
    0
    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
     
  13. wayneh

    Expert

    Sep 9, 2010
    12,094
    3,033
    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.
     
  14. MikeML

    AAC Fanatic!

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

    Thread Starter New Member

    Jan 28, 2012
    9
    0
    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!
     
  16. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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).
     
  17. Trip1

    Thread Starter New Member

    Jan 28, 2012
    9
    0
    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!
     
  18. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    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.
     
  19. Trip1

    Thread Starter New Member

    Jan 28, 2012
    9
    0
    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.
     
  20. wayneh

    Expert

    Sep 9, 2010
    12,094
    3,033
    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.
     
Loading...