Back to Projects
Raspberry Pi · MicroPython · Flask

W.A.S.A.P.P

Wilhelm-Arcade-Scream-Activated-Python_Powered-Pico

An innovative doorbell system that brings a dramatic twist to the traditional experience. When the arcade button is pressed, the Raspberry Pi Pico sends a signal via Wi-Fi to a Flask server, which plays the iconic Wilhelm scream throughout the house.

Doorbell internals Doorbell assembled

Parts List

Programming

  1. Set up the Flask server

    Install Flask on your computer if you haven't already, then create the server file below. Replace path/to/audio.mp3 with the path to your Wilhelm scream (or other audio file). if you need a copy of the scream, you can download it from here

    Python — doorbell_server.py
    # Run with: python doorbell_server.py
    # Trigger with: curl -X POST http://localhost:5000/play_audio
    
    from flask import Flask
    import os
    
    app = Flask(__name__)
    
    @app.route('/play_audio', methods=['POST'])
    def play_audio():
        os.system('aplay path/to/audio.mp3')
        return 'Audio played', 200
    
    if __name__ == '__main__':
        app.run(host='0.0.0.0', port=5000)
    pip install Flask
  2. Install MicroPython on the Pico W

    Download the latest MicroPython .uf2 firmware from micropython.org, hold the BOOTSEL button while plugging in the Pico, then drag the file onto the drive that appears.

  3. Flash the Pico W firmware

    Create a new file on the Pico W (e.g. using Thonny) and paste the code below. Replace the Wi-Fi credentials and SERVER_IP with your server's local IP address.

    MicroPython — main.py
    import network
    import urequests
    import machine
    import time
    
    # Wi-Fi credentials
    SSID = 'your_wifi_ssid'
    PASSWORD = 'your_wifi_password'
    
    # Button on GPIO 14
    button = machine.Pin(14, machine.Pin.IN, machine.Pin.PULL_UP)
    
    # Connect to Wi-Fi
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    wlan.connect(SSID, PASSWORD)
    
    while not wlan.isconnected():
        time.sleep(1)
    
    print('Connected to Wi-Fi')
    
    url = 'http://SERVER_IP:5000/play_audio'
    
    def play_audio():
        try:
            response = urequests.post(url)
            print('Response:', response.text)
        except Exception as e:
            print('Failed to send request:', e)
    
    while True:
        if not button.value():  # Button pressed (active low)
            play_audio()
            time.sleep(1)  # Debounce delay

Assembly & Enclosure

For the enclosure, I repurposed an old project box and drilled holes for the button and cables. The Pico W is mounted inside with hot glue, and the button is connected to GPIO 14 and GND using dupont wires. You can customize the enclosure however you like – 3D printing, laser cutting, or even a vintage tin box would work great!

Testing & Usage

With everything set up, press the arcade button and enjoy the dramatic Wilhelm scream echoing through your home! You can further customize the system by adding more buttons for different sounds, integrating with smart home devices, or even creating a web interface to trigger the sounds remotely.

Next Steps & Improvements

If you don't have a spare pico or just want to hear the scream without building the hardware, Just press the button below... (this used to be wired up to play the sound on my local server, but y'all crazy kids drove me insane with the traffic so I had to disable it 😭)

Future improvements could include adding a camera to capture visitors' reactions, integrating with a smart doorbell system, or even creating a mobile app for remote triggering.