Most sensor boards use 3 leads. positive, negative and signal. You will want to hook the signal line up to a GPIO pin.
First you might need to change the direction of your desired GPIO pin. For example: gpioctl -c 30 IN
For a switch you want IN for an LED your would want OUT.
You can observe your switch in action with gpioctl -l. It should toggle (pin 30 for example) between 1 and 0 for value.
Why do you need a PiFace Digital to hook up a GPIO sensor. Read the instructions aragats so helpfully linked to.
Someone enters the sensors field of view = 1
Nothing in sensor view =0
So this is a simple digital IO signal with high/low.
You could hook it to any Pi GPIO pin. Nothing extra needed. It draws so little you can power it from the Pi power pins.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.