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.
