Fun Presence Detector

by danielgass in Circuits > Arduino

121 Views, 0 Favorites, 0 Comments

Fun Presence Detector

IMG20240728095009-removebg-preview2.png

Creation of a fun presence detector. I use the assembly to monitor the presence of children in front of my bookshelf.

A display shows detection. If after 2 minutes detection is still active, an e-mail alert is sent.

Very low current consumption for long battery life and battery monitoring.

Features :

  1. HCSR505
  2. ESP12F controller.
  3. E-mail function.
  4. OLED display.
  5. Soldering breadboard.
  6. Powerpoint software for placing components on the test breadboard.

Circuit

circuit.png

All project files (Arduino programs and schematics) can be downloaded here. A set of inspirational links can be found at the end of this document.

The heart of the system is an ESP12F module. It handles sensor reading and communication via its graphic and Wifi interfaces.

A => Presence detector. When triggered, the output signal becomes positive. Two mosfett transistors power the microcontroller (C).

D => The microcontroller starts a 3-frame animation loop with sound (E, F). After a few seconds, when detection stops, the circuit is powered down.

If the detector remains active for more than 10 seconds, the controller activates the GPIO13A pin. This has the effect of substituting the detector signal. The controller will remain active independently of the detector.

The controller starts the network connection and sends an alert email.

G => The program can be updated using a USB-TTL converter. Switch (H) puts the controller in program reception mode.

Assembly

layout.png

The assembly is simple.

The aim is to use a soldering board that matches the test board. The components are placed as they should appear on the soldering board. I used Powerpoint software to help me place the components correctly.

The use of a soldering board greatly facilitates the quality of the assembly. The layout of the components with Powerpoint is quite playful. The number of wired connections is also limited.

Power consumption

The power consumption of the circuit in standby mode corresponds to that of the detector. It is 40µA (per measurement), which guarantees long battery life.

Thanks to an internal function of the ESP12F, it is possible to know the supply voltage. Each time the controller is started up, the voltage is checked. In the event of low battery, an e-mail is sent.

Arduino Program

The program is made up of several parts (see the "Presence detector" folder):

  1. The main program and all the functions for sending e-mail.
  2. The network.h file contains the network and mail identifiers.
  3. The eyes.h file contains the frames to be displayed.

The mail functions are taken from Github (https://github.com/mobizt/ESP-Mail-Client ), where you'll also find detailed explanations.

Using external files/functions makes the main program with its annotations more readable.

Sources of inspiration :

 == ESP12F

 https://arduino-esp8266.readthedocs.io/en/latest/libraries.html#esp-specific-apis

 == mail

 https://github.com/mobizt/ESP-Mail-Client

 == eyes frames

 https://www.instructables.com/Arduino-OLED-Eyes-Animation-for-Robotics-Projects/

 https://ctmprojectsblog.wordpress.com/2022/02/10/arduino-oled-eyes/

 https://github.com/Vin-X-Mod/OLED-Moving-Eyes-Arduino/tree/main?tab=readme-ov-file

 https://circuitdigest.com/microcontroller-projects/arduino-oled-eyes-animation-for-robotics-projects

 https://www.youtube.com/watch?v=rb1CdDpUVDA&ab_channel=VinnyBuildsStuff

 == sound

 https://projecthub.arduino.cc/tmekinyan/playing-popular-songs-with-arduino-and-a-buzzer-546f4a

 == soldering card

 https://www.upesy.fr/

Conclusion

In this simple project I wanted to highlight a few ideas (use of Mosfet transistors, battery level measurement, soldering plate, use of ESP12F module). With a few modifications, this module can also monitor intrusions (cellar, garage).

If this project gives you any ideas, I'd be delighted. Enjoy it!