Electronic Business Card Holder, Part II
If you haven't yet read it, rush on back and read part one of this series... Done yet? Okay, good.
When I left off, I had promised some design decisions, of which, the power source would be the first. I wanted a long battery life. If the batteries need to be changed every other month, it would just get too expensive, and annoying, so I wanted at least six months. A year would be even better.
I did some estimations and determined that a CR2032 coin cell would give me about that longevity. I decided to use two, for good measure, and to make a stable base, but mostly for stability. The two batteries go on the bottom of the card holder, as shown in the photo on the right, and have enough weight to give decent stability. For testing purposes, I also put in connections to use a two-AAA battery holder.
For my first build, I decided to used red and blue LEDs. The blue have a higher forward voltage, so I could get a sense of battery life faster than with the eventual red and green.
Speaking of battery life, the accelerometer was the bigger challenge of the two ICs. The MCU (microcontroller) and accelerometer need to sleep when not being used. The PIC18F46k22 MCU will be easy. I don't need any peripherals on while sleeping. It just needs to wake on interrupt. Given that, it'll range in the area of a few tens of nano Amps during sleep. The MMA8452 accelerometer, on the other hand, is up in the micro Amps.
At the slowest sample rate, 1.56Hz, it draws 6 micro Amps. At a sample rate of 800 Hz, it draws a whopping 165 micro Amps. The sampling rate is critical - it's the number of times per second the accelerometer check for movement. Too slow, and it will miss a fast hand picking up a card. Too fast, and the battery life will suffer. After some experimentation, I settled on 50 Hz, drawing 14 micro Amps. 50Hz was the slowest sample rate that gave reliable detection.
Stay tuned for my next installment, where I'll cover the first build, programming, and the test period.
I'm happy I live in a split level head