- #1
TheRedDevil18
- 408
- 1
I need to build a light dimmer using the PWM on the microcontroller to dim an incandescent 60W bulb. What would be the simplest way to do it ?, any suggestions ?, would a optocoupler and triac suffice ?
You will need two optocouplers. One to sense the zero-crossings of the AC Mains signal, and one in the other direction to trigger the triac at whatever angle is appropriate for the brightness level. Can you use Google Images to find some typical circuits like this with the isolated uC controlling the dimming, and post them here for discussion?TheRedDevil18 said:I need to build a light dimmer using the PWM on the microcontroller to dim an incandescent 60W bulb. What would be the simplest way to do it ?, any suggestions ?, would a optocoupler and triac suffice ?
If your control pulses are not synchronised to be in step with the mains waveform, then the intensity of the light will show variations with time, which we perceive as annoying flicker.TheRedDevil18 said:What would be the need for the zero crosser if I know the AC mains frequency
The light needs to be in series with the triac...TheRedDevil18 said:Guys, I tried building the circuit, here's the schematic:
View attachment 106043
So bascially, the bottom optocoupler (U5) is the zero cross detector which will send a pulse to pin 3 when a zero is detected and fire an interrupt. This interrupt will trigger a timer which will fire the second optocoupler(U7) when the timer has elapsed (Brightness level will determine the time delay)
Now for my question, I want to know if I connected everything fine before I start the coding, especially the triac part, I am unsure about that
Ah, you're right. The "ground" symbol between the triac and the light confused me. The ground symbol needs to be removed, especially if it is meant to be the same as the ground symbol shown on the SELV side of the optos.Windadct said:As I read this, the triac is in series with the bulb.
Actually, what you need to do is be sure that the opto pullup voltage and the "ground" for the triac are different symbols from the SELV versions. I see now that you want a reference voltage for the triac trigger, which is fine. I think I would reference it to Neutral as a low-side switch, though... How are you making the opto pullup voltage for the triac?berkeman said:The ground symbol needs to be removed, especially if it is meant to be the same as the ground symbol shown on the SELV side of the optos.
Wouldn't the MCU be measuring VCE on the transistor ?, so if their is a zero, the transistor would be off and VCE would be 5V and if its on, VCE would be 0VWindadct said:also in this set up the zero cross signal to the uC will be normally high, and you will turn off at the 0 ceross
TheRedDevil18 said:Igt = 3mA, so if I calculated the resistor value for peak voltage and 30mA current
R = Vpeak/I = 230/30mA = About 8k
But now let's say the triac is triggered when the AC voltage is 10V
I = V/R = 10/8k = 1.25mA
But since Igt is 3mA, the triac won't turn on
If I try choosing higher currents, the resistor power increases
Right now it's sitting at
P = I^2 * R = 0.03^2 * 8k = 7.2W peak power
i think my one inch suggestion was way overboard. Some of our equipment used resistors that big to protect against 480 volts...TheRedDevil18 said:And what type resistors should I be using ?, thick film ones ?
i've used MDL for some high inrush loads. You'd probably be fine with a 1 amp MDL.https://en.wikipedia.org/wiki/Incandescent_light_bulb
Current and resistance
The actual resistance of the filament is temperature dependent. The cold resistance of tungsten-filament lamps is about 1/15 the hot-filament resistance when the lamp is operating. For example, a 100-watt, 120-volt lamp has a resistance of 144 ohms when lit, but the cold resistance is much lower (about 9.5 ohms).[57][107] Since incandescent lamps are resistive loads, simple phase-control TRIAC dimmers can be used to control brightness. Electrical contacts may carry a "T" rating symbol indicating that they are designed to control circuits with the high inrush current characteristic of tungsten lamps. For a 100-watt, 120-volt general-service lamp, the current stabilizes in about 0.10 seconds, and the lamp reaches 90% of its full brightness after about 0.13 seconds.[108]
TheRedDevil18 said:Not too sure, what do you think ?, is it fine ?
Not too sure if they even have fuses with those current ratings, I googled a few and they did come up though
PWM (Pulse Width Modulation) is a technique used to control the amount of power supplied to a light source. It works by rapidly turning the light on and off, with the ratio of on-time to off-time determining the perceived brightness. A longer on-time results in a brighter light, while a longer off-time results in a dimmer light.
The simplest PWM light dimmer requires a microcontroller, a MOSFET transistor, a resistor, a potentiometer, and a power source. The microcontroller generates the PWM signal, the MOSFET acts as a switch to control the power to the light, the resistor limits the current, the potentiometer adjusts the duty cycle, and the power source supplies the necessary voltage.
Building a basic PWM light dimmer is not difficult, as it only requires basic electronic components and some knowledge of programming. However, it can become more complex when trying to control multiple lights or integrating it into a larger system.
PWM light dimmers offer several advantages over traditional dimmers. They are more energy-efficient, as they do not dissipate excess energy as heat. They also provide a smoother and more precise dimming control, as the duty cycle can be adjusted in small increments. Additionally, they have a longer lifespan as they do not have any mechanical components that can wear out over time.
In general, PWM light dimmers can be used with most types of light sources, including incandescent, LED, and fluorescent lights. However, some light sources may require additional circuitry or modifications to work properly with a PWM dimmer. It is always recommended to consult the manufacturer's specifications before using a PWM dimmer with a specific type of light source.