ESP32 Home Wifi AC Outlet

Thread Starter

tskgreen

Joined Aug 21, 2018
2
Hello, I am a computer science major in my final year for my B.S. This summer I worked for an embedded systems company and I learned a ton about electronics so now I am going to do my very first project at home and could use some advice. I want to make a wifi AC outlet, where I make a phone app with a simple on/off button and when the button is clicked the lamp that is connected to that AC outlet will either shut off or turn on. I bought an esp32 for the purpose that this chip has bluetooth and wifi on it. As a computer science backhground I know alot of front end, such as my idea that my esp32 will connect to MQTT server and will look for commands that will be sent from my app. I also bought a 2 channel 5V relay switch which i will use to turn on/off ac signal. In order to not hurt myself I also bought an AC cord that will be connected in my outlet box that I correct and it will connect to an AC outlet in my room for the fact that I am new to this and do not want to have to mess with the wires in my wall. SO my initial question is that I need to power my relay switch with 5V so how should I do this? Also I always need power to my esp32 inorder for it to control commands. My plan was when I got an off/on signal from my MQTT server my esp32 will use one of its GPIO pins to supply 3.3V to my relay swtich input to turn off or on the ac.
 

-live wire-

Joined Dec 22, 2017
959
Welcome to AAC. So are you familiar with the ESP32? And how much would you say you know about electrical engineering? Do you know about isolation, and what exactly L, N, and earth mean?

Mains can be dangerous, and is not the best place to start. So maybe test all the software out and have that GPIO power a 5mm LED with resistor. Once you get that to work, we can help you find the best relay, powering it properly, etc.
 

Thread Starter

tskgreen

Joined Aug 21, 2018
2
Welcome to AAC. So are you familiar with the ESP32? And how much would you say you know about electrical engineering? Do you know about isolation, and what exactly L, N, and earth mean?

Mains can be dangerous, and is not the best place to start. So maybe test all the software out and have that GPIO power a 5mm LED with resistor. Once you get that to work, we can help you find the best relay, powering it properly, etc.
I am some what familiar with the ESP32. I was going to program it with the arduino IDE. So the place I interned with over the summer was an electrical engineering company so I learned a lot but I never went to school for EE, so I would say I am very basic with it. I am really trying my best to understand it all though. I was working with a non-iso PSU in my internship and from what I learned it just meant it was very dangerous to be around so I shouldn't touch it at all. Something about there is not a transformer to isolate the PSU. As for L,N, and Earth, I would assume this is AC and N is neutral and Earth is like ground, L i am not sure about but maybe it is hot?
 

-live wire-

Joined Dec 22, 2017
959
I am some what familiar with the ESP32. I was going to program it with the arduino IDE. So the place I interned with over the summer was an electrical engineering company so I learned a lot but I never went to school for EE, so I would say I am very basic with it. I am really trying my best to understand it all though. I was working with a non-iso PSU in my internship and from what I learned it just meant it was very dangerous to be around so I shouldn't touch it at all. Something about there is not a transformer to isolate the PSU. As for L,N, and Earth, I would assume this is AC and N is neutral and Earth is like ground, L i am not sure about but maybe it is hot?
You can check out the "education" tab here in AAC. They explain many important concepts, and it's pretty thorough. You will need to have a good understanding of L, N, and G before you can work with mains. So get it working with an LED, and then we can help you add a relay, transistors, etc.
 

MaxHeadRoom

Joined Jul 18, 2013
30,590
The reason is that in UK for instance, residential areas are fed from a star connected 3ph Tfmr, each group of so many homes on each phase, I once install a high number of overnight storage heater in one residence, the local service company made me split them up over 3 phases, for which they installed a 3ph service.
Max.
 

-live wire-

Joined Dec 22, 2017
959
The reason is that in UK for instance, residential areas are fed from a star connected 3ph Tfmr, each group of so many homes on each phase, I once install a high number of overnight storage heater in one residence, the local service company made me split them up over 3 phases, for which they installed a 3ph service.
Max.
Interesting. What would happen if one phase was loaded significantly more?
 

MaxHeadRoom

Joined Jul 18, 2013
30,590
This is why when presented with a situation that is above the norm (post #7) they insisted on 3ph.
Otherwise most households were fairly close average.
Max.
 

ArakelTheDragon

Joined Nov 18, 2016
1,366
Because you need a 1F capacitor on the wifi module. It is better to use ESP8266 or nodeMCU v1.0 (v3 also called) development board, which you only plug, program and it does what you want. This is if you do not want to care about the electronics. If you want to care and know a little about hardware, then you can make the development board by yourself with the ESP8266 chip, which is enough for your needs.
 

-live wire-

Joined Dec 22, 2017
959
Here are some good solid state relays. They will provide you with isolation, be fast, and will not draw too much current from your microcontroller. They are heavy duty and can handle the maximum 15-20A easily. They come with a heat sink, so it can control even more power.

IronBuddy 2Pcs SSR-25 DC 3-32VDC / 24-380VAC 25A Solid State Relay & Heat Sink https://www.amazon.com/dp/B07GGTJJCX/ref=cm_sw_r_cp_api_txxHBbTY90MKE

Please have very good insulation and encase all of it in a box or something so you cannot acidsntally touch mains. And please do not do anything around mains till you learn a lot more about it. If you want, you can have it control multiple outlets, using multiple relays. You will want the wiring to look something like this.
image.jpg
 
Top