Como projetar um toque de campainha sem toque usando Arduino

How to Design a Ringless Doorbell Ring Using Arduino

The COVID-19 pandemic has seriously affected the lives of millions of people around the world. It has caused a significant increase in health awareness and better hygiene. As a result, the electronics industry has seen rapid demand for contactless devices and appliances, such as contactless sanitizers or soap dispensers and automatic doors.

For this project, we will design a ringless doorbell, which can be useful in homes or offices. The doorbell uses an ultrasonic sensor that can be easily assembled at low cost.

We prototyped the ringless doorbell ring using Arduino, which means the code can be ported to any Arduino-compatible platform.

Required components

1. Arduino UNO x1
2. HC-SR04 x1 ultrasonic sensor
3. Doorbell x1
4. Test board
5. Connecting wires/jumper wires

Circuit Connections
To assemble the touchless doorbell, an HC-SR04 ultrasonic sensor and a doorbell are interconnected with an Arduino board. Arduino UNO is used for this project.

The HC-SR04 ultrasonic sensor has four terminals: VCC, trigger, echo and ground. The VCC and ground terminals of the sensor are connected to a 5V DC source and ground of the Arduino. The trigger and echo terminals of the sensor are connected to pins 8 and 9 of the Arduino, respectively. The buzzer is connected to pin 7 of the Arduino.

Circuit Diagram

Arduino Sketch

How the circuit works
Ringless doorbell ring allows the user to ring the doorbell without touching it. The HC-SR04 ultrasonic sensor interfaces with Arduino to enable contactless operation.

The sensor can detect an obstacle or object that is up to 400 cm away. It consists of two ultrasonic transducers: one that transmits 40 kHz ultrasonic sound pulses and another that “listens” to the pulses that vibrate in the obstacle or object. By measuring the width of these received pulses, the sensor evaluates the distance to the object.

The HC-SR04 is capable of non-contact detection at a distance ranging between 2 and 400 cm with an accuracy of 3 mm. The sensor requires 5Vs of operating voltage, which is compatible with most microcontrollers and Arduino boards.

For this project, the HC-SR-04 is only used for non-contact detection up to 10 cm. This distance is suitable for using the contactless doorbell as a door bell or table bell.

A piezo buzzer interfaces with the Arduino and works like a buzzer. It is wired to ring when a logic LOW signal is output from the Arduino interface pin. It remains silent when a HIGH logic is applied from the Arduino pin to the buzzer terminal.

The Arduino is programmed to ring the bell when the ultrasonic sensor detects interference at a distance of less than 10 cm. The buzzer sounds due to applying a combination of square wave frequencies at short intervals. These square waves are generated by the Arduino's GPIO digital output .

How the code works
Start your Arduino sketch by importing the NovoPing library. This library is useful for interfacing the HC-SR04 ultrasonic sensor with Arduino. The library can be downloaded as a ZIP file from the link above.

To install the library, simply open the Arduino IDE, go to Sketch > Add Library > Add .ZIP Library and select the NewPing ZIP file you just downloaded.

Follow this step with pin assignments, connecting the sensor trigger and echo terminals with the buzzer.

Then, a “sonar” object (of the NewPing class) must be instantiated. And, a variable “distance” must be declared to store the contactless detection distance and a variable “I”, which runs the counters.

In the setup function, the buzzer pin is set to output and raised to logic HIGH using the digitalWrite function. In the loop function, the distance to any interference is detected using the ping_cm method of the NewPing class.

If the non-contact detection distance is less than 10cm, the buzzer rings generating different square wave frequencies. These square waves are generated by writing alternative LOW and HIGH logic to the buzzer pin – with different time delays. Finally, the buzzer is silenced by applying HIGH logic to the buzzer pin.

Results

(tagsToTranslate)Arduino

Related Content

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.