Introduction: Tiny Altoid Tin Robot With Personality

Picture of Tiny Altoid Tin Robot With Personality
I love robots. Normally the ones I build are quite large and wouldn't fit in your pocket, but for a change of pace I decided I would try something small and fun! This robot is exactly that, and in fact fits inside of an altoids tin. It is inexpensive, versatile (so many different sensors can be used), and extremely entertaining. Check it out in action below! (Unfortunately I played with mine so much before I took any video I had used up my coin cell batteries and one motor started having issues, so I'm driving it with a 9V in the video)

The project takes some time but teaches a lot about motor controllers, the ATMega chip, and soldering. The most fun thing was picking the different sensors and writing programs to have it react (only two of my four are shown in the video), as you can give the robot lots of 'personality' that way. Never a dull moment when you have this guy in your pocket!

Step 1: Parts List

Picture of Parts List

Since this project is one that has many different possibilities I'll mainly discuss the essential parts.

1 x Arduino (preferably UNO)
1 x ATmega328 chip (other versions work too, more on this later. You'll most likely want one with a preloaded bootloader)
1 x 28 pin DIP socket (holds the ATMega, not absolutely necessary but you really should have it)
1 x 5v Regulator (L7805)
2 x 10 uf Capacitors
1 x 16Mhz Ceramic Resonator (a 16Mhz crystal works too, but you will need additional capacitors which take up space.
1 x pcb board (got a small one that fit in an altoid tin from radioshack for a few bucks)
1 x breadboard (to test the circuit)
2 x motors (I used pager motors with planetary gear boxes from
2 x wheels (also got these from, but you can use whatever works)
1 x L293D (motor driver chip, which is necessary if you will be using motors)
1 x pushbutton (my code revolved around this thing, definitely useful)
Wires! Will need a lot to breadboard and solder.
Coin cell batteries (these keep the size small enough to fit in the altoids tin)

Fun Extras:
2 x photoresistors (lots of fun programs you can write for these)
2 x RGB LED's (gives it the personality!)
1 x mic element (lets it listen and react to sound)
Anything you think would be cool! I wanted to add sound, but sadly didn't have enough space left for a tiny piezo speaker.

Tools: clippers, soldering iron, perhaps a friend to help hold wires

Step 2: Main Circuit

Picture of Main Circuit

There are two main circuits: one for the motor controller (L293D) and the ATmega328 chip.

You can find a pinout diagram of the ATmega328 courtesy of instructables HERE. Basically you are making the simplest arduino circuit possible (I don't even include a reset button, but you can if you'd like). Now the only things you will HAVE to hook up to the ATmega is 5v (regulated by the L7805) to pins 7 and 20, ground to pins 8 and 22 (i drew in pin 21 as blank because it doesn't need to be connected to anything), and the ceramic resonator (or crystal oscillator) to pins 9 and 10. See the pictures for how to use the capacitors with the voltage regulator and be sure to ground the middle pin of your ceramic resonator. If you are using a crystal oscillator you will need additional capacitors, to see how to do that or as another reference for any part of this circuit check the 'ible HERE.

The pinout diagram for the L293D motor controller can be found HERE. I don't have any pictures of this because it's pretty simple pins 1, 8, 9, and 16 get 5v; pins 2, 7, 10, and 15 go to the arduino digital pins (I used ones with pwm to control motor speeds); pins 3, 6, 11, and 14 are hooked up to the motors (the motors run of 3v but the drop through the chip is enough that no diode's are needed); and pins 4, 5, 12, and 13 are put to ground. 

Step 3: Extras

Picture of Extras

These are really up to you, I will show you some simple circuits for the things I added but be creative! This is what gives the robot its 'personality' and makes it interesting. 

Step 4: Testing

Picture of Testing

This is a vital step. You will need to breadboard your entire circuit layout. For now just wire all the sensors and motors up to an actual Arduino because repeatedly taking out the chip to stick in the breadboard would be quite a pain. Once you have done that and written your code (for reference and fun, my program can be found HERE) you can remove the ATMega328 chip from the Arduino and place it into your breadboard. Be extremely cautious when doing this as it requires lots of force and is easy to bend the chip's leads. Once it is in place in the breadboard, connect up the voltage regulator with capacitors and the ceramic resonator to the chip (follow the schematics talked about earlier) and make sure that the voltage is going to the chip at 5v and the program runs as it should free from the board.

Now you're cookin'!

Step 5: Layout

Picture of Layout

Since size is such an issue you will need to take a minute and devise how you will cram it all into your space provided. I used the pcb board as my reference and laid out parts one at a time where I would like them to be and outlined them to get a good feel for where everything would end up. Also make sure to test that your battery holder will be able to attach somewhere and fit into the tin along with your components. Don't forget you will mount motors at some point!

Step 6: Soldering

Picture of Soldering

This is easily the most difficult step as the size and density of the wires makes it challenging. My advice to you, is make sure you solder the voltage regulator, ceramic resonator, ATMega chip, and motor driver chip first and make sure they are completely hooked up before going on to any extras (I got so excited about the LED's and motors that it made getting power and ground to the chip more difficult than needed!). I also recommend putting one long bare wire on the left and right side and hook one to power and the other to ground so it will be easier to connect all the extras to them later. Below you can see the crazy forest of wires as it proceeded.

Step 7: Motors

Picture of Motors

Hopefully you saved some space to mount your motors! The easiest way I found was to drill out an open hole in the pcb and use a zip tie around the front (see pictures). For the wheels from robotshop, I just drilled them out a bit and they popped right on! To keep the motors fixed to the pcb board I used a ziptie that I put through one pcb hole (needed to be drilled out a bit) and then around the front (pics show this better than I can explain). Now you're 'moving'. hah... 

The only other issue was that the wires under the belly of the robot were so thick that the small wheels didn't even touch the ground. To solve this I added a paperclip to the back, which I bent into two triangles and used two beads as wheels to allow a smoother ride (pictures are much clearer on what this looks like).

Step 8: Battery

Picture of Battery

To get a power source that fits in the altoid tin with your robot you will have to get some coin cells. These can be found at most large stores (groceries, target, etc). You will want the combined voltage of the cells to be above 5V, in my case I got two 3V ones and stacked them in series. to make an easy holder I stripped some wire, put one on each side, and taped the whole thing together. This kept things simple for me to connect it to the robot. You're done! Go impress some people.

Step 9: Enjoy

Picture of Enjoy

Now that you've built it, it's about time you give it a name and introduce it to your family and loved ones. It is quite cool though, and is very impressive when you can just pull an altoid tin out of your pocket and have a cute and brilliant robot waiting to do its thing.

Add some sound, make it dance, and let me know what cool things you make! Would love to see lots of tiny robots domin- i mean...


LollipopP1 (author)2016-03-09


DanC12 (author)2015-04-16

Today I went to jc penny

hi15124 (author)DanC122016-01-12

ho cares

yhdesai (author)2015-02-01


--------------------- (author)2013-10-12

I like the design, I am making a small robot with head lights which automatically turn on when it is dark. Any advise?

use LDR

chernani (author)2013-11-22

broken link in Brasil..

arifulislamraqib (author)2013-10-09

ausom haha

vincemarz (author)2013-09-13

does your program include the piezo in it or do we have to add it ourselves? i looked over the program and couldnt find any mention of it and wanted to check

Patrick S (author)vincemarz2013-09-15

I didn't add the piezo in mine, I was just giving the idea. I have some sample code for one in my VIA project so you can check there if you'd like!

vincemarz (author)2013-09-13

here do you get a piezo with three leads? or does like the analog pin connect to the negative pin or something?

ashley van steenacker (author)2013-07-06

you could use the MSP4302353 (launchpad) instead of the ATmega328. The MSP430 uses less power than the ATmega. And the MSP430 is also cheaper as an Arduino. But it has an Arduino compatible IDE. i hope this is somme useful information to you.

Hmm I haven't heard of it, I'll check it out. Thanks for the info.

smching (author)Patrick S2013-07-24

Energia started out to bring the Wiring and Arduino framework to the Texas Instruments MSP430 LaunchPad.

your welcome :)

TREX ZoaR0K (author)2013-06-27

ok im kinda new to this so the microcontroller controls how much electricity is sent to each component by taking the information from the sensors like when 3in from wall reverse motor 1? just so you know I am new to this and not very old

Patrick S (author)TREX ZoaR0K2013-07-04

Yea, kinda! Take a look at this document here:

Should hopefully answer your questions!

giacky98 (author)2013-06-24

No I'm planning to buy them but I need very small motors because I'm trying to build a robot that has a base size of 3x3cm, and I can't find any "gear-boxed" motor that isn't longer than 1.5cm (half the lenght of the platform)... but I've found some 1.2cm-long DC motors and I was planning to use them, but they haven't got a gearbox... that's the problem! :)

Patrick S (author)giacky982013-06-24

Ooh yeah it says the ones I have are about 2cm... Do you want them less than 1.5cm so you can run them directly next to each other (in a line)? On a lot of small robots you'll see motors run one in front of the other just to save space, so you could consider that and it would open up more options! Anyways best of luck, sounds like a fun project!

giacky98 (author)2013-06-24

Hi, I'm building a very small robot that uses (obviously) very small DC motors. There's no space for a gearbox to slow down the speed so I was thinking if is it possible to attach the wheels directly to the motors and then controlling them using PWM. Do you think that it will work?

Patrick S (author)giacky982013-06-24

Great question! It could work, the problem would be that without a gearbox the motor spins very fast but has very little torque and so may not be able to push the robot and you could possibly burn out the motor. Since your robot is so light it might still work without a gearbox. You could do a little testing. I'm guessing you don't want to have to buy motors? Because the ones I used are quite tiny and have a gearbox pre-made on them.

WillieWickedly (author)2013-03-31

Try installing a bumper switch on the front and back so when it hits a wall it will change the direction of the drive motor. Really cool robot though!

Patrick S (author)WillieWickedly2013-03-31

Yeah I pondered that with a button, but the robot couldn't generate enough force to press a button and there wasn't enough space for anything larger. That would be super cool though!

TeacherPhysics (author)Patrick S2013-06-16

How about a limit switch? The following link shows a large one but they come in smaller packages: Extend the arm to increase torque so you won't need much force.

Mic100 (author)2013-05-20

nice job
in futur you can add an IR sensor lake IS471F it very usefull (avoid obstacle at 4-5cm)
and simple to connect

cartergalbreath (author)2013-05-11

What are the photoresitors for?

In part of my program I had a mode where the level of light on each side of the robot would control the corresponding motor, so you could steer it by making shadows. Unfortunately I didn't have it working when I made the video because I had to go back and re-solder a few components.

BrownDogGadgets (author)2013-04-10

Very cool! Way to go!

stringstretcher (author)2013-04-03

Nice job! I voted.


simplebotics (author)2013-03-31

That's awesome, you should make a plastic chassis for it!

Patrick S (author)simplebotics2013-03-31

I was thinking that very thing! I'll just need to get my hands on a 3d printer.

simplebotics (author)Patrick S2013-04-02

How about some lexan and a dremel? Also, how would you feel if I wrote about this robot on my robotics site,

Patrick S (author)simplebotics2013-04-02

Ooh I just looked that up (never heard of it before) and yeah that might work, I'll check it out. That'd be great, go for it!

simplebotics (author)Patrick S2013-04-02

Is it alright if I use one of your pictures?

Patrick S (author)simplebotics2013-04-03

Yeah, no problem.

Holcan (author)2013-03-31

I can find all the materials in a radio shak? Im new in building electronical stuf :(

Patrick S (author)Holcan2013-03-31

Yeah you should be able to get everything but the motors, the atmega328 chip, and the L293D chip. I got everything from though, so it's all available there for sure!

About This Instructable




Bio: I hope to help people with the things I make.
More by Patrick S:Guitar BackpackDIY Prosthetic Leg Foam Cover (Cosmesis)Tact: Low-cost, Advanced Prosthetic Hand
Add instructable to: