Successfully Using ESP8266 to Detect USB Power for TV and Set-Top Box

Hey everyone, I wanted to share my successful experience with using an ESP8266 to detect USB power for my TV and set-top box. After some research and experimentation, I found a reliable solution that works perfectly for my setup. Here’s how I did it:

First, I was looking for a way to monitor whether my devices were on or off without relying on their power status alone. The idea of checking the USB port voltage seemed promising since it’s only powered when the devices are active. I had an ESP8266 already set up as an IR remote, so integrating this functionality made sense.

I decided to use a voltage divider circuit to step down the 5V USB signal to 3.3V, which is safe for the ESP8266. This involved using two resistors—4.7kΩ and 10kΩ—which I sourced locally. The setup was straightforward and didn’t require any complex soldering. I connected the circuit to the ESP8266 and set up a simple MQTT publish script to send the status to my home automation system.

Testing the setup was both exciting and a bit nerve-wracking. I powered off my devices and watched as the ESP8266 detected the voltage drop. It worked seamlessly! Now, I can track when my TV and set-top box are in use, which helps with energy monitoring and automation.

I also explored using a TTL adapter for level shifting but found the voltage divider method more cost-effective and easier to implement. This project was a great learning experience, and I’m thrilled with the results. If anyone has questions or needs help replicating this setup, feel free to reach out!

Happy tinkering! :rocket: