A quick morning project I did to detect whether my turntable was turned on so I could automate powering on my monitors (speakers). Note - the easiest and safest way to do this was probably with an energy detecting smart plug but I didnt have enough space for one. Another advantage is that it resulst in having an esphome close to my turntable which may come in helpful for future automations. Another better alternative is probably just using a CT clamp.
- ESPHome device - I used an ESP32 DEVKIT 1
- Optocoupler
- Project box
- I also got some heatshrink
- Electronics essentials: Soldering iron, jumper leads etc
- Hot glue gun
- Work out what you're dealing with
- Prototype on a breadboard, Note that this is HIGH VOLTAGE, stay well clear when the mains side is energised.
- Solder and assemble into project box, cut holes for connections, glue components into place.
- Solder the HV side - I also had to put a cut out to let the wires through, then wrap in heatshrink
- ESP32 doit DEVKIT V1 pinout https://www.circuitstate.com/pinouts/doit-esp32-devkit-v1-wifi-development-board-pinout-diagram-and-reference/
- ESP8266 pinout https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
- ESPhome Hardware design channel https://discord.com/channels/429907082951524364/951213660905287761