Arduino-based Touchless Doorbell

I had purchased an Arduino Uno and Raspberry Pi years ago but had not done much work with them. Over the Christmas holidays, I was browsing on Aliexpress for mechanical keyboard switches. One thing led to another and here we are.

I wanted to keep things simple for my first project. When the sensor detects an object close-by, the buzzer will sound. In addition to the ubiquitous ultrasonic sensor, I also experimented with a couple of infrared sensors. However, they suffered from limited range and had a critical flaw. The amount of infrared light being reflected, and therefore measured, is not only dependent on the distance but also on the colour of the object. Black being the most absorbing.

When it comes to accuracy, ultrasonic sensors are most affected by air temperature. In my case, the sensor will be pointing at a condo hallway. Even in the most extreme temperature fluctuations, the measurement would only deviate ~20% so there would be no issue determining when something is close enough.

The components used and source code can be found on my Github.

Prototype

The prototype is built on a mini breadboard and follows the schematic closely except I had to set up three 330 ohm resistors in parallel since I didn't have any 100 ohm resistors on hand.

In order to have less power consumption, the Arduino will only ping the ultrasonic sensor once every 2 seconds. When it detects an object within 50 cm, the frequency goes up to 5 times a second for 2 seconds. This will continue indefinitely as long as an object within 50 cm is detected in this time period.

Finished product (for now)

the finished product

The ultrasonic sensor was placed into a compact plastic case and mounted outside my door. Because the sensor requires 4 wires, the bell looks a bit funny but it does the job. I also have the Arduino Nano powered with batteries as there was no outlet available nearby. The batteries should last a few months at least but time will tell.

Future versions of this doorbell could see me making use of the ESP32-CAM and its face detection capabilities as well as connecting to a smart home assistant.

Schematic