-3

Im building my final project with raspberry 4 with python,The project is:security systeam. I want it to play an alarm sound when it detects motion. I dont have a clue how to write a script that will execute correctlly when the sensors will detect motion and the speaker make sound(mp3 file). Any ideas or guides that will work?

Daniel shutov
  • 11
  • 1
  • 4
  • 4
    You're going to need to learn python. What have you done so far? StackOverflow is not a free code writing service. We're here to help you but you will need to help yourelf first. – Hoppo Jun 03 '20 at 11:30
  • 1
    Start by eliminating stuff you don't need to handle yourself. For example, can you pair your Bluetooth speaker to the machine running the code and set it as the default audio device? In that case, Bluetooth becomes irrelevant: now you just need to play a sound. In any case, this is far too broad for Stack Overflow. Please read about what's on-topic in the [help/on-topic]. – ChrisGPT was on strike Jun 03 '20 at 11:45

1 Answers1

2

You might want to take a look at this library for the motion sensing:

https://gpiozero.readthedocs.io/en/stable/recipes.html#motion-sensor

Along with this one on make a noise with a Raspberry Pi (which includes a section on Bluetooth speakers)

https://www.raspberrypi.org/blog/how-to-play-sound-and-make-noise-with-your-raspberry-pi/

ukBaz
  • 6,985
  • 2
  • 8
  • 31