Lucy is my Border Collie & Schipperke mix dog. At nine years old, Lucy is blind now. She has Progressive Retinal Atrophy which has slowly taken her sight from her. But she still loves to chase after her stuffed toys or balls when they are tossed a few feet away. Unfortunately, she has trouble locating it if the toy takes an unexpected bounce. We purchased a chime ball to see if that would help. The ball must be switched on manually and emits a chiming sound every five seconds until it is switched off. Lucy can find the chime ball easily, but doesn't like it when the ball sounds off in her mouth.
I've designed a beeper to insert inside one of Lucy's stuffed toys. It will have a small LiPo battery for power. A LIS3DH accelerometer detects a free-fall condition when her toy is tossed into the air and begins emitting a tone to let her know where the toy is. After a few seconds the tone will stop until the toy is tossed again. At least that's the plan.
The LIS3DH accelerometer requires a microcontroller to program it, via a SPI interface after power is applied, otherwise it won't do anything. I chose a PIC16F18313 for the µC for the following reasons:
- Low power dissipation. Less than 0.1µA in sleep mode, and less than 30µA when running at 32kHz.
- Built-in SPI interface.
- 10-bit ADC to measure battery voltage.
- Wide power supply range - 2.3VDC to 5VDC
- SOIC8 package is pretty small.
After adding a MCP73832 battery charger and a few discrete components the circuit looks like this.:
At the last minute I lost my nerve and added D1 to level shift the VDD voltage down to a max of around 3.6V. The LIS3DH has an absolute maximum VDD = 4.8V, but only specifies VDD=3.6V otherwise. If it can survive 4.2V, then D1 can be shorted out.
The PCB design is complete and measures 15mm x 15mm...the same dimensions as the 120mAh LiPo battery. I decided against using a lithium coin cell because I did not think that it could be attached well enough to survive the expected treatment. The LiPo will be attached with two small leads and a micro JST connector. It will probably be glued to the component side of the PCB. A micro USB jack, for charging, and a small buzzer completes the module.
At this point I have been able to program the PIC to configure the accelerometer to detect a free fall event and trigger an interrupt input on the PIC. The PIC will then use the buzzer to emit a series of beeps for a couple of seconds and then a short 100ms beep every 2 seconds for 5-10 seconds. After that it goes to sleep and waits for another free fall event. After I play around with the prototype board for a while I will order PCBs.
The PIC is using < 1µA during sleep mode. The LIS3DH is supposed to consume about 4µA when sampling at 10Hz. I figure that the 120mAh LiPo will need to be recharged about once per year.