This section will deal with how to detect when the push button is pushed, indicating the user wants to toggle the relay, i.e. turn it OFF is it on or turn it ON if it is off. The schematic is the same as above, all the tricks are in the code. There are two case to consider:...
since the ESP-01 operates on 3.3 V logic level and receiving 5 V logic level from the Arduino UNO could damage the ESP module. You can build a simple 3.3 V voltage divider using only 2 resistors as shown in the figure. Optionally, you could use a logic level ...