How-To: Shrinkify Your Arduino Projects

Uploaded by makemagazine on Oct 9, 2011

If you’ve got a simple Arduino project that uses only a few pins, you might be able to
shrink it down to a single, small chip. Doing so can save you a lot of money and it’s
actually pretty easy. I’ll show you how.
This technique comes to us from MIT Media Lab’s High-Low Tech Group and I like it
a lot because you’re still using Arduino code to program the chip. Let’s take a look
at what you need: An Arduino Uno or Duemilanove to act as the programmer, an ATtiny45 or ATtiny85
chip, They’re cheap, about two fifty each. A ten microfarad capacitor, a solderless breadboard,
some jumpers, and whatever components you’ll need for your project.
I’ll assume you already have the Arduino IDE installed and you’re already familiar
with how to upload sketches to the board. Start by downloading the additional hardware
support files from the High-Low Tech Group’s site. Create a folder called “hardware”
within your Arduino sketchbook folder and drop the folder you downloaded into it. Now
open up the Arduino IDE. If you’ve installed the files correctly, you should see a few
new selections available under the board menu.
Now let’s set up the Arduino to program the chip. First open the Arduino ISP sketch
from the examples menu and upload that to your Uno or Duemilanove board. When you’re
done, you can close that sketch. Then Place the ATtiny chip on the breadboard. The dot
indicates the upper left side of the chip and pin number one. The rest of the pins are
numbered ‘round the horn like this. With your Arduino close by, connect Arduino pin
10 to ATtiny pin 1. Connect Arduino pin 11 to pin 5. Arduino pin 12 goes to pin 6. and
Arduino pin 13 goes to pin 7.
Send power from your Arduino to the rails of your breadboard and connect the chip’s
pin 4 to ground and and pin 8 to five volts like this.
Just one last step to set up your Arduino as a programmer: Put the ten microfarad capacitor
between the ground and reset pin. Remember that electrolytic capacitors like this one
are polarized, so the negative side must go to ground.
So let’s test it out now. Open up the blink example sketch in the Arduino IDE. This sketch
will blink an LED on pin thirteen. However, there’s no pin thirteen on this chip, so
we’ll just have to change it to one of the I/O pins available, zero through four. Refer
to this diagram to determine which I/O pin is which. Keep in mind, they’re numbered
differently than the package’s pin numbers. For this example, I’ll blink pin three.
Make those changes and select the appropriate chip from the board menu with the Arduino
as ISP.
Go ahead and upload the sketch. You may see an error that says you have to define PAGEL
and BS2 signals, but don’t worry about that, it should have worked just fine.
To prove it, hook up an LED. If you see it blinking, you know you’ve done it right.
Now you can get rid of all the arduino connections and power it with just a battery. I used the
ATtiny to make a little blinky toy like this one. Another advantage of these small chips
is that it uses less power than the Arduino, but they also come with a few drawbacks. There’s
not as much memory for your sketches and not all Arduino functions will work, you’ll
have to try it out and see what works for you. So check out the write up by MIT Media
Lab’s High Low Tech Group. I’ll put a link below. Until next time, so long.