Let's Make Robots!

Uno-Bot1 A study in the minimal.

UnoBot1.zip9.85 KB

I was tinkering with some parts and I said to myself... "thats enough to build a very small bot" and Uno-Bot1 was born! The heart is the Uno (Arduino) and takes more than half the bot! The rest is a clear perfboard construction area and some gear-motor-wheels recovered from a previous tiny bot. It also has a PING))) rangefinder and is in need of an h-bridge to drive the motors (or I will just run them forward using some easily pwm'd power transistors. A 9V rechargeable battery will go underneath (velcro?). Again, this is another ugly picture from my webcam, but I will put a better picture up when my friend gets to it with his digital camera. Construction: Super-Glue and double-sided foam tape! (Oops, just noticed I used my old "Duemilanove" board, but I am keeping the Uno-Bot1 name, as my Uno would be a drop-on replacement. GOOD! I feel more at ease experimenting with the older board anyway! I look forward to seeing what this little one can do. The differential drive wheels are at a fairly wide stance and it is a "tail-dragger" which is a pretty common configuration.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I see more and more youtube videos of Arduino based bots being controlled by Neural Networks. Turns out the 32k of space on the ATmega 328 is more than enough room for this! (Most are not even using the Arduino Mega!)

So far I haven't seen any code for this (and I want it BADLY!) Anyone here doing anything like this at all???

BTW: So far I am enjoying working with UnoBot1 much more than I do the Phoenix. (Most of the UnoBot1 is my design, while most of the Phoenix isn't.)

I really like my little "scrapbot"! :-)

(This little fella can be FAST too, these little blue gear-motors are MUCH faster than they look! I am grateful I have PWM to throttle them back... :-)


Leads me to believe that you will need/should have a reasonable understanding of Neural Nets. I got a few hits, but, they really seemed to indicate that there is a learning curve and it is associated with the task.

You could check:




for some hints and direction.

I found a good article explaining the fundamentals of neural nets here:



Here is the latest revision of the robot software. It still can use some work. The actions of this tiny robot seem quite "biological" and it is a blast to watch. Keep close to it because it tends to get itself in "trouble", a lot. It reminds me of the actions of a fly...

(I am using a 9 Volt Rechargable battery and it seems to have a quite usable life. Seems tiny bots with tiny motors take only a tiny amount of power. At least it lasts longer than I am willing to chase it! Now if I were a lot younger...)

/* tinybot_testx

 this controls a tiny bot 

 vision is limited to forward

 so the bot gets creative...


 (this robot behaves quite biologically and

  watching its "self-directed" motions can be

  interesting! And fun! :-)  


 By Will F. 7/11

 This example code is in the public domain.



long randNumber; // Randomness - Biological!

const int pingPin = 7;

const int fast = 220;

const int medium = 185;

const int slow = 65;

const int maximum = 250;

const int minimum = 50;

long distance;



void setup() {

  // initialize serial communication:



  pinMode(13, OUTPUT);



int choice()

  if (randNumber > maximum) // maybe go right





  if (randNumber < minimum) // maybe go left






int go()


  analogWrite(5, medium);

  analogWrite(6, medium);



int stop()






int goRight()


  analogWrite(5, medium); // Turn!

  analogWrite(6, slow); 

  delay (320);            // Give it N msec to keep turning 



int goLeft()


  analogWrite(5, slow); // Turn!

  analogWrite(6, medium); 

  delay (320);          // Give it N msec to keep turning 



// nice conversion to inches

long microsecondsToInches(long microseconds)


  // According to Parallax's datasheet for the PING))), there are

  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per

  // second).  This gives the distance travelled by the ping, outbound

  // and return, so we divide by 2 to get the distance of the obstacle.

  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf

  return microseconds / 74 / 2;



int Pinger() // Very sensitive object detection!


  // establish variables for duration of the ping, 

  // and the distance result in inches and centimeters:

  long inches, duration;


  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.

  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:

  pinMode(pingPin, OUTPUT);

  digitalWrite(pingPin, LOW);


  digitalWrite(pingPin, HIGH);


  digitalWrite(pingPin, LOW);


  // The same pin is used to read the signal from the PING))): a HIGH

  // pulse whose duration is the time (in microseconds) from the sending

  // of the ping to the reception of its echo off of an object.

  pinMode(pingPin, INPUT);

  duration = pulseIn(pingPin, HIGH);


  // convert the time into a distance

  return inches = microsecondsToInches(duration);



void loop()


  distance = Pinger();

  Serial.print(distance ); // debug

  Serial.print("in, ");


//test5: // Right Motor 

  //analogWrite (5, medium);


  //goto test5;


//test6: // Left Motor

  //analogWrite (6, medium);


  //goto test6;


  randNumber = random (300); // Lovely randomness

  Serial.print("random, "); // more debug




  if (distance < 20) // too close!


    digitalWrite(13, HIGH); // Blink

    stop();                 // Stop!

    delay(1000);            // Give stop a second

    digitalWrite(13, LOW);

    choice(); // Possibly chose another direction



  if (distance < 5) // stop collision!



    analogWrite (5, 0); // STOP!

    analogWrite (6, 0);

    digitalWrite(13, HIGH); // Blink


    digitalWrite(13, LOW);


    goto die;



  go(); // Move!


  choice(); // Duh! Which way do I go?





Near the end you have a label called die. It looks like if you get too close to something you just stop and your program gets stuck/caught in an endless loop. Is that intentional?

Thanks for noticing birdmun,

My bots so far don't use an H-Bridge so reverse isn't possible. Best I can do is "spin" and try to get out of a bad situation, but that doesn't always work. :-(

So I decided rather than stalling the motors I would stop a bad situation before I did some damage.

It seems to work for me...

Maybe 5 volts (regulated) for the CPU and 6 Volts unregulated (same ground) for the motors would work well. Seems these little parts (specially the grearmotors) tend to take a lot of power these days.

If it were to stay in the sun all day I would considera solar cell recharger, but then rain would probably spoil the fun!

Nature has done an AMAZING job of providing humans with energy they can use and we are just now finding out how ahard it is to provide robots with simular, long lasting power...

(Cept' for that darn Ennegizer Bunny!) LOL

The Energizer Bunny has to be a robot... or else an android.  Runs on batteries; moves around doing all sorts of things... Might even show awareness...


These are great. My local FabLab is working on some minimalist robot designs. A cheap obstacle avoidance robot like this would be great. Would you consider posting a Fritzing circuit design, a parts list, and the Arduino sketch?

Hope this helps.