DanyR
Member level 3
- Joined
- Aug 23, 2015
- Messages
- 67
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 8
- Location
- Nieuwpoort, Belgium
- Activity points
- 677
230V AC dimmer, mains isolated, using P12F629
This is a very simple dimmer with a triac output (phase control). It uses timer0 to do the timing.
The code is written in mikroPascal.
The control part (here a P12F629) is competely isolated from the 230V mains supply:
- the zero crossing detector contains an optocoupler (4N25 or similar),
- the drive of the triac also contains an opto coupler (MOC3025 or similar). Be aware: the latter optocoupler should NOT have a zero cross detection!
The 5V power supply is not drawn in the schematic.
The ignition angle can be set in the example by setting the value of Tmr0 at the end of the zero crossing detection. The example uses only these 3 values, see the comments below:
Case Step of
0: Tmr0 := 0; // never ignite triac (delay > 10 ms)
1: Tmr0 := 140; // low value = long delay = late ignition = low power
2: Tmr0 := 175; // average power
3: Tmr0 := 250; // high value = short delay = high power
end;
Schematic:
Code:
This is a very simple dimmer with a triac output (phase control). It uses timer0 to do the timing.
The code is written in mikroPascal.
The control part (here a P12F629) is competely isolated from the 230V mains supply:
- the zero crossing detector contains an optocoupler (4N25 or similar),
- the drive of the triac also contains an opto coupler (MOC3025 or similar). Be aware: the latter optocoupler should NOT have a zero cross detection!
The 5V power supply is not drawn in the schematic.
The ignition angle can be set in the example by setting the value of Tmr0 at the end of the zero crossing detection. The example uses only these 3 values, see the comments below:
Case Step of
0: Tmr0 := 0; // never ignite triac (delay > 10 ms)
1: Tmr0 := 140; // low value = long delay = late ignition = low power
2: Tmr0 := 175; // average power
3: Tmr0 := 250; // high value = short delay = high power
end;
Schematic:
Code:
Attachments
Last edited by a moderator: