The doorbell (or calling bell) has been around for centuries. While it has evolved to some extent over the recent years, it seems to be lagging behind when compared to the rest of the technology around us. So when KEMET came up with this design challenge - the requirement of detecting someone appearing in front of something - it just seemed like the perfect time to build the doorbell of the future.
The WishlistTo start with, we need to list out what we want from this amazing device.
- It must (at the very least) perform the full function of a doorbell.
- There must be some way for the visitor to interact with it.
- If you aren't at home, you need to still be able to know if someone's at your door ( and who that someone is) by getting a notification on your phone.
- The visitor needs to be able to leave a message, even if just a simple message asking you to call back.
- It should be possible for a courier service to deliver a package to you, even if you aren't at home to receive it. Similarly, if you need to return something you bought or a friend needs to pick up something from your place, it should be possible even if you aren't home.
- It would be nice if there was a way for the device to inform the outside world if your house caught on fire when you were away at work or on a vacation.
- And finally, we would absolutely love it if the cost of building this fancy device could be kept below 50$.
The design of this system has three parts - the Door Unit, the Storage Unit and the Mobile App.
The basic working of this device is as follows:
The system is in a low-energy sleep state until someone turns up at the door. The PIR sensor (SS-430) detects this presence and the door unit comes alive. The visitor is presented with three options viz., 1.Doorbell 2.Message and 3.Package. If 'Doorbell' is selected, a conventional doorbell is rung and in addition to this, a notification is sent out to the Mobile App. The user can now request a snapshot of the visitor. If the visitor is not satisfied with the lack of response (if you're not at home), they now have the option of selecting the 'Message' option. This takes them to the Messages Menu which offers them a selection of messages they can choose from (like 'Call me back' or 'I'll come by later'). If a package needs to be delivered or picked up, 'Package' is selected. A One Time Password (OTP) is required to be entered and after authenticating this password, the cabinet drawer is opened for short length of time for the package to be dropped off or picked up. A confirmation message is then sent to the user as a notification.
1. The Door UnitThe Door Unit comprises a touchscreen, a camera, a bell/buzzer, the motion sensor and a thermal sensor unit to detect unusually high temperatures inside the house (like in the case of a fire). The touchscreen is a 9340 controller-based 2.4" TFT display (Arduino shield) riding on an Arduino Uno.
<<>>
The camera is an OV2640 module attached to an ESP32 board.
<<>>
The design consideration here is that if we kept the modules separated, each module can be evolved and tweaked independently and smaller controllers work out way cheaper than one heavy-duty controller capable of doing all of the heavy lifting. The communication between the two microcontrollers is carried out via a 74LS164 - 8bit shift register - the main information being the menu options that are being selected. Since it is the touchscreen that must respond to the human presence, the SS-430 is attached to the UNO. A similar reasoning leads to the decision to attach the thermal sensor and the buzzer unit to the UNO as well.
<<>>
Since once of our design requirements is Layout Efficiency, a stacking design is chosen with the 74LS164 placed directly below the Arduino UNO board. The entire unit is assembled on a 10cmx7cm PCB.
<<>>
Since flexibility of placement is crucial for both thermal sensor as well as the motion sensor (and also the buzzer), these are not soldered onto the PCB. Instead, they are given leads so as to be able to position them optimally.
<<>>
The thermal sensing and cut-off unit is also designed to be able to shut off the power supply to the house in case of fire, so the relay responsible for this is combined along with the thermostat switch on the same board.
<<>>
One important point to keep in mind while buying the touchscreen (which I didn't, unfortunately) is to make sure you pick up a module that allows the backlight to be turned off through code. The board that I picked up has the backlight hardwired to the controller IC and it's very sad that I can't show a "coming alive" effect when the SS-430 kicks in.
Another challenge that props up here is the number of GPIO pins that one is left with after the TFT shield is inserted. There is just one pin left over and fortunately it is an analog pin (A5) - this allows us to use a light sensor to adjust LCD brightness, if we want (I have't done that here, though). What I have done is also use the SD card pins (10,11,12,13) since I will not need the SD card for this project. The shift register comes in because of this constraint - 2 UNO pins give us 8 bits of information for the receiver module (ESP32) to consume.
The ESP32-CAM is a convenient solution if images are to be sent over WiFi.
A small word about my original design: I had intended to use the ESP32 as a streaming video server and connect with the cabinet via Bluetooth. It worked perfectly well (In fact, the communication between door and cabinet was BLE notifications) so if anyone out there is trying to replicate this and you feel the need to use BLE, please go ahead without worrying about the stack congestion that is reported in a few places. But it struck me a little late into the project that there was absolutely no need to use two different protocols on the same radio frequency. I already had the Wifi set up and another ESP module in the storage cabinet design... All I had to do was use WiFi for everything. And also, video was a bit of an overkill for a doorbell device - a snapshot of the person ringing the bell should suffice.
2. The Storage UnitThe Storage Unit comprises a cabinet whose drawer is opened and closed by means of a stepper motor and a lead screw. For anyone unfamiliar with this, it is exactly the same mechanism used in CNC machines and 3-D printers (except that this is only in one dimension). The Password authentication is achieved by means of a TM1638 breakout board - 8 LEDs, 8 7-segment displays and 8 push button switches - a perfect prototyping add-on to test our device.
Side Note : The power module that was driving this board was defective and ended up frying the board (not completely - 4 of the 8 buttons stopped working). With no spares, no time to get replacements and a great reluctance to add additional buttons or keypads, I decided to make the password only 3 digits instead of 4 and instead of two buttons for open and close, I'm going with a single button in toggle mode.
The original design had the password being delivered from the Door Unit ESP32 to the Cabinet's ESP32-CAM via Wifi. But after spending some time with the Mobile App (which I was writing on an Android platform), I stumbled upon Blynk. I can safely say that I will not be prototyping with any other platform from here on because of the clean and simple approach that the author has taken in seamlessly connecting all the hardware components involved. So when I switched to Blynk, one of the first things to change was the password delivery, which was taken care of by the Blynk app. On matching the entered password with the password delivered via Blynk, the cabinet opens. Instead of calibrating the opening and closing according to the size of the cabinet, I used two roller microswitches in the design (Yes, they're manufactured by KEMET :) ) to make the design totally size-agnostic. Two small notches enable the roller switches to act as START/STOP triggers for the controlling stepper motor.
Although this part of the project was probably 1/100th of the effort that went into all the electronics and coding of the other stages, it was definitely the icing on the cake. How it works is as follows: When the visitor shows up at the door, a notification is sent to the user on the App. The user can then choose to click a picture and view the scene outside his door (from anywhere in the world, of course). If a package needs to be delivered or picked up, a password is generated by the user and sent to the cabinet from the App. The Blynk platform has been designed to integrate seamlessly with so many hardware platforms and changed my entire approach to the way these projects are designed. One important design change was uploading the picture taken at the door to an ftp site and that picture gets displayed by the app.
Comments