How to Build a Wireless Doorbell Using Arduino

Publisher:快乐时刻Latest update time:2023-06-20 Source: elecfansKeywords:Arduino Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

We all know that wired doorbell systems require wires and suitable sockets to work satisfactorily. Since wired doorbell systems require complicated wiring and require experienced people to complete the work, neither the work nor the appearance is good. Another problem with it is that if you want to install a wired doorbell system for an existing house, the installation requires more effort and time. Due to temperature and humidity and other environmental factors, wires can be damaged and cause short circuits. This is where wireless doorbell systems come into play. Although wireless doorbell systems cost more, the regular maintenance of wireless doorbell systems is lower than that of wired doorbell systems, which require experienced people to maintain. In terms of installation, the installation of wireless doorbell systems is very simple and can be installed without experienced personnel. In addition to this, the wireless doorbell system also has additional features such as cameras, video recorders, etc., with a stylish appearance, completely wireless, and can be easily installed anywhere in the house.


In this project, we will build a wireless doorbell using Arduino. We will have a button that when pressed will wirelessly play a melody of our choice to indicate that someone is at the door. For the wireless connection, we will use a 433 MHz RF module. Generally speaking, an RF module must always be accompanied by a decoder and encoder module, but we can also use a microcontroller like the Arduino used in this tutorial in place of the decoder and encoder modules.


Required Hardware:

RF Module

Arduino

buzzer

Button

Breadboard

Connection lines

433 MHz RF Module:

For our Arduino based wireless doorbell, we will use a 433 MHz wireless RF module. RF module, or radio frequency module, consists of two modules, a module that receives data is called a receiver and a module that transmits data is called a transmitter.

poYBAGL_QiCAVTboAAPQXnCbIfM984.png

RF Transmitter:

The transmitter consists of a SAW resonator tuned to 433MHz , a switching circuit and some passive components.

poYBAGL_QhyACkSuAAB9cr2WROA944.png

When the input to the data pin is high, the switch acts as a short circuit and the oscillator runs, producing a carrier wave with a fixed amplitude and a fixed frequency for a period of time. When the input to the data pin is low, the switch acts as an open circuit and the output is zero. This is also called Amplitude Shift Keying (ASK). We will discuss this more later in this article.


Receiving circuit:

The RF receiver is a simple circuit consisting of a RF tuning circuit, an amplifier circuit, and a phase-locked loop circuit.

poYBAGL_QhiAemAZAABWZEoH5gY968.png

RF tuner is used to tune the circuit to a specific frequency which needs to meet the transmitting frequency. Amplifier circuit is used to amplify a specific frequency from all other signals and increase the sensitivity of a specific frequency.


Phase-locked loop circuit:

A phase-locked loop circuit (PLL) is a circuit used in the type of device where we want to get a highly stable frequency from a low frequency reference signal. The PLL is a negative feedback system consisting of a voltage controlled oscillator and a phase comparator connected in such a way that the oscillator frequency always matches the input signal, as shown below.

poYBAGL_QhSAE3ELAACiU5d9nSo895.png

In a PLL circuit, two signals, namely, the reference signal and the signal from the voltage controlled oscillator (VCO), are given as input to the phase detector and the output of the phase detector is the difference between the two inputs. This output is the phase difference of the two signals. This output contains frequency components, which are the sum and difference of the signals. So, this output is given as input to a low pass filter, which allows only low frequencies and does not allow high frequency signals to pass. The output of the low pass filter is fed to the voltage controlled oscillator (VCO), and this input acts as a value of the VOC, which must be changed to reduce the phase difference between the two signals. The VCO changes until the phase difference is minimum or the output of the phase detector has a constant error output. This results in a loop lock condition.


Through all these components, the receiver receives the signal from the antenna and then tunes it through the RF tuning circuit and amplifies this weak signal using the OP-Amp and further uses this amplified signal as input to the PLL, which makes the decoder lock to the input digital bits, which produces an output with less noise.


modulation:

Modulation is the process of converting data into electrical signals, and these modulated signals are used for transmission. We modulate the signal so that we can separate the necessary signal from the other signals. Without modulation, all the signals with the same frequency will be mixed together, which will cause errors. There are many types of modulation, and the popular ones are analog modulation, digital modulation, pulse modulation, and spread spectrum.


Among them, the most commonly used one in wireless transmission is digital modulation. Popular digital modulation techniques are amplitude shift keying, frequency shift keying, phase shift keying, and quadrature amplitude modulation.


Amplitude Shift Keying (ASK) Modulation:

In amplitude shift key modulation, a sinusoidal carrier continuously generates a continuous high-frequency carrier, and the modulated signal is a binary sequence that causes the signal input to the switching circuit to be high or low.

poYBAGL_Qg-ARLI8AABdccqLSNo070.png

As shown in the figure above, when the input is low, the switch will act as an open circuit and the output will be zero. When the input of the switch is high, the output will be the carrier signal.


Arduino RF Transmitter Circuit Diagram

Our wireless doorbell project requires a transmitter and receiver circuit, each with its own Arduino board. The circuit diagram for the doorbell transmitter is shown below

pYYBAGL_QguALHqdAAI4dJbf1NQ649.png

Arduino pin 5 is connected to one end of the doorbell switch and the other end of the switch is connected to the power supply voltage. A 10kohm pull-down resistor is connected to pin 5 as shown in the figure. Pin 11 is connected to the data pin of the transmitter module. Vcc is connected to the power supply voltage and the ground pin of the transmitter module is connected to ground.

pYYBAGL_QgeANtcRAAf-iBKusVc337.png

Here I have used a breadboard to connect the module and the push button is used as a doorbell switch.

Arduino RF Receiver Circuit Diagram

Similarly, at the receiver end, we need to use another Arduino board with an RF receiver module. Then the Arduino doorbell receiver circuit also has a buzzer which plays some melody when the button is pressed.

pYYBAGL_QgSAa1qLAAHNnDJm1qo997.png

Here, we connect the pin 7 of Arduino to the positive terminal of the buzzer and the negative terminal to the ground. The power supply voltage of VCC is provided to the receiving module and the GND pin of the module is grounded. The output pin of the receiving module is connected to the pin 12 of Arduino.

poYBAGL_QgGAFP37AAi-TRXbYr4979.png

The receiving module consists of 4 pins, one of which is connected to ground, another pin is used to provide VCC power, and the remaining two pins are used for data transmission. In the above figure, a buzzer is connected to the digital 7 pin of Arduino, while the 12th pin of Arduino is connected to the receiving module output pin.

Arduino Transmitter Code Explanation

The complete code for the Arduino transmitter portion is given at the bottom of this page. The code is explained below.

These are the header files required to send or receive data using the RF module. These libraries make the connection between Arduino and the module easy. Without these, you have to manually write the code to connect the RF module with the Arduino. Create an object "driver" to access the commands for sending and receiving data. You can download the Radio Header Library for Arduino from Github.

#include 
#include // Not actually used, but required for compilation
RH_ASK driver;

Serial.begin() is used to find if the RF transmitter module is working or not. I have initialized PIN 5 (digital pin 5) as an input pin which acts as a doorbell switch.

void setup()
{
   Serial.start(9600); // debug only
   pinMode(5, INPUT);

This code is used to print the message "init failed " when the RF TX modules are not initialized at program startup and only run those .

   if (!driver.init())
        Serial.println("Initialization failed");

The if function checks if the pin is at logic high or low, i.e., whether the doorbell switch is on or off. The pointer msg contains the message we want to send through the transmitter. It is important to note that we must know the number of characters that need to be sent . This will help in writing the receiver code.

   if (digitalRead(5) == HIGH) {
 const char *msg = "a";

The strlen() command checks the length of the message, which in this case is 1. The driver.send() command sends the data to the tx module, which then converts it into a waveform. The driver.waitPacketSent() command is used to wait until the data has been sent.

driver.send((uint8_t *)msg, strlen(msg));
driver.waitPacketSent();

Arduino Receiver Code Explanation

The Receiver program is also given below the Transmitter code at the end of this page , or can be downloaded from here. You can use it directly with your hardware; the code is explained below.

These are the header files required to send or receive data using the RF module. These libraries make the connection between Arduino and RF module easy. Without these, you have to manually write the code to connect the RF module with Arduino.

#include 
#include // Not actually used, but required for compilation

These are header files created for the code to equate frequency values ​​to specific notes and get the note value to get the pitch. If you want to know more about pitches.h or how to play a melody with Arduino and a buzzer, you can refer to this Melody using Tone() Func TI on tutorial.

[1] [2]
Keywords:Arduino Reference address:How to Build a Wireless Doorbell Using Arduino

Previous article:How to achieve heterogeneous splicing with USB/HDMI 4x4 splicing device
Next article:TDA1521 audio circuit

Recommended ReadingLatest update time:2024-11-16 13:44

Arduino-based automatic guitar tuner
One of the most important things when playing guitar is making sure the instrument is in tune. Even the best guitarist won't sound any good with an out-of-tune guitar. Manual tuning with a standard tuner has always been common, but auto-tuners make things easier and more fun! This Arduino-based project will tune you
[Embedded]
Arduino-based automatic guitar tuner
Temperature Control Fan Circuit Using Arduino
The "Temperature Controlled Fan using Arduino" project is simply made around the Arduinouno board and the temperature sensor LM35. These projects are a good example of embedded systems designed using a closed loop feedback control system. To get the right visual indication for the user interface we have also used an
[Embedded]
Temperature Control Fan Circuit Using Arduino
Build a smart vacuum cleaner robot based on Arduino
In today's scenario, we are all busy with work and don't have time to clean the house properly. The solution to this problem is simple, you just need to buy a home vacuum cleaner robot, such as irobot roomba, which will clean your house by pressing a button. But there is a common problem with these commercial produc
[Embedded]
Build a smart vacuum cleaner robot based on Arduino
Latest Embedded Articles
Change More Related Popular Components
Guess you like

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号