Introduction: LinkIt One : Coolest Battery Indicator
One of the best thing about LinkIt One is it come with a 1050mAh rechargable battery. This will help you in letting the projects run without connecting to any additional power supply. And with Wifi and BLE, this makes projects true "mobile".
In this instructable, I will brief about a cool battery charge indicator using LEDs.
LEDs - 4
Resisters 4K7 - 4
Step 1: Step 1 : the Hardware
Hardware connections are very simple.
In my code, I have defined some LinkIt One digital pins as LEDx. You will have to connect to these pins to the LEDs. And of course, you can change these pins too, by changing the definition. The connection should look like
LEDx pin -> Resistor -> LED(p-side) -> GND
Default connection for my code is
D13 -> 4K7 -> LED3(p-side) -> GND
D12 -> 4K7 -> LED2(p-side) -> GND
D11 -> 4K7 -> LED1(p-side) -> GND
D10 -> 4K7 -> LED0(p-side) -> GND
Step 2: Step 2 : the Sketch
In the sketch, first initialize the led pins as output. Then inside the loop, we will continuously monitor the battery charge and update the LEDs accordingly. If the battery is charging, a nice animation with the LEDs will be played.
Find the sketch attached
Step 3: Step 3: There Is No Step 3 ;)
Yes! You are done.
Simply assemble the circuit. Make sure that the power source selection switch is put to BATT position.
Now when you connect the battery alone, leds will display the level of charge. If you connect a 5V charger or to a PC, LEDs will start playing nice animation.