The need for social distancing and safe health practices such as using sanitizers after using public environments such as taps, switches etc is very much essential to reduce the spread of coronavirus. So there is an immediate need in the innovation involving the touch-free triggers to facilitate actions such as activating taps, switches etc.
In this project, I would like to discuss my idea about a prototype to activate the switch using a proximity sensor. Things to be considered while designing something that helps during this tough situation is mainly having very less existing infrastructural changes. So the solution should be a retrofit and can possibly be fitted on a switchboard to activate the switch based on hand gesture or presence based on the sensitivity.
The major features include,
- 200hrs of battery life,
- Security camera which takes a photo of a person entering the room
- Deep sleep to save battery.
- Portable.
- Sending email alerts
Get the listed parts in the required components section
Step 2: Lets test on a breadboard:In our project sensor is nothing but a small proximity sensor by KEMET, SS-430 The data from the sensor will have a 2 200ms clock pulses as shown in the figure.
In the above figure, the 2 200ms pulses are the ones which show human presence other clock pulses are formed due to false triggering. This false triggering occurring since I was experimenting with the bare sensor without lenses or any other cover. False triggering drastically reduced after I used the plastic enclosure to secure the sensor.
For the test, I just used a microcontroller(Arduino Uno) and the sensor and an LED. After hours of reading sensor values on serial monitor and calibrating it, I came with a small code to correctly detect the presence of a human being in front of it.
Step 3: Connecting a servo and testing it on ESP32 Camera:With the limited number of pins available on ESP32 Camera, I had to use timer 2 and GPIO2 for driving servo and GPIO13 for wake functionality using the Kemet SS-430 proximity sensor.
Reason for using ESP32 Camera is to take a picture and go to sleep mode when the person enters the room or unauthorised place. The image will be saved in the
SD card. To act immediately on the intruder, the ESP32 will send an email to the preconfigured email ID. This needs ESP32 Mail client Library to be installed. Go to manage Libraries in Arduino IDE and search for the ESP32 Mail client and download. You will need a working email ID whose credentials you need to put in the code and later you will have to enable Less Secure Apps. It's better to create a new Gmail ID for this project.
Step 4: Testing Proof of conceptFor a simpler exploded view of the project I thought of assembling the things on acrylic sheet in a modular fashion.
There the plastic box for the sensor is helping in reducing the false triggers. Since the ESP camera goes into sleep after taking photos I cannot perform digital signal conditioning operations on the ESP32 camera. Hence I added another microcontroller to reduce the false trigger and signal conditioning and also for driving servo motor.
You can either use esp32 or another microcontroller both works.
The signal from the pyroelectric sensor is fed to the transistor in an open-collector configuration, once the signal comes transistor gets activated as a switch and hence it connects GPIO 13 to the ground and wakes up the ESP32 camera
In code repositories, Pyrolight code along with camera_pins.h is for ESP32 camera rest 2 codes are for testing with Arduino pro mini.
Please find detailed schematics and Kicad PCB in GitHub repository.
Actually I had ordered PCB from china for this project, but I didn't receive it in time because of the coronavirus outbreak. So I had to use aboost converter and TP4056 module.
Step 5: Mail cameWhen there was an intruder in the vicinity of the sensor, it woke up from the sleep took a picture and sent a mail with an attachment.
Here's how the mail looks like. All this can be done only because of a proximity sensor. Since the whole device is battery powered it allows us to carry anywhere. and make our own smart and safe environment.
You can 3D print an enclosure to fit the electronics as required.
Here's one good design: https://www.thingiverse.com/thing:3816458
Step 6: Working Video :I made a proper PCB shield for esp32 cam board with USB to UART and connectors for servo and the pyro sensor. You can find the Gerber files on my Github repo linked below.
1. Designing a 3D-printed case for the project to make it look like a product
2. Improving battery performance
3. Analog signal conditioning circuit instead of a secondary microcontroller.
Finally, I would like to thank hackster.io for the opportunity and all the opensource community for taking the time and documenting on the internet.
Comments