I recently received an impExplorer Developer kit. It looks really good and I’ve started getting to know all the attached sensors.
For my first device-led project, I wanted to test out the LIS2DH12 Accelerometer and what better way to do this than to find a suitable smart home test application.
So, as I recall the washing machine project (old forum link here), which also used an accelerometer (although a different one), I came up with a variant on this project.
I am now trying to get my head around the LIS3DH imp library and work out the best-practice approach for this application (i.e. detect washing machine spin cycle / washing cycle - if possible).
I’m also considering other sensors (water, door, etc.) as well as the included environment sensor (temp, humidity, pressure), so my first thought was to use a wakeup timer to periodically wake up (say every 3 seconds) measure sensor readings (such as accelerometer, water, door), record data and then back to sleep. If an event is detected, then send an alert to agent etc. Environment sensors can be much less frequent. So, not sure if putting imp into a deep sleep is best here as this is a power down of imp and I already have control of sensor power via power gate (pin 1).
So, any advice appreciated here. As in, can wakeup timer approach be used here (with some low power option) without draining the battery? If this approach is taken what are the best settings for the accelerometer (e.g. sampling rate)? Was not sure about fifo’s… did not think applicable here, but maybe I’m wrong.
The alternative approach was to come up with some form of interrupt for accelerometer (in particular). Not sure what can be down with water door as have no connection with pin 1.
If Interrupt method, how do I go about setting this up with the accelerometer? Then, if pin 1 is used as the power Gate, what then? I was considering a hybrid approach (when power gate not needed use as interrupt option, then disable interrupt and switch to output mode to power sensors) but maybe this is overkill.
Anyhow, any feedback will be greatly appreciated.
Thanks.