1
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ What are these voltages you are talking about? Volts are not "dissipated", power is. What are you trying to do? \$\endgroup\$ – Eugene Sh. Aug 4 '15 at 20:34
  • 1
    \$\begingroup\$ I'm sorry but your understanding of voltage, GPIO input resistance, current, and heat/dissipation is wrong. \$\endgroup\$ – KyranF Aug 4 '15 at 20:53
  • \$\begingroup\$ You cannot plug in many (or even one) 8V signal directly into an unbuffered GPIO pin, this is true. But it is not because the gpio pins dissipate the difference as heat. \$\endgroup\$ – crasic Aug 4 '15 at 22:05
  • \$\begingroup\$ What you need is a combination of 10 voltage level converters and resulting in a simple logic HIGH/LOW on the GPIO, which you can deal with in software. Are you able to do any breadboarding? Will you be making a PCB from the results of your testing? Can you get a supply of resistors, capacitors, diodes, and NPN BJT Transistors? \$\endgroup\$ – KyranF Aug 4 '15 at 23:42
1
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

Just configure the gpio pin with a pullup in software, then connect it to the open collector or open drain of a transistor or opto-coupler. The pi will then provide the proper voltage through the pullup. See the gpio documentation, you will use a python statement such as:

gpio.setup(chan,gpio.IN,pull_up_down=gpio.PUD_UP)

You still need to design the circuit that feeds the base or gate or input led of the opto-coupler. Such a circuit will turn on the transistor or coupler somewhere between 0 and 8 volts. You must decide how accurate the transition must be and at what threshold voltage, but it sounds like you have some resources for that.

\$\endgroup\$
  • \$\begingroup\$ Just to expand on this, the emphasis on "You still need to design the circuit" which interfaces the 8V to the GPIO; probably using a low-side discrete transistor based circuit, where the GPIO and it's internal pull-up are the "high side" part of that circuit. \$\endgroup\$ – KyranF Aug 5 '15 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.