So I built a little ESP-12/LiPo battery/charger device which uses a fairly sensitive vibration detector.
I believe the sensor is a little weighted spring in a tube with two contacts.
I set it up to connect gpio-13 to ground and set that up as an interrupt.
When triggered it beeps a little piezo buzzer for 250 ms - like a chirp sound, and publishes a mqtt message.
I tried 5 different vibration switches of varying sensitivity.
It all fits nicely into a little project box which I got from Electrodragon when I ordered a batch of their new ESP-12 breakout boards. They have a half dozen or so different boxes, I got a couple of each and the small one was just the right size.
Here's a picture of inside an out - with a -201 sized breakout board on top so you can see the scale.
My bad measurements size this box out at about 2.5" x 1.5" x .5"
I got impatient and moved it before the hot-glue holding the lipo charger completely set.
I wrote the code for this one in Lua since I prototyped it before the ESP-Arduino ide was released.
I struggled for several days trying to figure out how to use deep-sleep and have the sensor interrupt trigger a wake up and message but I never got that to work - so I included a batter charger instead. I may go back and try to make the ds-wake up code work.
The final application logs the mqtt message to a MySQL DB, and checks the time of day with the activations. If I miss a med at its proper time my wife and I get an email. Same thing if someone is in the meds when they aren't supposed to be.
It's working pretty well for me. Part of my damage is very bad memory problems, so I appreciate being reminded when it's a med time and I've missed it.