input voltage detection

Dear all,

It may or may not relevant topic here.Since General electronic related i am questioning here.

I am using Raspberry pi for one of my application.I have various level of digital input coming from sensor, voltage level

My voltage levels are 3.3V/5V/12V/24VDC. Based on these input i am taking action on relay control. Rasberry pi operated 3.3V DC input so we can give directly

For 5V/12V/24V dc what are ckt i need to build. weather voltage divider network will work out for application.

level shifter can used in application. https://www.raspberrypi-spy.co.uk/20...berry-pi-gpio/

  1. that link is dead.
  2. are you getting 3.3-24V all on one pin or different pins? Please provide a little more information... my guess is voltage divider but not sure if it's one way or both... so I have more questions than answers at this point.

For the higher voltages you can use a [u]Voltage Divider[/u]. The resistor values aren’t critical (it’s the ratio that’s important) but values that add-up to around 10 usually work. If the resistance it too low, you draw excess current from the source and the input-voltage may drop. If the resistance it too high, it’s more sensitive to noise pick-up.

Or, if logic low is always zero volts (or nearly zero volts) you can use a [u]over-voltage protection circuit[/u]. I don’t know the input impedance on the Pi, but with the Arduino (essentially infinite input impedance) I’d increase the resistor value to 10K.

In most cases, the protection circuit would be my preference. But for example, if the 24V line switches between 24V (high) and 4V (low), of course, the protection circuit won’t “pass-through” logic-low and it will always read high.

It may or may not relevant topic here.Since General electronic related i am questioning here.

Since this is the Arduino form I think it’s supposed to be Arduino-related electronics. :wink: