Send signal to gpio when 8V power drops

dcgpioraspberry pitransistorsvoltage

I want to be able to detect when a 8V signal goes low and send a signal to a raspberry pi over GPIO. A java app will be listening on the GPIO pins for any changes.

I would check if the voltage drops via the pi directly, but I need to check 10 signals and do not want the pi (and 3v LDO voltage regulators) absorbing 3v per signal constantly while dissipating the other 5v. Dissipating 50v and absorbing another 30v will probably produce enough heat to melt the pi without some major cooling.

I have seen examples using optocouplers or NPN transistors, but need to get the output signal to within the pi's tolerances of between 2.0v and 3.3v.

Best Answer

Voltage divider:

schematic

simulate this circuit – Schematic created using CircuitLab

The actual resistor values do not really matter that much, as long as \$\frac{R1}{R2}\$ remains \$\frac{3}{5}\$. The 8V connection is connected to GND through \$R1+R2\$, so this shouldn't be too small; but if you select them too large, the pull on the GPIO might be too weak. R3 is optional, it just reduces the current flow further.

For this to work, the GPIO may not have a pull-up or pull-down configured.