niss
Posts: 1
Joined: Mon Jul 02, 2018 9:27 am

Controlling 220 volt with raspberry pi

Mon Jul 02, 2018 9:36 am

Hello,
I have a raspberry pi 3 and i just started using GPIO pins. So far, i have managed to control Led light. Now i want to control higher voltage. I want to control a 220 voltage with the raspberry pi, but in order to do that there has to be a relay in the circuit. My question is: Is the relay of 5V enough if i connect a source of 220V or do i need to add multiple one in order to control the 220V ? Thank you.

User avatar
DougieLawson
Posts: 33314
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Controlling 220 volt with raspberry pi

Mon Jul 02, 2018 10:27 am

Go and seek advice from a qualified electrician. You can kill yourself or burn down a house with 220V.

The way we're switching mains is to switch a relay with 5V using an MCP23017 I2C chip on the Raspberry. That relay switches 12V (which we can connect with CAT5 cables). Then very close to the mains load, we'll switch 230V with a secondary relay.

That's safer because nothing higher than 12V is anywhere near the Raspberry. The cables from the raspberry to the load are 12V only. The cables from mains to relay to load are short.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Controlling 220 volt with raspberry pi

Mon Jul 02, 2018 10:19 pm

niss wrote:
Mon Jul 02, 2018 9:36 am
Hello,
I have a raspberry pi 3 and i just started using GPIO pins. So far, i have managed to control Led light. Now i want to control higher voltage. I want to control a 220 voltage with the raspberry pi, but in order to do that there has to be a relay in the circuit. My question is: Is the relay of 5V enough if i connect a source of 220V or do i need to add multiple one in order to control the 220V ? Thank you.
If you need to ask a question like that you are not experienced enough to be playing with mains circuits. It's dangerous to you and people around you.

For safety:

1. All components must be verified as suitable for the voltages and currents concerned. That means looking up their manufacturers specifications, and also confirming the component in question has been independently tested to meet that specification. Note that, for switches (a relay is just a mechanised switch), contact ratings will be different according to whether the current is AC or DC, and whether the load is resistive or inductive.

2. All electrical assemblies must be checked by a suitable authority to confirm that such things as minimum gaps between circuits and appropriate insulation have been conformed to, so that nobody can come into contact with dangerous voltages even by accident and the voltage can't leak across too small a gap.

3. You really, really want to make sure your RPi can't get exposed to any voltage outside its specification - ie 3.3V.

The best way for a novice to switch a mains circuit is to use a commercial remote-controlled socket, and use the RPi to send the remote control signal.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

Return to “Add-ons”

Who is online

Users browsing this forum: cjan and 10 guests