1

I have read on this website : http://www.ramge.de/powermonitor/doku.php?id=pulse_meter that I need a 200 Ohm resistor to connect a 24V input to the GPIO.

I know that RasPi need a voltage between 2 and 3.3V to detect a pulse. I also know that RasPi can't manage more than 16 mA. So I have tried a Voltage divider and putting the GPIO pin 2 in derivation with GND, but it doesn't work. So the website is correct but why ? And what is the internal resistor of the Raspberry ? (or equivalent).

6
  • raspberrypihobbyist.blogspot.ie/2012/09/… here it's said that the internal resistance is 10K, you can also measure it yourself with a multimeter. Jul 13 '15 at 15:14
  • 3
    i'm not sure what you mean. It is not safe to connect 24V to a Pi gpio. You will destroy the gpio and possibly the Pi. A 200 ohm resistor will limit the current to 120mA at 24V which will still destroy the gpio and possibly the Pi.
    – joan
    Jul 13 '15 at 15:23
  • Apparently from this datasheet the line connected to the GPIO on the Pi is: Pulse output S0, passive opto-isolated, max. 27V / max. 27mA, switchable at max. power 100mW which apparently is an input voltage to the device, which somehow the device can input pulses to the Pi. I'm very rusty on my EE so I don't see how this apparently works unless the device is able to take the 3.3v input from the Pi and pulse to GND to signal input to the Pi. Jul 13 '15 at 16:20
  • 1
    @HeatfanJohn I wouldn't be surprised if it turns out the pulse output is an open collector/drain. So needing a pull-up to 3V3, the pulse being signalled by the device pulling the output line to ground.
    – joan
    Jul 13 '15 at 17:08
  • I saw some reference that said that the pulse output was an open collector/drain ... Jul 13 '15 at 21:14
1

I would rather go with opto-isolators/transoptors. Or just take a look at this thread: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=42938

2

What you need is a Voltage Divider. I've connected many devices outputting a 12V signal to my Pi via a voltage divider its very simple so i'll let you do the math (all the equations are in the link above). You still have to be careful of the current though

"Level shifting: A voltage divider can be used as a level shifter to safely interface different circuits which use different reference voltages. For example, an Arduino microcontroller works at 5 V logic, while many sensors require 3.3 V logic. Directly interfacing the Arduino with a 3.3 V sensor may cause permanent damage to the sensor. By using a level shifter with a ratio of 3.3/5 resistor values on each pin connected to the sensor, an Arduino board can safely communicate with the sensor."

1

Voltage dividers are a possible solution, but are dependent on the exact voltage levels.

Opto-isolators are a solution in some cases, but require lots of current.

There are better more robust solutions, but these depend on the nature of the input.

A series resistor and diode clamp to 3.3V is a better safe robust solution for logic inputs provided the input swing goes down to a suitable low level (~ <1.2V).

Combination methods (using 2 resistors and a diode) can be used for larger voltage swings.

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.