An open API service indexing awesome lists of open source software.

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

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).