Purpose
The purpose of the device is to create a pleasant atmosphere in the bathroom (or wherever) when a person is entering. It is a DIY solution for the so called "Zwitscherbox" product, that recently has gained popularity in Germany. Unlike the premanufactured Zwitscherbox, the Arduino Songbird is capable of playing any WAV file when a motion is detected. Also, thanks to the integrated real-time clock, you can implement different sounds for different times of the day (e.g. owl sounds for night time, nightingale for dusk and dawn and daylight songbirds during the day). Furthermore, the code allows you to turn down the volume at night.
The Arduino Songbird is powered by 4 AA batteries (each 1.2V), so for energy saving purposes, the deep sleep mode was integrated. However, recharging is necessary every 5 days or so, depending on how often the sound is triggered. The Arduino Songbird can also be powered by cable. Completely remove the battery holder in this case.
Below, you will find 8 edited WAV files to get your project started. However, I suggest you use any sound files to your liking. Pixabay may be a good resource to find royalty free sound files. You can edit the files with the free audio software Audacity. The wav file must be stereo signed 16 bit 44100Hz and filename must be abcdefgh.wav (8-3) formatted.
Note: Due to lack of time I could not work further on the energy efficiency of the Songbird. I would highly appreciate any comments and ideas on how to prolong battery life.




How to wire the components
MAX98357 to MKR Zero
LRCLK to -3
BCLK to -2
DIN to A6
GND to GND
VIN to VCC
PIR to MKR Zero for motion detection
Pin1 to GND
Pin2 to 7
Pin3 to 5V
PCF8523 to MKR Zero for RTC
GND to GND
VCC to VCC
SDA to SDA (11)
SCL to SCL (12)

Code explanations
The code should be self-explanatory. However, I want to point out the code was written for WAV files with a length of 2 minutes. If you have longer WAV files and did not change the code, the audio might be cut short.
EXPANDED TECHNICAL DETAILS
Acoustic Ambiance Automation
The "Digital Songbird" is an interactive project designed to bring the sounds of nature into a home environment, specifically the bathroom, to enhance relaxation.
- Motion-Triggered Audio: Uses a PIR (Passive Infrared) sensor to detect when someone enters the room. The Arduino remains in a low-power "Sleep" mode until the sensor triggers an external interrupt, ensuring battery efficiency.
- High-Quality Soundscapes: Audio files (birdsongs, flowing water, or rain) are stored as high-bitrate MP3s on a microSD card. The Arduino communicates with a DFPlayer Mini module via a serial link to trigger specific tracks based on randomized selection.
User Experience & Design
- Responsive Interaction: The volume can be adjusted via a hidden potentiometer. Advanced versions include a Light Dependent Resistor (LDR), allowing the songbird to automatically stop singing when the lights are turned off at night.