Does this project spark your interest?

Become a member to follow this project and don't miss any updates


Tiny robot family

A family of tiny robots, each with their own way of life.

Similar projects worth following
This is my growing family of tiny robots based on ATtiny controllers, pager motors and photo-transistors.

These three little autonomous vehicles have a lot of similarities such as controller, battery and movement mechanism, and they all percieve the world through photo-transistor eyes. But they are all distinct designs with different capabilities and behaviors. They are the first members of a growing family of miniature robots that I have been playing with off and on for a long time

A key aspect of their design is at least one photo-transistor eye and one controlled LED. This allows them to interact in a meaningful way. Depending on how they are programmed, this could be as complex as data transmission between bots or as simple as interfering with the sight of other bots. The resulting interaction would also depend on the type of bots. For example, the eyes of robot 1 point downward to scan the surface, while robot 3 only looks forward.

At this point I have not programmed them for any complex interaction. Their main behavioral features are thus:

  • Robot 1 - Has left and right eyes looking down. Can detect lightness patterns on the ground. Here is a video of it acting as a line follower.
  • Robot 2 - Has one downward eye and one forward. Controlls a group of LEDs around its perimiter. It can see the lightness of the ground and look forward. It can also signal in all directions with the LEDs.
  • Robot 3 - Has one eye looking forward and two separately controlled LEDs pointing about 45 degrees to either side. It is supposed to be able to detect obstacles and determine which direction to turn to avoid them. I am still developing this feature.

The hardware:
The controller could be any of the 8-pin ATtinys. I have used the tiny85 because that's what I had on hand. I have considered a version based on the ATtiny10, but haven't gotten around to that. The batteries are LIR2032 rechargeable lithium coin cells that I pulled out of some solar key chain lights from the 100yen shop(dollar store). They don't last very long between charges, but I'm not planning on spending much money for fancy new batteries.
Here is the underside of each one.

You can see the 2N7002K mosfet transistors for driving the motors. There are also various resistors, capacitors and LEDs. The schematics are here:

The software:
At this point, the software is very simple, but it is easy to add another behavioral pattern in the code since the main loop simply calls a behavior function. Robot 1 has a line following bahavior. Robot 2 scans the ground and can signal to other robots in the area. Robot 3 avoids obstacles(still working on that one). I would be willing to upload the current code if requested, but since it is continually changing and far from complete, I won't put it here just yet.

If I make new robots, videos, changes etc. I will post a log here about it.

  • 1 × ATtiny85 Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 2 × 2N7002K MOSFET Discrete Semiconductors / Transistors, MOSFETs, FETs, IGBTs
  • 2 × small motors from andromedabots
  • 1 × some red LEDs
  • 1 × some ASDL-6620 phototransistors
  • 1 × various smd resistors and capacitors see the schematics
  • 1 × LIR2032 3.6V rechargeable battery

View all 2 project logs

Enjoy this project?



electricpaw wrote 04/18/2016 at 08:24 point

Ooooooooooh, awesome! Yet small. As they say, greatness from small beginnings.

  Are you sure? yes | no

JOhn gado wrote 02/06/2016 at 15:55 point

okay thanks

  Are you sure? yes | no

Pablo wrote 02/06/2016 at 03:47 point

looks like Heat Shrink Tubing 

  Are you sure? yes | no

JOhn gado wrote 02/05/2016 at 23:00 point

what did you used for the grip? What are these orange pad on the motor? 

  Are you sure? yes | no

shlonkin wrote 02/06/2016 at 06:40 point

It's wire insulation from 22awg solid wire.

  Are you sure? yes | no

jbird468 wrote 10/01/2015 at 04:27 point

Has anyone substituted the pager motors for tiny steppers like these?

Granted the circuit would be different(maybe via L293DNE or ULN2003AN) but at 0.36$ a pop encoded movement would be neat!

  Are you sure? yes | no

starwriter wrote 06/30/2015 at 01:40 point

Any chance of getting the code for the other two little robots. ;)

  Are you sure? yes | no

alexis wrote 06/08/2015 at 09:37 point

Neat little robots. Here is a similar project but I dont think its being worked on anymore. 

I think it had line following capability and a basic IR communication between robots.

Schematic, pcb, and code is all available.

They should have been used for testing swarm algorithms but we did not go very far, built a few dozen.

  Are you sure? yes | no

shlonkin wrote 06/08/2015 at 11:58 point

Thanks for the link. Those are really cool robots. I was trying to get into that field of research a few years ago, but circumstances forced me to quit school and set all my dreams aside. 

  Are you sure? yes | no

rylangrayston wrote 05/26/2015 at 02:49 point

hey I love these little line following bots and I have a few ideas for you that would make for alot of fun with them...
What if you used glow in the dark paper and UV LEDs so that each bot can both draw and follow lines, It would look just like the lines in this video, but the patterns could be some what emergent.

I would start out with some code like this:

if (folowingLine == true){



else { UVLED = 'ON' 



  Are you sure? yes | no

shlonkin wrote 05/26/2015 at 10:57 point

That's actually a really cool idea. Ants behave in a very similar way and I've seen a few simulations based on just that same idea, but I've yet to see a physical experiment that didn't use actual ants. If someone tries it and gets some interesting results, they could publish a paper on it.

  Are you sure? yes | no

Mid-Ohio Area Robotics wrote 05/06/2015 at 17:36 point

These are the cutest little things ever! I really like them, are you going to be having PCBs made for them? You might want to consider Elecrow, with their PCB service I'd imagine you could get PCBs for less than $.7 USD. Nice project! Check mine out if you get the chance :D

  Are you sure? yes | no

pepeu wrote 04/26/2015 at 09:33 point

Hey! Very interesting project! Do you know of a replacement for the ASDL-6620 since they seem to be out of production/stock? 

  Are you sure? yes | no

shlonkin wrote 04/26/2015 at 12:19 point

There are many different phototransistors available. Just look for one that works with visible light and fits your voltage needs. I don't have time now to search for a replacement, but your supplier should have some kind of phototransistor that should work.

  Are you sure? yes | no

JJ071992 wrote 03/28/2015 at 22:45 point

Hey awesome project, i'm gonna try this myself sometime. Is there a reason why you don't have a power switch so you don't have to disconnect the battery everytime? A small dip-switch wouldn't need much extra space.

  Are you sure? yes | no

shlonkin wrote 03/29/2015 at 00:20 point

Hi. Just for simplicity and because I didn't have any really small switches.

  Are you sure? yes | no

vsureshkeerthi wrote 03/11/2015 at 14:19 point

what is the specification of the motor used in this??? 

  Are you sure? yes | no

kumkum1kiran wrote 02/23/2015 at 10:23 point

Hii.... gud work...

Do you Know...It's very funny and an interesting job to build an Art Robot that can do art or drawing with you…a Robot Art!!! Want more information...just check out...,-A-simple-DIY-Art-Robot-!!!

  Are you sure? yes | no

Sandeep Kumar Singh wrote 02/15/2015 at 22:06 point

I want to build it..It cool but when i go through your procedure then i found some codes i just  want to know how to upload it in IC  with arduino... please help me out 

  Are you sure? yes | no

Sandeep Kumar Singh wrote 02/15/2015 at 22:11 point

I join this site today so no idea.. plz

  Are you sure? yes | no

Adam Fabio wrote 02/16/2015 at 06:27 point

Sandeep, the tiny robots run on ATtiny85 processors. Do you have an ISP interface? (That's the easiest way to program them)

  Are you sure? yes | no

Sandeep Kumar Singh wrote 02/17/2015 at 05:13 point

No, In fact i don't know about ISP Interface... Can you tell me how t it... 

  Are you sure? yes | no

rellik1000 wrote 02/08/2015 at 14:55 point

Love the project.Trying to breadboard #1 before building it,without success
I'm really just a noob,but shouldn't line 34 .ino #define rsensepin 1 //ADC1 pin 7
be...#define rsensepin 2 //ADC1 pin 7

My apologies if i am missing something.

I am using leds in place of motors for testing.I should see a change in leds brightness based on sensor values....correct?

  Are you sure? yes | no

shlonkin wrote 02/09/2015 at 11:36 point

Due to the vary awkward way the ATtiny85 libraries work, if you call analogRead(1), you will get the value from ADC1(pin 7), but any digital function with 1 will use PB1(pin6). So the definition really should be 1 because only analogRead() is ever called.

If you are testing with LEDs, you will only see on or off. The program does not actually change the pwm value.

  Are you sure? yes | no

Coye Knoll wrote 12/30/2014 at 11:26 point

radioshacks zip zaps those tiny remote control carsuse the same types of motors. u can buy like just the motors,

  Are you sure? yes | no

Mr. Spriggs wrote 12/28/2014 at 04:29 point


I dug through the data sheet and came up with a low power version. It works just the same as you original but the ATtiny uses less than half the power the original used.

  Are you sure? yes | no

shlonkin wrote 12/28/2014 at 05:38 point

Cool. Are you shutting down parts of the controller between sensor readings? I'm sure the vast majority of the power is consumed by the motors, so the benefit may be small in the end. But don't let that discourage you from tinkering with it!

  Are you sure? yes | no

Mr. Spriggs wrote 12/22/2014 at 07:23 point
So after a whole bunch of testing I finally got the tiny robot working. It was so simple I could kick myself. The problem is with the code. The ledon and the ledoff are swapped. When the led should be on like getting sensor data it off.
I replaced the #defines with
#define ledoff PORTB &= ~(1 << 4)
#define ledon PORTB |= (1 << 4)
And now it works great.

  Are you sure? yes | no

Mr. Spriggs wrote 12/19/2014 at 06:32 point
The problem was right there all along I wired the emitter and collector backwards. Thanks for the help.

  Are you sure? yes | no

Mr. Spriggs wrote 12/17/2014 at 20:11 point
Hey Shlonkin,
So I basically built a copy of your first robot. Then dumped the hex onto the 85. I had no luck getting the great results you have on your video. I played with the setting over and over with no luck. Mine seems to see lines that are not there. I even went and added some sleep mode code to minimize the noise when its reading the sensors.
Any insight?

  Are you sure? yes | no

shlonkin wrote 12/18/2014 at 12:50 point
Here is something you could try. Check the sensor voltage directly with a meter while on a white surface then on black. There should be a significant difference in voltage between them, like around half of your battery voltage in difference. This should be true for both sensors. If you have that, then it is likely a software issue. You are running at 8MHz, right? Try the default sensitivity of 3.
If you are not getting sufficient voltage difference, try changing the resistance value in the sensor circuit. It could be too high or too low.

  Are you sure? yes | no

Similar Projects