Motion triggered sound

Hi there,

I am trying to create a system that when motion is detected will make the piezo speaker make a sound. I am having trouble with both the wiring and the code. Any help would be greatly appreciated.

So… basically the entire project?
What did you manage to get working, and what specifics do you need help with? Can you get the separate parts to run independently of each other?

1 Like

Yes basically the whole project. I was able to get the piezo to make sounds on its own. I think my wiring for the motion sensor is wrong and the corresponding code is not right.

If you look around the forum a bit (e.g. use the search function), you’ll find some topics/tutorials on motion sensors. Get that working, and we can go from there.

1 Like

What senor are you using for motion detection? I’ve done this with the Photon using a PIR sensor… But I’ve also used an ultrasonic senor (trigger on certain distance) with an Arduino as well.