Skip to content

andruhon/pico-dog

Repository files navigation

Pico Dog

Detects motion and plays a dog bark sound when it's dark.

Special Halloween Edition: https://github.com/andruhon/pico-dog/tree/halloween-edition

See PROJECT.md for a detailed project writeup with build instructions and real-world performance notes. See materials.md for the list of materials used. See circuit.md for circuit details.

Photo Circuit

Audio Sources

Dog bark sound:
Dog Bark by abhisheky948 (Distributed under CC0 license)

Installation

Development Environment (Optional)

If you need to work with the project files locally, you can create a Python virtual environment:

python -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt

Dependencies

This package uses the following packages as dependencies:

Deploying to Pico

Prerequisites: MicroPython must already be installed on your Raspberry Pi Pico. Installation instructions can be found at https://micropython.org/download/RPI_PICO/

Note: Connecting to Raspberry Pi Pico on Linux may sometimes be challenging. Check linux.md for troubleshooting tips.

mpremote documentation: https://docs.micropython.org/en/latest/reference/mpremote.html

Install dependencies to Pico:

mpremote mip install github:CoreElectronics/CE-PiicoDev-Unified/PiicoDev_Unified.py
mpremote mip install github:CoreElectronics/CE-PiicoDev-VEML6030-MicroPython-Module/PiicoDev_VEML6030.py
mpremote mip install github:joeky888/awesome-micropython-lib/Audio/chunk.py
mpremote mip install github:joeky888/awesome-micropython-lib/Audio/wave.py
mpremote mip install github:danjperron/PicoAudioPWM/myDMA.py
mpremote mip install github:danjperron/PicoAudioPWM/myPWM.py
mpremote mip install github:danjperron/PicoAudioPWM/wavePlayer.py

Copy sources to Pico:

mpremote fs cp -r src/* :

Verify installation:

  • Run mpremote ls to make sure everything is copied over (you may need to restart the Pico to pick up changes)
  • Run mpremote df to check available space on the Pico

Custom Sounds

When using your own sounds, make sure they are 16-bit WAV files with a 16000 Hz sample rate. You can use Kwave (open source audio editor) to convert files.

Recovery: If you copied a corrupted file and your Pico seems to be bricked, you can flash it with the official Raspberry Pi memory reset: flash_nuke.uf2

Links

License

This repository uses two different licenses for files — Creative Commons BY-SA 4.0 for circuit schematics and MIT for code.

Please note the repository pulls in source code from other repositories, most of them are MIT and Creative Commons, pleaser refer to Dependencies section of this README to find other repositories in use.

About

Raspberry Pi Pico alarm system which keeps you safe in the dark

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published