Using Alternative Power Sources
For these microcontroller projects, there are three main DC voltage sources: batteries,
wall adapter or the USB port of a computer. Generally, this power is dictate by
the requirements of the devices that you use. These devices consist of the actual
microcontroller and any peripheral that is connected to the microcontroller in some
way. Peripherals may be sensors, other ICs (integrated circuits), etc.
So, what do I mean by "dictated by the requirements of the device"? Let's start
with the actual microcontroller. The microcontroller can only accept a voltage within
a range. The Atmega32 can only receive a voltage range from 4.5 volts to 5.5 volts.
That's not a large range, and makes it somewhat difficult to add other peripherals
that use different power requirements. The Atmega32 was made to receive generally
5 volts and gives you .5 volts leeway in both directions. Fortunately, the new Atmega
324, that replaces the Atmega32 microcontroller can accepts a greater voltage range.
The atmega 324A can accept a voltage in the range of 1.8 volts to 5.5 volts. The
lower voltage is used in low power circuits. The Atmega 324p has a range of 2.7
volts to 5.5 volts. This range allows the use if standard peripherals that require
3.3 volts or 5.5 volts.
If you are selecting a microcontroller, also be conscious of the other components
that will be used in the circuit. Try to find components that will match the voltage
range of your microcontroller so you will not need to provide a voltage source at
two levels. For example, if you have the older Atmega32, and you want to use an
accelerometer that only accepts 3.3 volts, you will need to provide two voltages,
one for the microcontroller and another for the accelerometer.
Power Sources
So, where do we get the power? We can use batteries, a wall adapter, or the usb
port from the computer. If you are using a wall adapter, the voltage must be in
DC. So, lets investigate each one a bit further.
Batteries:
There are many types and sizes of batteries, each with their own voltage. To complicate
matters more, they also have variable hours of operation. This is called mAH (Miliamp
Hour), which is how long the battery will last if the battery is having it's current
drawn from a load on the circuit that only draws 1 miliamp. One miliamp is not very
much current, so batteries will not very long, so they should only be used for purposes
where electricity can not be acquired otherwise. Rechargable batteries are a good
consideration, especially if used in a way that the batteries can be charged from
a renewable source.
So, since these batteries have different voltages, how do you get the voltage you
want. This is actually pretty easy. All you need to do is put batteries together
in series. For example, if you are using batteries that give an output voltage of
1.5 volts, which is a standard voltage for batteries like the "AA", "AAA", "C",
"D", etc. You can connect them together and just add up the voltages from each battery.
If two of these batteries are used, then you can expect 3+ volts. The "+" is that
new batteries will actually be more than just 3 volts. So, how can we get a good
5 volts?!? That's actually a problem, these is no good way to get 5 volts with a
battery without using another components to regulate the voltage (this is discussed
farther down the page). If you add another battery to the 3 volts of two batteries,
then you get 4.5 volts, which is too small. If you add another battery, then you
get a whopping 6 volts. Well, that would just break microcontroller, so we definitely
cannot use this.
So, how are batteries connected together? Take one battery's "+" pole and connect
it to the other battery's "-" pole. That's it!
Wall Adapter:
These adapters are also called wallwarts (I think you may know why!). If you are
using a wall adapter, then you just need to select a wall adapter that has an output
the matches your devices. If you will be using a regulator (discussed below), then
you will need a voltage above the voltage you need.
All of the wall adapters that I have found, or extracted from all of my disposed
electronics, have the input and output information specified on the backs of the
adapter (or the face of the wart). The input will match the power of your country.
An adapter in my country of the US will be in the range 0f 110-130 volts, but this
voltage is AC (Alternating Voltage, generally in a signwave form, or current and
voltage miving fack and forth in the wire/circuit). The output voltage will also
be listed, and it must be in the form if DC (Direct Current).
USB:
This is an easy way to get a good smooth form of 5 volts of DC. If your components
can accept 5 volts, then this is a good power source. The easy parts is how to tap
into this voltage. Just get out one of your thousands of usb connectors in your
house, under your cushions, under the junk on your drawers, etc. and strip the cable
until you see four wires, two of which is black and red. The black is the ground
wire (0 volts) and the red wire is the 5 volts. Al you may need to add is a capacitor
or two to smooth out the voltage and your good.
Regulators:
If you are using batteries (or if you cant find a wall adapter with the correct
voltage) you will need a voltage regulator. There are many regulators out there,
but I generally use one or two of the following: 7085, Max 603, or Max 604.
7805:
This is a very popular regulator and probably in hundreds of gadgest and electornics
in the home. This regulator simply outputs 5 volts as long as the voltage received
(input) by the regulator is 2 volts higher than the 5 volts. The 2 volts is called
the dropout voltage. So, the regulator can accept 7 volts to get 5 volts, but if
there is a ripple in the voltage, then it is safer to provide a minimum of 8 volts,
but don't go higher than 30 volts. The regulator will breakdown above 30 volts.
Max 603/604:
This voltage regultor also outputs 5 volts for the 603, or 3 volts for the 604,
but has a much lower dropout voltage. This IC is intended for use with batteries
and the 6 volts (using he Max 603) from, say 4 "AA" batteries will allow 5 volts
of output, but don't expect the regulator to work if you provide more than 11.5
volts. In fact, don't even expect the magic blue smoke to be contained within the
chip. These regulator can even provide many other voltages if configured to do so
using resistors.
Capacitor considerations:
You will notice in the video, I use a few capacitors. I've even gotten requests
to explain this, so I made another video on the subject. In short, the capacitors
are used to smooth the "not so perfect" DC voltage. There is a capacitor used before
and after the regulator.