Skip to content

opensensor/pico-audio-chime

Repository files navigation

🔔 Pico Audio Chime

A WiFi-enabled doorbell system for Raspberry Pi Pico W with Waveshare Pico Audio board, featuring 25 unique doorbell tones ranging from traditional chimes to pop culture themes.

✨ Features

  • 25 Unique Doorbell Tones - Traditional, musical, classical, pop/rock, video games, and more
  • WiFi Control - Trigger doorbells remotely via HTTP API
  • Web Interface - Simple web UI to select and play tones
  • Sine Wave Synthesis - High-quality audio generation using PIO
  • Low Latency - Hardware-accelerated I2S audio output

🎵 Tone Categories

  • Traditional (5): Ding-Dong, Westminster, Simple Ding, Triple Chime, Alert
  • Musical (5): Tubular Bells, Ascending/Descending Scales, Jingle Bells, Buzzer
  • Movies & TV (5): Star Wars, Pink Panther, Mission Impossible, Harry Potter, Game of Thrones
  • Classical (3): Bach Toccata, Für Elise, The Entertainer
  • Pop & Rock (2): Beatles, Take On Me
  • Video Games (3): Super Mario, Zelda, Tetris
  • Retro & Celebration (2): Nokia, Happy Birthday

See DOORBELL_TONES.md for complete documentation and QUICK_REFERENCE.md for a quick guide.

🛠️ Hardware Requirements

  • Raspberry Pi Pico W - RP2040 microcontroller with WiFi (CYW43)
  • Waveshare Pico Audio - I2S audio expansion board
    • Rev1 (PCM5101A): DIN=GPIO26, BCK=GPIO27, LRCK=GPIO28
    • Rev2.1 (CS4344): DIN=GPIO22, MCLK=GPIO26, LRCK=GPIO27, SCLK=GPIO28
  • Speaker - Connected to audio board output
  • USB Power - 5V micro-USB

🚀 Quick Start

1. Build the Firmware

# Clone the repository
git clone https://github.com/matteius/pico-audio-chime.git
cd pico-audio-chime

# Create build directory
mkdir build && cd build

# Configure and build
cmake ..
make -j4

This will generate audio_firmware.uf2 in the build directory.

2. Configure WiFi

Edit wifi_config.h with your WiFi credentials:

#define WIFI_SSID "YourNetworkName"
#define WIFI_PASSWORD "YourPassword"

3. Flash the Firmware

  1. Hold the BOOTSEL button on Pico W
  2. Connect USB cable (or press reset while holding BOOTSEL)
  3. Copy audio_firmware.uf2 to the RPI-RP2 drive
  4. Wait for the Pico to reboot

4. Find the IP Address

Connect to the Pico's serial console (115200 baud) to see the assigned IP address:

=== Pico W Doorbell ===
Mode: WiFi Server

Connecting to WiFi...
Connected! IP: 192.168.1.100

=== Server Ready ===
Access the doorbell at: http://192.168.1.100/
API endpoint: http://192.168.1.100/doorbell?type=0-24 (25 tones)

5. Use the Doorbell

Web Interface:

  • Open http://<pico-ip>/ in your browser
  • Click any tone button to play it

HTTP API:

# Play Star Wars Imperial March (tone 10)
curl http://<pico-ip>/doorbell?type=10

# Play Westminster chime (tone 1)
curl http://<pico-ip>/doorbell?type=1

📡 HTTP API

Endpoints

  • GET / - Web interface with all tone buttons
  • GET /doorbell?type=<0-24> - Trigger specific doorbell tone

Example Usage

# Traditional ding-dong
curl http://192.168.1.100/doorbell?type=0

# Super Mario theme
curl http://192.168.1.100/doorbell?type=13

# Happy Birthday
curl http://192.168.1.100/doorbell?type=21

🔧 Development

Project Structure

pico-audio-chime/
├── main.c                  # Main application entry point
├── doorbell_server.c/h     # HTTP server implementation
├── wifi_config.h           # WiFi credentials (edit this!)
├── lwipopts.h             # lwIP TCP/IP stack configuration
├── audio_pio.pio          # PIO assembly for I2S audio
├── CMakeLists.txt         # Build configuration
├── lib/
│   ├── audio_data/        # Doorbell tone definitions
│   └── audio_pio/         # PIO audio driver
├── DOORBELL_TONES.md      # Complete tone documentation
└── QUICK_REFERENCE.md     # Quick reference guide

Adding New Tones

See DOORBELL_TONES.md for instructions on adding custom doorbell tones.

Build Requirements

  • Pico SDK - Raspberry Pi Pico SDK (v1.5.0+)
  • CMake - Build system (v3.13+)
  • GCC ARM - ARM cross-compiler (arm-none-eabi-gcc)

📝 License

MIT License - See LICENSE file for details

🙏 Acknowledgments

  • Based on Waveshare Pico Audio examples
  • Uses Raspberry Pi Pico SDK
  • lwIP for TCP/IP networking

🐛 Troubleshooting

No WiFi connection:

  • Check wifi_config.h credentials
  • Ensure 2.4GHz WiFi network (Pico W doesn't support 5GHz)
  • Check serial console for error messages

No audio output:

  • Verify speaker connections
  • Check audio board revision matches pin configuration
  • Ensure volume is set appropriately

Web interface not loading:

  • Verify IP address from serial console
  • Check firewall settings
  • Try accessing from same network

For more help, see DOORBELL_TONES.md.

About

wifi pico audio server for chime sounds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published