Maker Pro
Maker Pro

How to trigger triac from PIC

B

Barry

I want to use a PIC to control a triac in a dimmer circuit. The light in
the circuit works off 12v a.c. I've already built a circuit which can
power the PIC and an opto-coupled signal to provide the zero-crossover
detection but I'm not sure how to trigger the triac. The PIC is powered
by a standard bridge rectifier circuit from the 12v a.c. fed through a
7805 to give the 5v and the opto-couple gives a 5v square wave in sync
with the AC supply but I obviously can't connect an output pin from the
PIC directly back to the triac gate, so how would I do this.

Many thanks in advance for any advice.
 
A

Andrew Holme

Barry said:
I want to use a PIC to control a triac in a dimmer circuit. The light
in the circuit works off 12v a.c. I've already built a circuit which
can power the PIC and an opto-coupled signal to provide the
zero-crossover detection but I'm not sure how to trigger the triac.
The PIC is powered by a standard bridge rectifier circuit from the
12v a.c. fed through a 7805 to give the 5v and the opto-couple gives
a 5v square wave in sync with the AC supply but I obviously can't
connect an output pin from the PIC directly back to the triac gate,
so how would I do this.

Many thanks in advance for any advice.

Another opto-coupler?

You can get opto-isolated triacs in 6-pin DIL packages e.g.
http://www.web-ee.com/Electronic-Projects/data/moc3021.pdf
 
C

ChrisGibboGibson

Barry said:
I want to use a PIC to control a triac in a dimmer circuit. The light in
the circuit works off 12v a.c. I've already built a circuit which can
power the PIC and an opto-coupled signal to provide the zero-crossover
detection but I'm not sure how to trigger the triac. The PIC is powered
by a standard bridge rectifier circuit from the 12v a.c. fed through a
7805 to give the 5v and the opto-couple gives a 5v square wave in sync
with the AC supply but I obviously can't connect an output pin from the
PIC directly back to the triac gate, so how would I do this.

Many thanks in advance for any advice.

Check out MOC3011/3021

Made for just that purpose.

Gibbo
 
M

mike

Barry said:
I want to use a PIC to control a triac in a dimmer circuit. The light in
the circuit works off 12v a.c. I've already built a circuit which can
power the PIC and an opto-coupled signal to provide the zero-crossover
detection but I'm not sure how to trigger the triac. The PIC is powered
by a standard bridge rectifier circuit from the 12v a.c. fed through a
7805 to give the 5v and the opto-couple gives a 5v square wave in sync
with the AC supply but I obviously can't connect an output pin from the
PIC directly back to the triac gate, so how would I do this.

Many thanks in advance for any advice.

As I recall, there's just such an ap note on light dimmers at the
www.microchip.com
mike

--
Return address is VALID.
500MHz Tek DSOscilloscope TDS520
Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121
Bunch of stuff For Sale and Wanted at the link below.
http://www.geocities.com/SiliconValley/Monitor/4710/
 
R

Robert Monsen

Barry said:
I want to use a PIC to control a triac in a dimmer circuit. The light in
the circuit works off 12v a.c. I've already built a circuit which can
power the PIC and an opto-coupled signal to provide the zero-crossover
detection but I'm not sure how to trigger the triac. The PIC is powered
by a standard bridge rectifier circuit from the 12v a.c. fed through a
7805 to give the 5v and the opto-couple gives a 5v square wave in sync
with the AC supply but I obviously can't connect an output pin from the
PIC directly back to the triac gate, so how would I do this.

Many thanks in advance for any advice.

Search on the microchip site for PICREF4, which is a PIC based design
for a dimmer. They connect an output to the triac gate through a 470 ohm
resistor!

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.
 
C

CFoley1064

Subject: How to trigger triac from PIC
From: Barry [email protected]
Date: 10/18/2004 3:07 PM Central Daylight Time
Message-id: <[email protected]>

I want to use a PIC to control a triac in a dimmer circuit. The light in
the circuit works off 12v a.c. I've already built a circuit which can
power the PIC and an opto-coupled signal to provide the zero-crossover
detection but I'm not sure how to trigger the triac. The PIC is powered
by a standard bridge rectifier circuit from the 12v a.c. fed through a
7805 to give the 5v and the opto-couple gives a 5v square wave in sync
with the AC supply but I obviously can't connect an output pin from the
PIC directly back to the triac gate, so how would I do this.

Many thanks in advance for any advice.

Hi, Barry. If the commom of the 12 VAC is at the same potential as the PIC
common, all you need are two resistors to trigger a low gate current TRIAC
(view in fixed font or M$ Notepad):


12 VAC Phase 1
o-------------------------------------.
|
VCC |
+ |
| |
.---o----. |
| | |
| | .-.
| | ( X )
| | '-'
| PIC | |
| | ___ |
| P0o---|___|-o--. |
| | 470 | | _|_
| | .-. | V_A
| GND | | | '------/ |
'---o----' 470| | |
| '-' |
| | |
| | |
o----------o--------------o-----------'
12 VAC Phase 2
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

This is good for ON/OFF control of a lamp load. You have to make sure to use a
low gate trigger current triac (also called a logic triac), like the TECCOR
L2008L6. This triac is in a TO-220 package, can switch 8 amps, and only
requires a gate current of 5 mA for all quadrants.

It gets a little stickier if you want to do phase control of the load, like a
lamp dimmer. You will need some way to determine the zero crossing of phase 1
in the diagram above, then you can use the PIC to time the wait for the pulse
to the triac. A quick cut would give you something like this:

2.2K
1N914 ___ To PIC Input Pin
o ->|--|___|-o---------o
12VAC |
1N4732 /-/
Vz = 4.7V ^
|
===
GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

This will give you the positive zero crossing and, with a little software, the
negatrive zero crossing. Just remember that the logic signal will go high a
few degrees past zero crossing on the positive side, and a bit before the zero
crossing on the negative side. Using this, you can time the triac trigger so
that you can control the load. You want to be careful from a practical
standpoint in watching for voltage drops on the load interfering with the PIC.
Try a "star" ground between the 12VAC and the PIC power GND.

If the 12VAC is at a different potential than the PIC common, try a triac
trigger optocoupler.

Good luck
Chris
 
Top