[SOLVED] Grove - PIR Motion Sensor


#1

I bought a Grove - PIR Motion Sensor. I connected it to my GrovePi board on plug D8. I tried to get input by following scratch statements:

when space key pressed
broadcast join distance 8
say distance sensor value

Only the value 0 is coming back after pressing the space bar.
Is there another way to use pir sensor with scratch or is this sensor just useable with python?

Best regards,

Martin


#2

Hello @m.albisser
At first glance you’re using the distance sensor code for a motion sensor one ?
That will not work. Can you confirm that, please?

Cleo


#3

Hi Cleo,
i sift through the commands I found on git-hub: https://raw.githubusercontent.com/CleoQc/Utilities/master/Scratch_Commands/grovepi.png.
I couldn’t find a command like “PIR”, “Infrared” or something similar. So I took “distance” as the plausiblest of all given commands. Please tell me, which is the correct command for the pir motion sensor.
Best regards,
Martin


#4

Hello @m.albisser
The PIR sensor is a digital sensor, it should work with a DigitalRead8.

Cleo


#5

Hi Cleo,
Again your advice worked very well.
Thanks a lot and best regards,
Martin


#6

Yeah!!! Glad you are up and running now!

And thanks for letting me know the outcome.

Cleo


#7

This topic was automatically closed after 3 days. New replies are no longer allowed.