กลับไปหน้ารวมไฟล์
digital-songbird-in-your-bathroom-34aaaf-en.md

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)

Wiring scheme

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.

ข้อมูล Frontmatter ดั้งเดิม

title: "Digital songbird in your bathroom"
description: "This project lets you hear the charming voices of birds every time you enter your bathroom (or whereever you want to place this device). It reacts on PIR motion sensor and plays an audio on motion detection, then goes back to sleep. It runs on 4 AA-batteries, but can also be powered over cable. The battery life should be improved, currently it lasts about 5 days. All ideas are welcome."
author: "tomnoir"
category: "Audio & Sound"
tags:
  - "Animals"
  - "Audio"
  - "Clocks"
  - "Human Welfare"
views: 1840
likes: 2
price: 2450
difficulty: "Easy"
components:
  - "1x Jumper wires (generic)"
  - "1x Adafruit MAX98357 I2S Class-D Mono Amp"
  - "1x Mini breadboard - White"
  - "1x PIR Motion Sensor (generic)"
  - "1x Arduino MKR ZERO (I2S bus & SD for sound, music & digital audio data)"
  - "1x 4 AA battery holder + battery"
  - "1x Speaker: 3W, 4 ohms"
  - "1x Adafruit PCF8523 Real Time Clock Assembled Breakout Board"
  - "1x Soldering kit"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles:
  - "https://github.com/timpettenkofer/songbird"
documentationLinks: []
passwordHash: "5b8812f1525a9ac8231bcc1e4e347739242d3c55db26132ebfba6c7aaaefc12d"
encryptedPayload: "U2FsdGVkX19/rXgJw7mVxPaOr2PPNV9+1PjgAgzTxxX1uolbBoyMHEUqDgxk6aYYVMq46L+4b8RvBrkcu8Aicg+dJ4N8HafoFxRg61i1ung="
seoDescription: "DIY Digital songbird for bathrooms using PIR motion sensor. Plays audio on motion detection, runs on AA-batteries. Open for battery optimization."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/digital-songbird-in-your-bathroom-34aaaf_cover.jpg"
lang: "en"