Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Mains Voltage Light Bulb Dimmer

Status
Not open for further replies.

Wp100

Well-Known Member
Hi,

Been trying to help a friend out with a circuit, but its not something I have worked on myself so seeking some good advice.

They want to use an AC bulb, around 240v 100w, from a triac dimmer controlled by an Arduino and have found that a typical SSR module, the Zero Crossing type does not produce an even brightness.

Seems they have tried other suggested cicuits from the web including a Non Zero Crossing type without success.

Not being there I cannot say why none them worked, but if someone could provide a proven circuit to give true dimming it would be much appreciated.
 
You wouldn't normally use an SSR for dimming, bit of a silly idea.

You'd use a plain TRIAC, probably fed through an opto-isolator, and a zero-crossing detector (again isolated) to feed the Arduino.

However, this is the 21st Century, and incandescent bulbs are history - so bit of a pointless project.

But there are loads of examples on-line, here's one such example:

 
Thanks Nigel,

Should have said its for use with Reptile heating bulbs etc.

Will pass that link on.
 
I "successful;y helped" someone build a triac dimmer on AAC (Motor though).

You need a "zero cross" detection circuit, that's pretty good.

A triac turns off at zero voltage and zero current. You will also be dealing with "half cycles". You will be dealing with "half-cycles". The circuit should probably "measure the line frequency"

What I don't know how to deal with is instantaneous "current limiting" and Tungsten loads, nor power limiting. This **broken link removed** isn;t as bad as I thought. You need to massage this into a voltage^2 vs power curve probably.

Your "best" bet is to pulse the triac continuously on at "intervals". A motor would turn off at zero voltage and zero current and they won;t be in the same place in time.

Your triac will have a max-turn on time and min-turn-off time. That's the basis of your timers.

You can think of your external device as a "voltage controller", "power controller for a resistive load" and "power controller for tungsten loads".

For a "resistive load" you need to massage that into what phase angle I have to fire at to get what % of power. You can assume v(t) = sin(wt); Your only interested in 0 to PI or one 1/2 cycle.

So, you then need a table of Ave V^2 vs phase angle. Higher phase angles mean less power. You'llindex into hat table as 0-100% and find the phase angle to fire at.

With a tungsten load, you should factor in the resistance change too.

So, just don't know how limiting stuff would work nor do I know how line voltage compensation works. You may not need them anywa.

here is a blurb: https://www.eurotherm.com/power-control-articles-us/thyristors-and-transformers/ and https://www.coursehero.com/file/pjk...iparallel-SCRs-1-Triacs-have-low-dvdt-rating/

Here https://www.eurotherm.com/products/power-control-us/power-controllers-us/efit-scr-power-controller/ is a typical controller.
These would normally be "configured" and I believe accept a process input of 0-20, 4-20 mA is common.

This one https://iseinc.com/_shop/pf1-scr-power-control-15-70a.html is kinda-dumb

All require a good zero crossing detector. Resistive loads without current limiting is the easiest. Soft-start you can handle with PID.
many times dual SCR's are used rather than a single triac. I^2t fuses as well as regular fuses. Lamps can fail shorted. I had that happen with an incadesent line powered lamp and a headlamp in a car.

This https://iseinc.com/_shop/pf1-scr-power-control-15-70a.html suggests
When the optional current limiting is utilized this model can be used with heaters that have a significant change in resistance during heat up. Other common applications for this model include IR heating and vibratory feeders.
[end quote]



==

PID is easy to do in software. You can add what I call max dp/dt or the maximum Pout can change per (cycle) or per second. P is generally the output of -100 to +100% for a heat/cool controller.

You have to prevent reset wind-up. The reset term has to be limited to 100% or lower.

You can limit Pout or you can limit the maximum error.

So, there is a lot to it.

Back in the 1980's , me and co-worker did a really cool 7 channel PID system with recipies in FORTRAN on a real time operating system.
It was a really cool project for in-house use. I never implemented auto-tuning.

We used Eurotherm controllers into transformers when I came on board. I made changes to increase the reliability of those systems by using oversized SCR units and load fuses sized for the load. I made sure all had the current limit option fitted. I standardized our panel.

Later, I moved to DC power supplies and a programmable ramp/soak controller. Now power could be computed automatically/

Later yet, temperature logging was built through an RS485 interface.

The powers that be would not allow a $500 interface for V and I for each power supply. that $3500 USD more just to make I and v available as 0-5V voltages.

Another cool thing i did was controlled the temperature of a probe in an environmantal chamber by amnipulating the propotional band of the built-in controller. So, -100 to 100% of my external controller (used the IEEE-488 interface) was the measured value of the chambler +-10 degrees. Fun stuff.

So, for reptiles, you really need the phase angle firing. Use an I^2t fuse with a load fuse. try to implement tungsten loads. Implement soft-start in the PID algorithm.
 
I "successful;y helped" someone build a triac dimmer on AAC (Motor though).

You need a "zero cross" detection circuit, that's pretty good.

A triac turns off at zero voltage and zero current. You will also be dealing with "half cycles". You will be dealing with "half-cycles". The circuit should probably "measure the line frequency"

What I don't know how to deal with is instantaneous "current limiting" and Tungsten loads, nor power limiting. This **broken link removed** isn;t as bad as I thought. You need to massage this into a voltage^2 vs power curve probably.

Your "best" bet is to pulse the triac continuously on at "intervals". A motor would turn off at zero voltage and zero current and they won;t be in the same place in time.

Your triac will have a max-turn on time and min-turn-off time. That's the basis of your timers.

You can think of your external device as a "voltage controller", "power controller for a resistive load" and "power controller for tungsten loads".

For a "resistive load" you need to massage that into what phase angle I have to fire at to get what % of power. You can assume v(t) = sin(wt); Your only interested in 0 to PI or one 1/2 cycle.

So, you then need a table of Ave V^2 vs phase angle. Higher phase angles mean less power. You'llindex into hat table as 0-100% and find the phase angle to fire at.

With a tungsten load, you should factor in the resistance change too.

So, just don't know how limiting stuff would work nor do I know how line voltage compensation works. You may not need them anywa.

here is a blurb: https://www.eurotherm.com/power-control-articles-us/thyristors-and-transformers/ and https://www.coursehero.com/file/pjk...iparallel-SCRs-1-Triacs-have-low-dvdt-rating/

Here https://www.eurotherm.com/products/power-control-us/power-controllers-us/efit-scr-power-controller/ is a typical controller.
These would normally be "configured" and I believe accept a process input of 0-20, 4-20 mA is common.

This one https://iseinc.com/_shop/pf1-scr-power-control-15-70a.html is kinda-dumb

All require a good zero crossing detector. Resistive loads without current limiting is the easiest. Soft-start you can handle with PID.
many times dual SCR's are used rather than a single triac. I^2t fuses as well as regular fuses. Lamps can fail shorted. I had that happen with an incadesent line powered lamp and a headlamp in a car.

This https://iseinc.com/_shop/pf1-scr-power-control-15-70a.html suggests

Hardly keeping to your 'name' are you :D - that's probably one of the most confusing and utterly unhelpful posts I've ever seen here - and almost all of it totally irrelevant.
 
Most of us were reptiles today with extreme heat weather in Europe and in North America. I liked it.
 
Hi All,

Well for a week now I have been following my friends woes with trying to make a diy ac dimmer from the various web tutorials and he found that none of them worked as described.

Seems a combination of resistor values and software timings can affect things.

Me thinking it cannot be that difficult decided to order a couple of bits, only to come up against the same problems.

In his frustration at those triac designs, he decided to take a different line and try a mains rectified high voltage DC pwm mosfet ciruit to drive the 230v 50w IR projector bulbs.

Seems a lot written about driving incandescent bulbs this way, but are there any downsides to doing such a circuit eg bulb life etc ?
 
Hi All,

Well for a week now I have been following my friends woes with trying to make a diy ac dimmer from the various web tutorials and he found that none of them worked as described.

Seems a combination of resistor values and software timings can affect things.

Such devices are simple and commonplace, as in the millions of old style dimmers still in operation.

If you can't get them to work?, what are you doing wrong? - are you using the correct components and values?.

Using DC PWM is likely to far more complicated and difficult to get working, and require a great deal more filtering to prevent interference.
 
Where I worked we wound low voltage tantalum heaters for use in a process done in a vacuum. When I converted some systems from phase angle firing into a variac to DC, heater lifetime improved significantly.

==

This https://www.elprocus.com/power-control-using-scr/ isn't a bad explanation, except for the last few paragraphs.

They mention zero cross and controlling the SCR with pulses which is good. They used dual SCR's rather than a Triac. It's important to use pulses with motors.

The first thing you need a good zero-crossing detector.

With two SCR's the firing angle varies from 0-180 degrees, HOWEVER, your 0-100% signal would not be a linear relationship of firing angle.
It should be more of a table of.

0-100%("power"), Firing angle, delay time@Line freq, RMS(V)^2(normalized)
0
1%
2%

The table is a little messy to create. Since V^2 is proportional to power, use V^2 and not the RMS value of voltage directly.
Firing angle works for all frequencies. The delay time is line frequency specific and it;s when you start applying pulses after the zero cross detection.

Your also getting contributions from both the upper and lower half cycles.

This RMS(V)^2(normalized) column is a bit more difficult. P=V^2/R, so P is k*(V^2) so just make k=1 and normalize to the line voltage. e.g. at line voltage (240^2) is the max value, which is 1. it doesn;t matter what the line voltage, is because time and phase angle won;t change..

Typically it's a resistive heating load so R is constant. If your using a lamp to heat, you should convolute the effects of resistance temperature change.

Finally, you should implement slow start.

What I don't know is if both SCR's are fired simultaneousy. I suspect they are. Only one will conduct.

Current limiting needs to be implemented if operating into an inductive load. Not sure how that is done. It might just stop the gate pulses for the rest of the cycle.

So, 50% power output does occur at 90 degrees, but 75% power does not occur at 90+(90/2) for a resistive load.

Caveot: If you pulse and accidently include the next zero crossing, you end up applying 100% voltage.

Aside:
Some, usually stand-alone controllers can control V, I, R or P and do line voltage compensation for a 0-100% input.

Initially try to control at say 0, 45, 90, (90+45) and 178 degrees just by a single pulse and look at the output on a scope. then add a stream of pulses at a fixed frequency.

M`easure the frequency and change modify the timing.

Now add 0-100% in V and use an RMS meter to see how your doing. Now add 0-100% in RMS(V)^2 and finally try to add the effects of a tungsten load which has about a 10-15x lower resistance when it's cold.

Maybe I've explained things better this time.

--

A high quality zero cross detector: https://cdn.hackaday.io/files/1597066832861504/SimpleIsolatedZeroCrossDetector.pdf
 
Last edited:
Hi Again

Well hanging head in Shame :sorry:

Had chance to scope the signal and found it was all down to one bad connection !!

Once that was corrected it worked perfectly :)

That does rather make me wonder with all those days of building and testing, what was my friend doing wrong ?

His aim is to control 4 bulbs independently and seems there is code around for doing just that, which I will try and test out as well or modify this existing code.

Thanks again.

Project used - Pot version only - https://www.electronoobs.com/eng_circuitos_tut20.php
 
Last edited:
Hi Again

Well hanging head in Shame :sorry:

Had chance to scope the signal and found it was all down to one bad connection !!

Once that was corrected it worked perfectly :)

That does rather make me wonder with all those days of building and testing, what was my friend doing wrong ?

His aim is to control 4 bulbs independently and seems there is code around for doing just that, which I will try and test out as well or modify this existing code.

I'm presuming he's wanting light as well as heat?, hence the use of bulbs - if he was just using heaters (so no light output), he could use burst-fire control - basically just ON for so many cycles, then OFF for so many cycles. The thermal inertia of the heater averages it out - but a bulb would flash of course.


Just like to say, that's a really nice web page - very informative, and explains what's going on.

I was particularly amused by the use of a pot to control the brightness, basically replacing a few cheap components in a normal dimmer, with more expensive and larger components to do the same job. Obviously the point isn't to use a pot, but if I was doing that (even as a demonstration) I'd have used UP and DOWN buttons, just to get away from the usual dimmer control :D

One extra point - I don't like his zero-crossing isolator, as it feeds from the emitter - as always it's best to feed from the collector, with a resistor to 5V, and the emitter to 0V. It would be inverted from his existing circuit, but should give better zero-crossing pulses.
 
Hi,

The bulbs are - https://www.arcadiareptile.com/heating/heat-projector/

He tells me that those bulbs , do produce some visible light, contrary to the makers claim , so seems a burst /fire type of control, that he uses with his Ceramic disc IR heaters, could cause the projector bulbs to produce visible flashes ?? - hence his quest for dimmer control.

Sure he could offer more info, but his pc is down and like me not one for long messages on the Moby

Yes, had noticed the unusual emitter feed, most designs do use the collector as you say.

Thanks again.
 
It's a fairly common design error

There is no "error" - the opto is a totally floating switch, it makes no difference whatsoever which rail it is switching from.

An emitter output is usually an error where the base drive voltage causes the output to be limited, but there is no such restriction with a floating switch such as that.

You would not give it a second thought if it were a mechanical switch contact in the same configuration with a resistor to 0V.
 
The code does phase angle vs pot position and only does a single turn on not a series of pulses.

1. You won't get really good brightness control based on pot position.
2. linear Quazi Power control you don't get.
3. The Zero cross detector is poor.

So, it's like poor frequency response speakers to cover up a hissy radio, so the "system" works". You upgrade the speaker and you get hiss.

And part of the real problem was the factory car radio was designed for use with an antenna amplifer.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top