https://github.com/opensensor/pico-audio-chime
wifi pico audio server for chime sounds
https://github.com/opensensor/pico-audio-chime
Last synced: 2 months ago
JSON representation
wifi pico audio server for chime sounds
- Host: GitHub
- URL: https://github.com/opensensor/pico-audio-chime
- Owner: opensensor
- License: mit
- Created: 2025-11-27T08:40:42.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-11-27T08:56:36.000Z (7 months ago)
- Last Synced: 2026-03-13T06:38:29.970Z (3 months ago)
- Language: C
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π 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](DOORBELL_TONES.md) for complete documentation and [QUICK_REFERENCE.md](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
```bash
# 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:
```c
#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:///` in your browser
- Click any tone button to play it
**HTTP API:**
```bash
# Play Star Wars Imperial March (tone 10)
curl http:///doorbell?type=10
# Play Westminster chime (tone 1)
curl http:///doorbell?type=1
```
## π‘ HTTP API
### Endpoints
- `GET /` - Web interface with all tone buttons
- `GET /doorbell?type=<0-24>` - Trigger specific doorbell tone
### Example Usage
```bash
# 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](DOORBELL_TONES.md#adding-custom-tones) 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](DOORBELL_TONES.md#troubleshooting).