Skip to content

noah-white-8/Doorway_Detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Doorway Detector

Description

This project uses a Time of Flight (ToF) laser distance sensor to detect when a person or object enters a room and is within 650mm of the sensor. Once detected, a signal is sent to a connected ESP32 microcontroller, which triggers a connected audio module and speaker to play a select audio file that is stored on the ESP32's LittleFS file system.

Additional Features

Waiting Feature

  • The audio will not loop if a person/object continues to be in the way of the sensor
  • The system can only be triggered again once a predetermined amount of time has elapsed after the initial person/object has left the detection region

Custom PCB

  • I designed a custom PCB for this project in KiCAD
  • The PCB will allow anyone to place the different component boards into female headers on the PCB, thus making the design more modular and compact
  • I also designed the PCB to fit within the design constraint of a 55mm door frame width, so it is capable of being mounted directly on a door frame of that width or greater

Wiring Diagram

Wiring

Hardware & Software Components Used

Hardware

  • Microcontroller Development Board: NodeMCU ESP-WROOM-32 module
  • Time-of-Flight (ToF) Sensor: VL53L0X breakout board
  • Audio Module: MAX98357A breakout board
  • Speaker: 8-Ohm, 0.5W speaker
  • Power: USB-C cable connected to outlet
  • Breadboard (or custom PCB)
  • Jumper Wires (or female headers for custom PCB)
  • Soldering Tools

Software

  • Arduino IDE & PlatformIO (both used in development): Integrated Development Environments (IDEs)
  • FFmpeg: Audio file conversion tool (used to change characteristics of the audio file)
  • Audacity: Application that allows you to alter audio files (used to amplify the original audio file)
  • arduino-littlefs-upload GitHub repository: Used the tool this repository provides to upload audio file to the ESP32's LittleFS file system

Code Libraries Used


Project Usage Instructions

Hardware Requirements

  • NodeMCU ESP-WROOM-32 module dev board (or other ESP32 dev board but will likely have to tweak certain things if use a different board)
  • VL53L0X board
  • MAX98357A board
  • Speaker (any 4 to 8 ohm, 0.5W+ speaker should work)
  • Breadboard/jumper wires (or custom PCB, female headers, and soldering tools)
  • USB-C cable
  • Equipment capable of mounting a PCB and speaker or a breadboard, the VL53L0X sensor, and speaker if using the breadboard version

Software Requirements

  • Arduino IDE (I recommend dark mode if you have trouble with your cursor showing up in the code window)
  • The tool in the arduino-littlefs-upload GitHub repository (instructions found here: https://github.com/earlephilhower/arduino-littlefs-upload)
  • Installation of the Adafruit VL53L0X code library (should be searchable in Arduino IDE)
  • Installation of the AudioTools.h library
  • No installation required for usage of the LittleFS.h library

Setup Instructions

  1. Ensure you have the hardware and software requirements fulfilled
  2. Clone this GitHub repository
  3. Open the Code/ArduinoIDE/Audio_audioToolsLib/Audio_audioToolsLib.ino file in Arduino IDE
  4. Use the previously mentioned arduino-littlefs-upload tool to upload the data/ folder to the ESP32's LittleFS file system
    • The data/ folder should contain 'Welcome_small_amplified.wav' which is what is to be uploaded after having plugged the ESP32 into your computer

Breadboard Version

  1. Wire up the ESP32 on your breadboard to the other components as described in the code/docs/diagram
  2. Upload the program in the Audio_audioToolsLib.ino file to the ESP32
    • The system should now function as intended where it is triggered when a person/object is within 650mm and then the waiting/timeout functionality occurs until the person/object leaves the detection region for a certain amount of time
  3. Mount the system as you like on your doorway or other area
  4. Plug in 5V power to the USB-C port

Custom PCB Version

  1. Send the Doorway_Detector.zip file in KiCAD/Doorway_Detector/Outputs to JLCPCB or some other manufacturer to be manufactured
  2. Once you receive the PCBs in the mail, solder two 19 pin female, 2.54mm headers to the appropriate places on the PCB as well as the 7 pin female, 2.54mm header and the 6 pin angled, female, 2.54mm header
  3. As long as you have the NodeMCU dev board, you should be able to just place all of the boards in their appropriate headers and connect the speaker to audio module with jumpers/wires
  4. Upload the program in Audio_audioToolsLib.ino to the ESP32
  5. Mount the PCB and speaker wherever you like
  6. Plug in 5V power to the USB-C port

Notes

Mounting

  • I personally have used command strips and they seem to work fine. But feel free to use whatever mounting equipment you prefer

Previous Design Variations

  • For information on previous design variations that did not end up being the final design, please see the Designs/Design_Variations.docx file

About

The Doorway Detector project detects the entrance of a person to a room and plays a "Welcome" message through a connected speaker

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors