My first step was creating requirements document (you can see it in DETAILS section). After that was done, I moved to components selection stage. I treated this task as a engineering exercise and decided to keep the parts cost as low as possible (while maintaining required functionality).
Microcontroller
Some time ago I stumbled upon STM8 family, which can be viewed as AVR competitor. So far I've only used AVR and STM32 microcontrollers and I wanted to try something new. I did some research in terms of peripherals (I needed around 20 I/O pins, at least two ADC channels and two timers) and memory.
Eventually I decided to go with STM8L151C2T6, which can be bought for $1.20 @100qty from Mouser. This MCU has 4kB of flash, 1kB of RAM and can run at 16MHz.
Battery charger
I want to charge the battery via USB port. The battery will probably have a capacity of around 500mAh. I looked for a linear charger that would automatically handle the charging process (CC-CV cycle, overtemperature protection etc.) with max current of around 500mA.
I found that MCP73833 fits my needs and it costs around $0.70 @100qty, which is nice.
Voltage regulator
Maximum battery voltage exceeds allowed MCU input voltage (3.6V), so I had to use some form of voltage regulation. I decided to go with buck converter to step down battery voltage to around +3.0V. My main requirement is good efficiency at low currents (a few milliamperes) and TPS62260DDC has great efficiency curve. Also, it's not that expensive: $1.08 @100qty.
LEDs driving
I did a bit of research on LED drivers. The LED bar will consist of 10 LEDs. I've found one promising chip: AS1122, but the price is pretty high ($1.73 @100qty).
One important note here: only one LED from LED bar has to be dimmed at certain moment (other LEDs are either on or off). Global brightness control (to accommodate to ambient light) of all LEDs can be done using one transistor. Individual LED control can be achieved by using software PWM and only PWMing the output of currently dimmed LED from LED bar.
Currently I decided to control the LEDs simply using MCU pins and one NPN transistor to control the brightness (see schematic in next log), but now I think that I may add AS1122 to the schematic, just to test the chip and compare the results.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.