Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Here is my problem

I've built my own home automation by using some relays, driven by 12V AC (read Alternating Current) to switch them.

Now i want to use my raspberry's GPIO pins to switch these relays.

-The GPIO pins deliver 3.3V DC

-My relays need 12V AC to switch

As far as i know i can't use a transistor because it only works for DC?

Is there any solution to this? And i prefer not using any other power source but my raspberry and the 12VAC i already have.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

As far as i know i can't use a transistor because it only works for DC?

You are correct on not directly using single transistor to drive an AC relay.

You will likely need to use a TRIAC, or additional smaller relay to drive your 12 VAC relays. You can find lots of help over in "Electrical Stack Exchange" regarding smaller relays and triacs, such as this Triac Driver Circuit

The linked page describes using 120 VAC, however, if you follow the comments and answers the circuit will work for your 12 VAC. enter image description here

share|improve this answer
    
I've done some research about TRIACS and what do you think about this? TRIAC i found: I max = 0.8A (this should be enaugh for switching a relay) IGT (Q1) 3 to 25 mA GPIO delivers 3.3V and the TRIAC gate wants between 3 and 25mA (if i am correct?) So the resistor for the gate: 3.3/0.025=132ohm So i will user a resistor of 220ohm maybe? –  PiBuster Jun 14 at 15:16
    
Use 3.3 volts for calculating resistor R1 (assume 12mA for LED). 3.3v-1.2v/.012 = 175 ohms. For other side of the optocoupler, use 12 VAC for all calculations. –  Marla Jun 14 at 16:38
    
Why the 3.3v-1.2v? –  PiBuster Jun 14 at 22:00
    
The Led has a typical voltage drop of 1.2v at 12mA. Remaining voltage is across the resistor –  Marla Jun 14 at 22:03
    
@PiBuster . I did some further research. I am astounded that I could NOT find an add on board for RPi that has relay contacts output for high level AC switching. I use the "Gertboard" for many applications, but it only uses transistor buffers for switching of DC relays. The Triac circuit I suggested does require the user to build quite a bit of extra circuitry. Perhaps others know of a commercially available (multiple relay) board. –  Marla Jun 14 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.