How is that old adage? A picture is worth a thousand words?
Okay, it's just a excuse - I'm a lazy bum.
How is that old adage? A picture is worth a thousand words?
Okay, it's just a excuse - I'm a lazy bum.
So, let's say that you want to use your Arduino board with a LiPo battery. What would you have to do?
WARNING: If you have never used a LiPo battery before, I strongly advise you to read this guide before continuing. This guide will teach you the basic safety precautions required by this kind of battery.
If you do have the money for it OR if you don't fell comfortable working with the steps that I'm writing below, I suggest you buy a board that already has a USB LiPo charger embedded, like an Arduino Fio* - the only practical difference between this board and what I'm presenting here is the more expensive price and the impossibility to use it @ 16Mhz without modifying the board.
Since I'm always concerned with simplicity, I'll only suggest already tested and safe modules. We don't need to reinvent the wheel, do we? This is just a simple Arduino power guide.
Charger/Booster | LiPo, 1S1P | Micro USB-B Cable | JST RCY Connector | 2pin molex |
Why use a "low discharge" battery and what the hell is that? The discharge rate is simply how fast a battery can be discharged safely, suffice it to say that we don't need a battery with a high discharge rate (the normal type out there) for devices with low consumption. Our Arduino is a low consumption device (it requires 100ma, tops) so a low discharge rate battery is more appropriate, safer and it will drain slower than a normal battery. If you want to know more about LiPo Batteries, take a look into this link.
This is the basic wiring to power up any Arduino board running at 5v (pictures 8 and 9). It's important to note that we are wiring the charger's output straight into the uC and it's not passing though the internal voltage regulator (the LM whatever LDO). That being said make sure to use only 5v regulated power sources otherwise you will melt your little friend.
The booster is also available in a single module, without the LiPo charger:
The Sparkfun's USB LiPo charger/booster used above can be configured to work at 3.3v, you can see how to into its guide, doing so you will be ignoring it's embedded booster circuit. For this scenario it's better to use one simple LiPo charger instead - cheaper and smaller.
Charger | 5v Booster | Another Charger | More Charger |
At this point you did powered you Arduino however you didn't wired the USB data pins (D- and D+), there's no such pins in the LiPo charger nor in the 5v booster - both modules don't care about these signals. They could have designed these modules taking into account these pins but they didn't. Why? I think they are just assuming that you are only using the USB cable to charge your LiPo or to provide power to your device, not to communicate with your computer (silly assumption).
To enable the USB communication you will need one USB 2.0 header like the one I did here.
continue ...
Sometimes you will need a way to identify when the device is been powered by the USB or been powered by the LiPo. This is not required but it will help some wireless applications (if you don't need or don't have a clue why an wireless application would require it just wait my next post - when I'll wire a bluetooth module to one LiPo powered Arduino).
The easiest way to identify when the board is been powered by our LiPo is to check the USB 5v presence. You will need one 100k resistor, one wire with 2.54mm headers and one USB 2.0 header.
/* USB 5v –> 100k resistor –> Arduino A5. Blink when powered by LiPo. */ #define DEBUG // Pin 13 has an LED connected on most Arduino boards. int led = 13; // Analog 5 will be used to read the vcc line voltage. int vcc = A5; // the setup routine runs once when you press reset: void setup() { Serial.begin( 9600 ); // initialize the digital pin as an output. pinMode( led, OUTPUT ); } // the loop routine runs over and over again forever: void loop() { int vccA = analogRead( vcc ); float vccR = vccA / 204.6; #ifdef DEBUG Serial.print( "VCC Voltage: " ); Serial.print( vccA ); Serial.print( " - " ); Serial.print( vccR ); Serial.println( "." ); #endif digitalWrite( led, HIGH ); // turn the LED on (HIGH is the voltage level) delay( 1000 ); // wait for a second if( vccR < 3.3 ) { digitalWrite( led, LOW ); // turn the LED off by making the voltage LOW delay( 1000 ); // wait for a second } }
204.6? what's that? Take a look into the documentation of the function analogRead and try to figure it out by yourself as a mental exercise.
What do you think about a guy who's willing to spend US$ 300,00 on a single keyboard key? Yes, a keycap, that little square thing that you press to get chars into your text editor in order to write your marvelous texts (this one excluded, please, my English sucks and I'm shy anyway).
Right now everybody is talking about the Pope's ring, don't know why. Even you, I doubt you haven't heard about it. This dummie ring is just a piece of gold (metal, diamonds, etc), used to adorn one ancient finger. Useless stuff, however, I'm sure that this loveable ring costs more than this stupid keycap ...
Have you ever heard about keycaps that glow in the dark? Better than the ring (I could melt the ring to make some keycaps though).
Don't complain about the keycap and I'll shut my mouth. Who cares anyway?
The thing is that keyboards are awesome devices to start working in the microcontrollers world - they are cheap and I bet they are everywhere in the universe where there is intelligent life. A keyboard is basically a microcontroller tied to a matrix of switches arranged according to your keyboard design. A few switches wired into an array matrix, a few leds, the microcontroller and the software to read the switches, it's as simple as that.
You will see that there are a huge community out there designing and building really cool keyboards. Take a look:
WARNING: the content below is highly addictive for geeks.
Only three links but the amount of info there is bound to thrill you! Lots of awesome pictures too ...
This ring is only US$ 255 bucks.
I still haven't finished my "USB Devices" tutorial because I bumped into all this keyboard stuff (as I have said: it's addictive!).
Revised on 14/08/2013