Projects / Wireless doorbell with your own tunes

Wireless doorbell with your own tunes

Beginner2 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANO

    Test the radio

    Send text, receive it.

  2. NANO433

    Add the button and sleep

    Wake on press.

  3. NANO

    Send a code three times

    Four bytes.

  4. NANO

    Check the code indoors

    Print a message.

  5. NANO

    Add the player

    Play track 1.

  6. NANO

    Cycle the tunes

    Next on each ring.

  7. NANO433

    Add the volume knob

    And a repeat gap.

In short

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

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Outdoor: buttonNano D2 to GNDWakes the Nano (interrupt)
Outdoor: 433 MHz transmitter DATANano D12Radio data
Outdoor: transmitter VCC and GNDNano 5V and GNDPower
Outdoor: 4 AA holderNano VIN and GNDAbout 6 V
Indoor: 433 MHz receiver DATANano D11Radio data
Indoor: receiver VCC and GNDNano 5V and GNDPower
Indoor: DFPlayer TXNano D10Player to Nano
Indoor: Nano D91 k resistor to DFPlayer RXNano to player
Indoor: DFPlayer SPK1 and SPK28 ohm speakerSound
Indoor: DFPlayer VCC and GNDNano 5V and GNDPower
Indoor: volume pot wiperNano A0 (ends to 5V and GND)Volume
Indoor: Nano USB5 V adapterPower

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.

CheckExpected
ButtonTune plays indoors within a second
Second ringNext tune
Held buttonPlays only once
Other 433 MHz remoteIgnored

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 →

Ask Lark AI

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.