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.

Lamp dimmer circuit check

Status
Not open for further replies.

kybert

New Member
Hi,

It's been quite a while since i've done any hardware design, so would like to get some comments from the experts here.

The circuit uses 220VAC 50Hz, UK mains.

The circuit impliments an automatic dimmer switch, with a PIC controller at the heart going all the controlling etc., dimming from full on to full off in 16 steps, using a time delay after the zero-cross point (controlled by the PIC).

There are 3 areas of concern that i would like advice for;

1>
The mains cross-over zero detector circuit, in the middle-left of the diagram, made up of D2 and R3.

The theory here is that the PIC inputs have a current requirement of 33uA, so, for 5V input:

R = (12V - 5V - 0.6V) / 33u
= 6.4 / 33u
= 200k

Is this correct? The diode is to block the AC, therefore the PIC will get a change of state on the input pin every cross-over. The PIC inputs are protected internally against over and under voltage via protection diodes.

2>
The mains detection circuit, to the left of the diagram.
The mains 220VAC current is limited by R6/R7 (20k in total) then powers the AC opto-coupler.

The opto has a Vf of 1.5V, so to get 15mA current into the LEDs:

(1.414*220)-1.5
----------------
15mA

= 309.58 / 15mA
= 206k (200k)

The opto output then drives a transistor switch and the switching ripple is suppressed by the cap C8 (as the AC goes to zero, the LEDs will go off). I guessed a value for C8, is it about right?
This output is then fed to the PIC, and should be +5V when 220VAC is present, and 0V when the 220VAC is missing.


3>
The last part is the MOC3020 triac driver, and the L1 / C6 suppression circuit.
I'm using a BT136-600D triac, rated at 4A. Im expecting to switch no more that 3A.
Is this triac driver and suppression correct?
 

Attachments

  • circuit.jpg
    circuit.jpg
    97.5 KB · Views: 4,514
What's TR1's nominal output voltage?

If it's 12V the output voltage will be 12√2 - 1.4V which is 16V.

What does D1 do?

At the moment the zero crossing unit will detect only one polarity so it'll only detect every other zero crossing. Does the software allow for this?

If you want to detect every zero crossing then move C1 and the +12V input to the other side of D1 and move the zero crossing input to D1's anode.

Here's an example of a voltage controlled phase control dimmer I designed awhile ago.
https://www.electro-tech-online.com/attachments/dimmer-pdf.11686/
 
Last edited:
kybert said:
The circuit uses 220VAC 50Hz, UK mains.

One point you should perhaps be aware of?, the UK uses 240V 50Hz mains, it's never used 220V - although the rest of Europe did or still does?.

The EU standardised on 230V 50Hz mains a number of years ago, although I don't know if any countries actually changed voltages?, as both 220V and 240V fall within the allowed tolerance. So basically it just means units are designed for nominally 230V, and will work on either 220V or 240V.
 
The transformer is a 3VA 12V output.


Not sure what D1 does? I've just always done split supplies like that, maybe its not needed.

The zero-cross:

The PIC is setup to detect a change on the input pin, so when the input chages from high to low, or low to high, the PIC intrrrupts and this is then the zero-cross point.

D2 passes the +ve cycle, and the PIC interrupts as the voltage moves up from zero, then it interrupts again when the +ve cycle goes back to zero.

D2 then blocks the -ve cycle, and the PIC interrupts when the +ve cycle moves above zero.

If im correct, then all zero-crosses should have been detected?
 
Yes, you're right, the pulse goes on when the waveform goes positive and off when it goes negitive. I was thinking about it giving you a negitive pulse every zero crossing point which you don't need.

D1 isn't required as it doesn't actually do anything useful.

Also, I forgot to say that that little 3V transformer's regulation is crap so you'll have more than 16V on the output, it might be as high as 19V possible 20V. I would make sure that C1, C2 and C3 are rated to at least 25V or they might not last long!
 
Good catch with the transformer! How did you know which one i was using from the svchmatic?! lol

Its RS part No 456-0635 and its regulation is 25%, which, as you say, really is crap.

The 12V supply line needs to be fairly steady because its used to power the PIR Sensor...

Any thoughts on the 'mains sensor active detect' section? I guessed the value of C8, i dont have any programs to simulate stuff.

This is for a home project, but would like to get it right 1st time
 
kybert said:
Good catch with the transformer! How did you know which one i was using from the svchmatic?! lol
You said it's a 12V 3VA transformer.

Its RS part No 456-0635 and its regulation is 25%, which, as you say, really is crap.
Small transformers always have crap regulation and they're not very efficient either.

The 12V supply line needs to be fairly steady because its used to power the PIR Sensor...
Check the rating on the datasheet to see if it can handle 20V and use an additional voltage regulator if it's not good enough.

EDIT:
Just another thing, if you're going to use an LML7812 then I'd increase the filter capacitor to 470:mu:F or even 1000:mu:F depending on the PIR's current draw so the ripple and regulator's dropout voltage aren't an issue. Also if you're adding another regulator you really need to get rid of D1 as you can no longer afford the voltage loss here.

Any thoughts on the 'mains sensor active detect' section? I guessed the value of C8, i dont have any programs to simulate stuff.
What's the purpose of the 'mains sensor active detect' section?

This is for a home project, but would like to get it right 1st time
Unfortunately that often means checking it a dozen times but it's well worth the trouble.
 
Last edited:
What's the purpose of the 'mains sensor active detect' section?
Its an input to the PIC from an external twilight sensor. The sensor switches 230VAC, so that bit of the circuit converts the mains 230VAC to 5VDC using an opto, and a smoothing cap.

I've removed D1, and changed C1, C2 and C3 caps to 50Vdc, and bumped up the values. This should solve the ripple problem.

The sensor requires 12-13Vdc at 20-30 mA, so i've also added a 12V, 100mA regulator.

I have changed the transformer to the next size up, 2 x 9V, 3VA, giving the regulators an 18V supply. I didnt run the 5V reg from the output of the 12V reg as this would increase the 12V regs output requirments, its only a 100mA reg!

I need to check to see if 100mA on the 5V rail is going to be enough. With all the optos and leds, looks like its going to be close.



I really dont mind how many times i have to change the circuit, as long as when i pay to get the board made (dont really fancy 230VAC on stripboard!) it comes back ok.
 

Attachments

  • circuit try 2.jpg
    circuit try 2.jpg
    105.3 KB · Views: 812
Last edited:
Powing the LM78L05 from the LM78L05 from 30.4V derived from the transformer is not a good idea if you want 100mA out of it as the power dissipation is far too high.

Use the centre tap in the transformer to power the LM7805 to avoid the excess power dissipation.

Using a higher voltage will also reduce the ripple problem so you can now use smaller capacitors, two 220:mu:F capcitors in series with the centre tap connected between them would do.
 
Hi,

I've decided to change the LM78L12 to a 7812, 1A version, and drive the 78L05 from the 7812 regulated output. This saves on a few caps and a 2nd bridge rectifier.

Attached in the new schmatic, It uses a 220uF/50V cap to smooth the 18VAC.
 

Attachments

  • circuit try 3.jpg
    circuit try 3.jpg
    121.1 KB · Views: 815
kybert said:
I've decided to change the LM78L12 to a 7812, 1A version, and drive the 78L05 from the 7812 regulated output.
Good idea.

This saves on a few caps and a 2nd bridge rectifier.
Just for future reference, you wouldn't have needed another bridge rectifier and capacitor.
 

Attachments

  • circuit try 3.gif
    circuit try 3.gif
    161.2 KB · Views: 767
OK, so the power supply is finished. Can anyone make any further comments on the rest of the circuit before i begin layout?
 
Last edited:
I've just finished the PCB layout and would like any final thoughts before i send it off to get it made.
 
It all looks good to me.

Have you written the software too?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top