8

If I have a sensor which has 5V ouptut:

  1. I can't plug it directly to Raspberry PI, right?
  2. If so, what would I need to do so I would be able to do so?

I would like to connect it via input pins.

Slaven Tomac
  • 183
  • 1
  • 5

2 Answers2

9

You can use two or three resistors to form a voltage divider

Input----[ 1k ]-----[ 2k ]---GND
                 |
                 |
                 |
               GPIO PIN

If your wires aren't too long, you can use higher resistors - say 10k & 20k

If you can't find 2k resistor, you can connect 2 1k resistors in series

Input----[ 1k ]-----[ 1k ]-----[ 1k ]---GND
                 |
                 |
                 |
               GPIO PIN
John La Rooy
  • 12,005
  • 9
  • 48
  • 77
1

It is correct that you cannot directly connect a 5V sensor to the Raspberry Pi as it provides 3.3V. There's a great new cape for the Pi on kickstarter that allows you to use 5V sensors using GVS connections. Here's a link: https://www.kickstarter.com/projects/1546666383/gvs-board-for-raspberry-pi?ref=discovery

This is a great alternative to painful wiring.