I'm using a Pi Zero W and I'd like to connect a 5v source to a GPIO pin to detect if the 5v is on or off.
I know the GPIO is only digital I/O and 3.3v max, so is a simple voltage divider enough or do I need anything else? I've read this other topic and it mentions diodes and capacitors for safety?
My goal is detect if a TV is powered on by connecting the TV USB port (only +5v/GND wires) to the Pi Zero W. I've already verified with my multimeter that the USB port drops from 5v to 0v (slowly) once the TV is powered off. Ideally, I'd like 4.7v - 5v to be considered on and less than 4.7v to be off.