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.
RF Transmitter:
The transmitter consists of a SAW resonator tuned to 433MHz , a switching circuit and some passive components.
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.
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.
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.
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
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.
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.
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.
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.
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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications