Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AC lamp dimmer circuit?

Status
Not open for further replies.
I'm sorry, I really don't know. I think I never change the default setting.
I use crystal 12 MHz for the minimum system.
 

Hi, I just change the clock to 12MHz and this is the result.
Is it correct ??

ZCD.png
 

Yes, it's correct.

Time/div is 2ms/div.

The zero crossing signals are spaced 5 divisions apart, so 10ms apart.
The width of the generated pulse (in blue) is 1 division wide, so 2ms. This is what you require.

So, it's the correct result. :smile:
 

:smile:
Thank you very much Tahmid, You help me a lot.

Next, go back to the main point.
I want to dim 3 AC lamps, with different intensity. So, is it enough to use only one ZCD circuit ?
and then what is the relation between ZCD with AC dimmer circuit ?
 

You can use phase angle control. For that, you need to fire the triac at a specific time after the zero-cross. The longer you wait before firing, the lower the brightness. And vice versa.

Since all 3 lamps will be driven from the same source, one zero-cross detection circuit is enough.
 

For that, you need to fire the triac at a specific time after the zero-cross.

Is there any regulation for that specific time or minimum and maximum time to fire the Triac ??
 
Last edited:

The time after which you fire will determine the output.

The duration to keep the triac on will depend on your drive current in the triac firing circuitry.
 

Hi, I understand the concept of ZCD and Phase Firing Angle already, but somehow I just did not yet find a way to implement the concept into the code since I'm not so good in programming.

Can you guide me to generate code to control the TRIAC firing if I connect the circuit to PORTB1 of ATmega8535 ?
Is it using delay, interrupt, or what?
I'm using codevisionAVR.
 

Hi I just try to make it and this is my code:

Code:
#include <mega8535.h>
#include <delay.h>

interrupt [EXT_INT0] void ext_int0_isr(void)
{
    PORTD=0x02;     // Output delay
    delay_ms(2);
    PORTD=0x00;
}


void main(void)
{
    DDRD=0x02;      // PORTD pin1 as output
    DDRB=0x01;      // PORTB pin0 as TRIAC input (MCU output)
    
    GICR|=0x40;     // Interrupt at PORTD pin2
    MCUCR=0x01;
    MCUCSR=0x00;
    GIFR=0x40;


#asm("sei")

PORTB = 0X01;       // initially triacs off

while(1)
{
while(PORTD.2 == 1) // zero crossing detected
{
PORTB = 0x01;
delay_us(500);
PORTB =0x00;
}
while(PORTD.2 == 0) // half cycle of ac reached
{
PORTB = 0x01;
delay_us(500);
PORTB = 0x00;
}
}
}


and here is the circuit:

Dim.png

Proteus simulation says time step too small and error.
Can you tell me what's wrong here?

Before I connect the dimmer circuit, everything is OK, but when it is connected -> ERROR.
This is what I got before dimmer is connected

Out.png

Is it correct???
 
Last edited:

nice circuit but i don't understand with Cde pin must connect to pin no at pic ? can u help tell me .. thanks... :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top