Skip to main content
2 of 3
added 1 character in body
winny
  • 16.8k
  • 6
  • 50
  • 71

You can do this without a voltage divider as well, either by using a Zener, an LED across the input with a resistor in series with the sensor, or place a Schottky diode from the input to the 3.3 V rail.
Here are examples:

schematic

simulate this circuit – Schematic created using CircuitLab

Edin Fifić
  • 7.4k
  • 10
  • 29