I have to connect the distance sensor to a Raspberry Pi for a project, but I have little experience and I am not very familiar with it.
I connected the distance sensor to the Raspberry Pi as I found it in the description:
- Ground to GND
- VIN to 3,3V
- OUT to GPIO 24
I also wrote a code on my Raspberry Pi that outputs “interrupt” if the sensor detects something.
import RPi.GPIO as GPIO
i = GPIO.input(24)
if i == 0:
elif i == 1:
print (‘no interrupt’,i)
My problem is that the LED on the sensor lights up all the time even though the description says that it should only light up if the output is low, indicating that the sensor is detecting something and If I execute the code, the sensor does not recognize anything.
Unfortunately I don’t know enough about this topic to find a solution.