Help with my attempt to PWM control Mains power.

Discussion in 'General Electronics Chat' started by Unixnut, Oct 7, 2012.

  1. Unixnut

    Thread Starter New Member

    Jun 29, 2008
    2
    0
    Hello everyone,

    One of my recent projects has been making computer controlled light systems in my house. Up till now I've been using low power ( < 50V) mosfets and LED's, with no problems.

    Now I'm trying to PWM control a set of 50W Halogen lights (240V). I figured that being incandescent lights, they would not care if they were fed AC or DC. DC was easier to control for me, as I've already built the circuits (and no need to deal with triac's and the zero crossing). As such I decided to use a high power mosfet for switching, with a 4N25 optocoupler to shield the hot side from the PIC microcontroller and other low-voltage components.

    The circuit is attached. It is rather simple. When testing, I took Vcc up to 30V using 5W lamps without any problems (this is as far as my bench psu can provide).

    However when I fed it mains DC* (attached to 50W lamp), I blew the fuse, the optocoupler and the mosfet in one swoop.

    Replacing the blown components and tested at 30V again, and it all works as intended. Further attempts at mains power (with a lower rated 3A fuse) resulted in the fuses just blowing.

    As this is my first foray into mains electronics (up till now its all been low voltage), there could be something simple yet specific to high voltages that I am getting wrong, so any help appreciated.

    The mosfet is an IRFP350, rated at Vmax of 400V and 16A, and the optocoupler should also be able to handle it (there was no Vmax specified in the datasheet I saw, but a Vtyp of 150V), so I don't believe I've pushed the components beyond their limits.


    * Mains AC, full-wave rectified with no smoothing.
     
  2. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    First of all, 4n25 is rated for 70V on the transistor, so there you see why it blew when connected to mains. Second, 400V mosfet is pretty close to the 325V of rectified nominal AC. Add 15% tolerance to it, you get 374V. Because the lights and wires will have a lot of inductance, you will need a back EMF diode across it, and the mosfet needs to have larger Vds as well.
     
  3. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    I am afraid you are not going to have good luck with this. PWM is mostly for DC controls. Among other things you will run into aliasing, the AC line frequency interfering with the PWM frequency.

    I think you need to back up and rethink this. Dimmers for house lighting do not use PWM, they use phase angles off of the AC wave form.

    http://www.allaboutcircuits.com/vol_3/chpt_7/6.html

    This project also skirts another thing here, the idea of connecting circuitry off of mains. You have isolated it, but it is very close to violating our Terms of Service.

    As is I will let it stand, but it will be discussed among the moderators.
     
  4. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    I just forget, do you really think that the mosfet will be happy with 350V on the gate? You need to limit that to 20V, anything above that will definitely kill the mosfet.
     
  5. Unixnut

    Thread Starter New Member

    Jun 29, 2008
    2
    0
    Wow, thanks guys! I didn't expect a reply so quickly! Or so informative :)

    I see, I guess it was too good to be true. It seemed too simple. I did read about using a triac and phase angles, but getting that to be uC controlled would be much more complicated (as things stand, the uC has a hardware PWM driver, and I've already written all the code to control it).

    Am what I'm attempting even feasible? I mean, i can probably do the following:

    * Smooth out the rectified supply with a capacitor, so to reduce any inductance/aliasing from the lights
    * use a potential divider to drop the op-amp voltage to ~70v. I presume I can use normal 1/4 watt resistors as this would be very low current?
    * If the mosfet really needs only 20V to at the gate, then I can drop the above to that, rather than 70v (in the datasheet, it specified gate V as +/-20V, which I thought meant 20V above or below mainsV).
    * Get a higher rated mosfet, At 325V, I guess a 500V would provide sufficient overhead?

    Is it possible? Or should I just abandon this idea? I'm not sure how much of my low-voltage knowledge can be used here (e.g. voltage dividers, good idea on these kind of voltages?)

    As for the ToS, I thought it would be ok, I mean, where else can I ask these kind of questions? I'm sure I'm not the only one doing something mains related, and I'd rather get the input of experts than make a mistake that could be costly to my health.
     
  6. cork_ie

    Member

    Oct 8, 2011
    348
    58
    Dimming Halogen lights = Not a good idea.

    Unless you are using special lamps designed for dimming you can expect a significantly shorter life and you will end up with nice dark bulbs which will be worse than candles.The Halogen cycle needs heat!!
    See http://en.wikipedia.org/wiki/Halogen_lamp
     
  7. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    The MOSFET spec say the 20V maximum is gate to source (Vgs) voltage, not gate to drain.

    You circuit should work if you limit the voltage to the opto coupler and the MOSFET gate. One way would be a series resistor and a zener to ground. Make sure to consider the power ratings of the resistor and zener. For example 300V will dissipate 0.9W peak power in a 100k ohm resistor.
     
  8. Wendy

    Moderator

    Mar 24, 2008
    20,766
    2,536
    They make solid state equivalents (read that LEDs) of Halogens. They even use the same part numbers, and they don't take to dimmers well.

    Come to think of it, a lot of Halogens use DC voltages. Are you sure these don't? What is the bulb part number.
     
  9. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    PWM is not the best way to control the power of a mains powered device.
    A phase cut system using a MOC and a triac will be better for AC mains.

    The circuit is now isolated from the mains using the opto coupler.
    A fuse must be used in the mains line to avoid the possibility of a short.

    As others also have said, it is not wise to dim a halogen bulb.
    When the temperature inside the bulb is to low, the metal will damp out on the quartz glass and make it black.

    Bertus
     
  10. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    I have used halogen lamps on a dimmer circuit and have noticed no significant darkening from operating them at a dim level (perhaps half brightness). It's likely that, at that brightness level, the filament temperature is too low to appreciably evaporate. Of course there may be some point, just below the maximum, where the filament may evaporate but the halogen cycle will not redeposit in on the filament, leading to blackening of the bulb. But if you operate the halogen at full brightness for a period of time, I think it will absorb any film on the bulb and re-deposit it on the filament.
     
Loading...