Wireless doorbell with your own tunes
Build it step by step
0 of 7 doneTest the radio
Send text, receive it.
Add the button and sleep
Wake on press.
Send a code three times
Four bytes.
Check the code indoors
Print a message.
Add the player
Play track 1.
Cycle the tunes
Next on each ring.
Add the volume knob
And a repeat gap.
How do you build a wireless doorbell with your own tunes?
A battery button outside sends a 433 MHz code, and the indoor unit plays a chosen MP3 tune through a DFPlayer. You need Arduino Nano × 2, 433 MHz RF transmitter and receiver pair, DFPlayer Mini MP3 module, Speaker 8 Ω 0.5 W, SanDisk microSD card 32 GB (A1, Class 10), Tactile push button 6 mm, Battery holder 4 × AA with switch, AA alkaline battery × 4, Potentiometer 10 kΩ and Resistor 1 kΩ. It takes 7 steps and about 120 minutes.
- Level
- Beginner
- Time
- About 120 min
- Parts
- 10
Wiring
| From | To | Why |
|---|---|---|
| Outdoor: button | Nano D2 to GND | Wakes the Nano (interrupt) |
| Outdoor: 433 MHz transmitter DATA | Nano D12 | Radio data |
| Outdoor: transmitter VCC and GND | Nano 5V and GND | Power |
| Outdoor: 4 AA holder | Nano VIN and GND | About 6 V |
| Indoor: 433 MHz receiver DATA | Nano D11 | Radio data |
| Indoor: receiver VCC and GND | Nano 5V and GND | Power |
| Indoor: DFPlayer TX | Nano D10 | Player to Nano |
| Indoor: Nano D9 | 1 k resistor to DFPlayer RX | Nano to player |
| Indoor: DFPlayer SPK1 and SPK2 | 8 ohm speaker | Sound |
| Indoor: DFPlayer VCC and GND | Nano 5V and GND | Power |
| Indoor: volume pot wiper | Nano A0 (ends to 5V and GND) | Volume |
| Indoor: Nano USB | 5 V adapter | Power |
Code
The outdoor unit sleeps almost all the time and wakes only when the button is pressed, which is what lets it run on batteries: it then sends a four-byte code three times, since a radio message can be lost, and goes back to sleep. The indoor unit listens all the time, checks that the code matches, and plays the next tune from the SD card, ignoring repeats for five seconds so one ring plays once. A bare Nano still uses power in sleep because of its regulator and USB chip, so expect days to weeks, not months; a bare ATmega or Pro Mini lasts far longer. The 433 MHz modules are cheap and simple, but they are not secure: anyone nearby could record and copy the code, which does not matter for a doorbell but would for a lock. A wire about 17 cm long on each module's antenna pad greatly improves range. Check your local rules for 433 MHz devices. Put the outdoor unit in a small weatherproof box with the button outside. Arduino IDE, board "Arduino Nano" (try the Old Bootloader option if the upload fails).
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Wireless doorbell: two sketches in one file. Libraries: RadioHead (RH_ASK), DFRobotDFPlayerMini. Board: Arduino Nano (two of them).
// Put MP3 files named 0001.mp3, 0002.mp3 and so on in a folder called mp3 on the SD card.
// ---------- OUTDOOR button unit ----------
#include <RH_ASK.h>
#include <SPI.h>
#include <avr/sleep.h>
RH_ASK driver(2000, 11, 12, 0); // speed, receive pin (unused), transmit pin D12
const uint8_t CODE[4] = {0xB1, 0xE1, 0x1A, 0x7C}; // any four bytes; the indoor unit checks the same ones
void wake() {}
void setup() {
pinMode(2, INPUT_PULLUP);
driver.init();
}
void loop() {
attachInterrupt(digitalPinToInterrupt(2), wake, LOW);
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable(); sleep_cpu(); sleep_disable(); // sleep until the button pulls D2 low
detachInterrupt(digitalPinToInterrupt(2));
for (int i = 0; i < 3; i++) { driver.send(CODE, 4); driver.waitPacketSent(); delay(60); } // send the code three times
delay(1500); // ignore button bounce and long presses
}
/* ---------- INDOOR receiver and player: upload this half to the other Nano ----------
#include <RH_ASK.h>
#include <SPI.h>
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
RH_ASK driver(2000, 11, 12, 0);
SoftwareSerial dfSerial(10, 9);
DFRobotDFPlayerMini player;
const uint8_t CODE[4] = {0xB1, 0xE1, 0x1A, 0x7C};
const int TUNES = 3;
int nextTune = 1;
unsigned long lastRing = 0;
void setup() {
dfSerial.begin(9600);
driver.init();
player.begin(dfSerial);
player.volume(15);
}
void loop() {
player.volume(map(analogRead(A0), 0, 1023, 5, 28)); // volume knob
uint8_t buf[RH_ASK_MAX_MESSAGE_LEN]; uint8_t len = sizeof(buf);
if (driver.recv(buf, &len) && len == 4 && memcmp(buf, CODE, 4) == 0 && millis() - lastRing > 5000) {
lastRing = millis();
player.play(nextTune);
nextTune = nextTune % TUNES + 1; // next ring plays the next tune
}
}
*/Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Button | Tune plays indoors within a second |
| Second ring | Next tune |
| Held button | Plays only once |
| Other 433 MHz remote | Ignored |
If it does not work
No sound
Check the SD card files and the DFPlayer wiring.
Short range
Add antenna wires and fresh batteries.
Rings twice
Lengthen the repeat gap.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the wireless doorbell with your own tunes?
Arduino Nano × 2, 433 MHz RF transmitter and receiver pair, DFPlayer Mini MP3 module, Speaker 8 Ω 0.5 W, SanDisk microSD card 32 GB (A1, Class 10), Tactile push button 6 mm, Battery holder 4 × AA with switch, AA alkaline battery × 4, Potentiometer 10 kΩ and Resistor 1 kΩ.
How long does the wireless doorbell with your own tunes take to build?
About 120 minutes for a beginner maker, in 7 steps.
How do I know the wireless doorbell with your own tunes works?
Button: Tune plays indoors within a second. Second ring: Next tune. Held button: Plays only once.
No sound: what should I check?
Check the SD card files and the DFPlayer wiring.
Short range: what should I check?
Add antenna wires and fresh batteries.
Rings twice: what should I check?
Lengthen the repeat gap.
