the78mole / BThomeTrap

A BThome device for sending trap events.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BTHomeTrap IoT Mouse Trap

An ESP-IDF project which reads hall sensor in ULP unit and sends data encoded in the BTHome format over BLE.

The hall sensor of the ESP32 is read in Ultra Low Power coprocessor in deep-sleep mode with consumption about 0.00016A. When hall sensor value trips more than 15 units, it wakes up main ESP unit, creates a BThome advertisment containing the event and its counts, adds the battery voltage and broadcasts the BLE signal (in BTHome standard), after that, it goes deep-sleep again.

Instructions

  1. Set up vscode with platform.io (recommended) or a CLI platform.io project
  2. Run build
  3. Upload to your board
  4. Connect 5V/VBat through 100K/47K Divider to ADC1_CH6
  5. Connect 3V3V through 100K/47K Divider to ADC1_CH5
  6. Place the ESP32 where the magnet will appear
  7. Power the board (with USB or with battery)
  8. New BTHome device should appear in home-assistant automatically

Assembly

Mouse Trap Assembly Wiring

Home Assistant BThome

HA-BThomeMouseTrap

References

  1. BTHome Water Meter
  2. BTHome Weather Station
  3. ULP Pulse Counting Example
  4. BTHome

Improvements

  • Use even less power (maybe unmount the power LED of the ESP DevKit)
  • Add OTA functionality

About

A BThome device for sending trap events.

License:Mozilla Public License 2.0


Languages

Language:C++ 77.9%Language:Assembly 12.5%Language:Python 5.8%Language:CMake 2.3%Language:C 1.5%