Wanting to create: sound triggered by walking past

Hi Jessie

And a friend provided this link to a simple RADAR sensor

Some info here

and a HEAP of info about it here

And a simple code to test it - you could merge in the MP3 Player code instead of the led.on line

from machine import Pin
led = Pin(25, Pin.OUT)
radar = Pin(22, Pin.IN, Pin.PULL_DOWN)

detect = False

while True:
    detect = radar.value()
    if detect:
        led.on()
    else:
        led.off() 

I have tried it - it does give a solid trigger but is interesting to aim, in that it seems to have a wide pickup field.

cheers,
Murray

2 Likes