I want to convert a 24V signal from sensors to 3.3V input signal for a Raspberry Pi. I have almost 20 sensors, so I have to convert all to 3.3V.

Is there any IC from which I can do multiple voltage conversions coming from many sensors? What is the additional ckt to used, to remove the floating value of input?

  • 1
    Is this an analog signal? or Digital? – Steve Robillard Dec 1 '15 at 6:04
  • digital signal . High and Low – amrit kumbhakar Dec 1 '15 at 12:38
  • What do you mean by "ckt"? Do you mean "circuitry"? – Greenonline Feb 8 '16 at 17:42

Here is a simple voltage divider circuit that should meet your requirements - note that the upper resistor will be sinking nearly half a watt when the input is 24V so should be 0.5W rating - 0.6W is a common rating for some manufacturers so should be easy to source...

This will draw over 2 milliamps with a 24V input voltage if that is important for the circuit under test.

Simple voltage divider using a 10K resistor in upper arm and 1.5K in lower to divide 24 volts DC down to 3.1 volts to feed into a GPIO pin on an RPi

Drawn using GSchem, part of the GPLed GNU Geda package.

| improve this answer | |
  • 1
    I know the OP talks about external signal but I think its worth mentioning that sending data BACK to the sensor is not possible with this circuit. PS Did you know Pi Exchange has a schematic editor now? – Piotr Kula Feb 17 '16 at 17:46
  • The OP did mention "input signals" so I took that to mean sending data back is NOT wanted - so it is a valid answer - though your point is valid for anyone seeking a bi-directional level conversion - it is possible but it needs active (semiconductor) devices. PS Yeah I know about the schematics editor but I keep my web-browser locked down with NoScript and RequestPolicy and I wasn't keen to jump through the additional hoops to get all the JavaScript working to use it - when I have a perfectly good schematic editor installed and in use - though it does mean posting "dumb" pictures...! 8-P – SlySven Feb 19 '16 at 3:54
  • Hi, not critisizing that your answer was wrong or anything. I think its a great answer - Just wanted to alert you and other that it doesn't support sending signals back thats all. OK, cool, it sounds like you locked down tightly on your side ;) I jsut block flash for now, not had any issues since flash ads stopped showing on my side. But thanks, even pictures are amazing to add to content. – Piotr Kula Feb 19 '16 at 14:36

That's a hardware question, not a RPi question.

Use two resistors for each sensor to make a voltage divider. A calculator like this will help you get the right values, and it includes a picture of how to hook it up. If the resistors get hot from the current, then you need bigger ones, or you need to use a different method.

Here is a good discussion of Optocouplers

| improve this answer | |
  • Could you expand your answer to explain how the optocouplers would help? Also, as links are liable to die over time, could you provide a synopsis of the link? – Greenonline Feb 18 '16 at 23:12

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.