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.

[SOLVED] AC Dimmer Using TRIAC

Status
Not open for further replies.

Mohamad Syazwan

Newbie level 3
Joined
May 16, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
31
Can someone help me with the code
I already have the hardware and code it with arduino
but i want to try it using pic16 using mikroC or mikrobasic
can someone help me regarding the code
this is my schematic diagram that i'm using
Untitled.png

this is the arduino code

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
int AC_LOAD = 3;    // Output to Opto Triac pin
int dimming = 128;  // Dimming level (0-128)  0 = ON, 128 = OFF
 
void setup()
{
  pinMode(AC_LOAD, OUTPUT);// Set AC Load pin as output
  attachInterrupt(0, zero_crosss_int, RISING);  // Choose the zero cross interrupt # from the table above
}
 
//the interrupt function must take no parameters and return nothing
void zero_crosss_int()  //function to be fired at the zero crossing to dim the light
{
  // Firing angle calculation : 1 full 50Hz wave =1/50=20ms 
  // Every zerocrossing thus: (50Hz)-> 10ms (1/2 Cycle) 
  // For 60Hz => 8.33ms (10.000/120)
  // 10ms=10000us
  // (10000us - 10us) / 128 = 75 (Approx) For 60Hz =>65
 
  int dimtime = (75*dimming);    // For 60Hz =>65    
  delayMicroseconds(dimtime);    // Wait till firing the TRIAC
  digitalWrite(AC_LOAD, HIGH);   // Fire the TRIAC
  delayMicroseconds(10);         // triac On propogation delay (for 60Hz use 8.33)
  digitalWrite(AC_LOAD, LOW);    // No longer trigger the TRIAC (the next zero crossing will swith it off) TRIAC
}
 
void loop()  {
  for (int i=5; i <= 128; i++){
    dimming=i;
    delay(10);
   }
}

 
Last edited by a moderator:

Maybe you could say something about whats happenining when you run the code?
 

LED Bulb Dimming with Triac

I had designed the dimming circuit with TRIAC.By changning conduction angle of triac using PWM signal,I can change the luminance of bulb.That means dimming.I have used the snubber circuit also to prevent the damage of the triac from the instant transcient of power supply.


I am using the dimmable bulb as a AC Load for dimming test of my circuit.I can able to dim my bulb.But sometimes I am getting flickering in the bulb.

So,I tried to capture the input power supply.I realized that is because of power supply.

Is there any other way to control the power supply with smoothing manner to get non-flickering effect while I am dimming the bulb. ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top