dala318 / esphome-qmi8658

MIT License
0 stars 1 forks source link

Add Wake on Motion functionality #5

Open lufton opened 3 days ago

lufton commented 3 days ago

Please consider adding WoM feature, witch can significantly improve power consumption of ESP32. I think according to Schematics INT1 and INT2 pins of QMI8658 are connected to GPIO10 and GPIO13 of ESP32. So you can put ESP32 in sleep mode until accelerometer detects motion. Here is an example: https://github.com/lewisxhe/SensorLib/blob/73226fe18641b345700d6dff55a56e01f26af69c/examples/QMI8658_WakeOnMotion/QMI8658_WakeOnMotion.ino#L114

And here is the method signature: https://github.com/lewisxhe/SensorLib/blob/73226fe18641b345700d6dff55a56e01f26af69c/src/SensorQMI8658.hpp#L1143

dala318 commented 3 days ago

Neat idea, I'm not very familiar with ESP32's going to sleep-mode and waking up on HW events (all mine are hard-wired to mains power). But feel free to add the changes you see necessary and create a pull-request.

lufton commented 3 days ago

It’s pretty straightforward with esphome: https://esphome.io/components/deep_sleep.html

I was planning to use this board as bicycle blinker. So putting it in a sleep mode when not in use without switching power would be great!