
After getting a ridiculously good deal on a microscope, I was keen to try out some smaller PCB designs. Naturally, making earrings seemed to be the perfect challenge. Two challenges for this project were fitting everything onto a tiny board and optimizing the ATtiny to draw the least amount of current possible and still be functional, allowing for a good battery life given the tiny battery.
Some design considerations were to have a single button that depending on the duration it was held down, would change the brightness or the pattern currently being displayed. An analogue pin connected to VBAT to monitor the voltage level of the battery. On start up of the chip, it could flash a certain colour to inform the user how much battery life is left. Having a PFET in series with the VBAT solved the possibility of a user incorrectly placing the CR1220 coin cell battery back to front. Even though there is a "+" symbol on the holder, better safe than sorry.


When designing prototypes, its easier to just accept the fact that the first version will instantly need better design considerations, let alone seeing if its wired correctly, it worked perfectly for this design. Just some alterations in the hole that seats the earring hook needed to be changed.

This designed used the WS2812C LEDS, but my second revision is going to use the XL-1010RGC LEDS, to give it that cool factor of just how small the components can get.


With each LED having a max power consumption of 60mA (20mA per channel) and the ATtiny816 having a power consumption of 8mA, I had to significantly reduce the power consumption in order to have a lasting battery life. The CR1220 battery has a capacity for 38mAh. Perhaps the easiest solution was to set the brightness from 100% down to around 5%. This was always intended as you want the earrings to be subtle in nature. With a brightness of 4%, the PCB was still drawing around 8.12mA.
An even better method to reducing energy consumption was to periodically turn on the LEDS for a fraction of the time and then turn them off and put the MCU into deep sleep. Deep sleep on the ATtiny816 was measured at 221μA, not too bad. Another solution was to reduce the clock speed of the MCU. Due to the single wire protocol of the LEDS, the MCU needed to have a timing accuracy of 220ns, this put a floor of around 4.5MHz for clock speed. It turns out that there is parasitic current draw when the LED's are on the board, with a single LED drawing 300μA at 3.3V in idle. I put a NFET in series with the LED's VDD and ground, therefore when in deep sleep, the LED's were physcially disconnected solving the unwanted current draw.
However, there is a trade off when reducing clock speed, the MCU spends more time processing and not sleeping. If you had say a 32MHz processor instead of the 16MHz in the ATtiny, ideally it should take half the time to run through the code updating the LEDs and vice versa. So higher clock chip consumes more current, but is awake for less time, I couldn't be bothered finding out a balance for the Atmel, as there's other MCU's specifically designed for low power. Here is a visual of the ATtiny wake and sleep times. It was awake for only 36% of the time, and the refresh rate of the LEDs were 253Hz.


If you are doing any sort of power consumption testing, you need to get a Nordic Power Profiler Kit II, it is easily worth every cent. I hooked up the earring and as you can see it turns on, then off every 4ms. With an average current of 1.13mA. However, due to the weird spikes of current in which only last about 0.00001 seconds, it seems that this is too much for the CR1220. Well, even the average 1.13mA current consumption seems to ruin the battery as its 10 times the rated continuous current draw. The larger CR2032 battery works, however that is too large.
This left two paths, find an MCU that is specifically designed for low current draw, or find a different sort of battery. I think I'm going to do both, I would like to move away from Atmel chips and into the more industrious STM32's. I have ordered some 10105 LiPo batteries, those which are used in wireless earbuds. The good news about switching to LiPo's will be that the earrings are going to be rechargable.
*Currently making the second revision*
