Let's Make Robots!

UPDATED 12/15/13

One night about two moons ago I sat at my workbench in the garage with a bunch of miscellaneous parts in front of me. I picked up a .22F Super Capacitor, and the smallest PCB found in a Radio Hack Round PCB kit. Putting the two together I thought, "I bet you could make a robot this small." The personal challenge was on.




Here is a rough sketch of how I pictured the baby bots looking. Sorry it's so blurry.



Here is the schematic for the Baby Bots. The LED's are IR, and although it shows seperate resistors for each LED in the schematic I only used one for the both to share. The reason being that they can never send out a 'irout' signal at the same time anyway. I think I used 330R. Note the use of the NPN motor driver transistors in emitter / follower configuration. By using them this way I was able to drop off the base resistors and the back EMF protection diodes, at the sacrifice of a higher voltage drop across the transistor then if used in the more typical fashon. For this application, the removal of 4 components took precidence over the added voltage drop.




First I used a dremel tool with a cuttoff wheel to notch out the PCB.

Next the SMD PN2222a Transistors soldered in place.




This is a mock-up of how I wanted him to look.




Here are the leads from the transistor's base leads, headed to the picaxe.




Here I am test fitting the IR LED's and the IR receiver.




Another mock-up.




Another Mock-up.




Here is a view of the underside after adding the IR receiver and connecting the base of the transistors to the picaxe. I super glued the picaxe dead bug to the pcb to hold it securely in place.




The IR receiver sets directly on top of the transistors.




Here is a top and bottom view of the baby bots about 90% done.




I formed the rings carefully from copper wire. I made 2x what I needed and then picked the best matched ones.




Two nearly completed Baby Bots.




Note the small wire rings in the front, these are the serin and serout for programming the picaxe in circuit. I use Radio Hack "Mini Hook Clips" to securely hold the little rings when programming.




They are slightly smaller than a US Quarter in diameter.




Underside view before adding bristles.




Side and Back view before adding bristles.



Underside with newly attached toothbrush bristles.




Here they are! Finished except for programming.

At first, the Baby Bots moved backwards much to my dismay. After some fiddling around I realized I needed to add some bristles to get them moving the way I wanted. I used small needle nose pliers to pluck out individual groupings of bristles from a toothbrush. Then holding them in my fingers, I held a flame close to the end that had been in the toothbrush, melting the bristles ever so slightly, before pinching the molten plastic with my fingers, sealing the bristles together into a neat little bunch. I first added bristles to the interior underside but ended up needing them on the outside to get better motion. I used a tiny dab of super glue to attach them.




Using a supercap instead of a battery saved a lot of space on these bots, but created a bunch of issues too. One being, how do you keep a bot charged that has a minute lifespan? Another being how do you power motors when your voltage drops so quickly.

So the plan is to have another robot, slightly larger, helping the baby bots to navigate and charging them when they are away from the beacon charger. They might get stranded without enough juice tomove their virbrating motors. In that case, they signal an sos message with their IR LED eyes, and Bitty bot will come to their rescue.

The plan is to have the bots communicate via the built in picaxe IRIN and IROUT commands, utlizing an ALOHAnet protocol (PUREAloha). I am still programing the baby bots, but have them working well under IR control. Bitty Bot is the next step to the project, along with a beacon charger / custom coffee table to enclose and feed the bot family. I hope to get more done on those fronts berfore christmas.

I promise I'll add some video this weekend.

On a side note,

If you are thinking about entering the microbot challenge, then see these bots and think yours is not small enough, just remember... thats hogwash! Everyone builds within their own limitations and comfort zone. These bots might be the best I can do, but that means nothing about the best you can do though. Remember too that these bot's are not capable of much more than communication and self charging, possibly wall detection. Not very bright really, not to mention the run time is less than stellar. In the end though, a good project starts with well defined goals and limitations. I am learning much from this project and I look forward to sharing more as I go.




12/15/13 EDIT:

Here is a sneak peek of 'Bitty Bot'



Here is the current code, still very much in the testing phase though, with no communications code yet, Just testing movement, IR contorl via TV remote, and use of interrupts.


#picaxe 08m2




symbol R_Eye = c.0

symbol L_Motor     = c.1

symbol R_Motor     = c.2

symbol IR_Receiver = c.3

symbol L_Eye  = c.4

symbol IR_Data     = b2

symbol Voltage     = b3

symbol M_HighTime  = b4

symbol M_LowTime   = b5

symbol PWM_Period  = b6


let dirsC = %00010111


setfreq k31



let pinsC = %00000000

setint %00000000, %00001000




       if IR_Data != 0 then gosub IR_Control




if IR_Data = 16 then gosub turn_left     'Red Baby Bot

if IR_Data = 17 then gosub turn_right     'Red Baby Bot

if IR_Data = 19 then gosub turn_left     'White Baby Bot

if IR_Data = 18 then gosub turn_right     'White Baby Bot

let IR_Data = 0

setint %00000000, %00001000




calibadc Voltage

let M_HighTime = Voltage*28/100 max 25

let M_LowTime = 25 - M_HighTime

       for PWM_Period = 1 to 3

              high R_Motor

              pauseus M_HighTime

              low R_Motor

              pauseus M_LowTime

       next PWM_Period




calibadc Voltage

let M_HighTime = Voltage*28/100 max 25

let M_LowTime = 25 - M_HighTime

       for PWM_Period = 1 to 3

              high L_Motor

              pauseus M_HighTime

              low L_Motor

              pauseus M_LowTime

       next PWM_Period




irin [300],IR_Receiver,IR_Data

if IR_Data = 0  then gosub IR_Control




Comment viewing options

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

so cute i wish i had them


Yahmez's picture

Thanks! If you really want them, Ladvien is working on a PCB version so in the near future you could build some yourself much more easily.


Ladvien's picture

So, I'm working out the details for a Baby Bot PCB design that can be fabricated.  The plan is to make an SMD version for myself and through-hole for others (unless someone wants to go SMD with me? That's kinky electronics talk).  Ok, so few questions:

  1. Can you provide more specifics (or maybe a datasheet? :) on the IR sensor, LEDs, and capacitor used?  I think I've got the motors, uC, and transistors.
  2. I'm not familiar (or smart enough) to know how to use super-caps; I don't suppose an SMD capacitor like this would work?
  3. Do you have a rough estimate on the cost of each individual bot? I want to make sure this version is comparable.
  4. And here's the big one; I've never worked with IR, but I have to ask.  Are all 6 pins required on your little guy?  The trick with the ATtiny 85 is we'd have to use the reset pin, which can be done, but then the chip is bricked without a HVSP.  So, it'd be a one shot programming.

The BOM for the SMD one I'm cooking is something like this:

  1. .2F SMD Cap
  2. 2 x MMBT2222a NPN transistors.
  3. ATtiny 85
  4. The IR stuff I'll source depending on your advice :)

The current incomplete schematic:


Yahmez's picture

This is awesome! 

Let me see if I can fill in some details that I left out.

For the IR receiver I used a Vishay TSSP4038.

I chose these units for a few reasons.

·                 Operation @ 38kHz (required when using the built in Picaxe IR commands that utilize the SIRC protocol)

·                 Down to ~2 v operation

·                 Low current

·                 The ability to detect a constant 38kHz signal (say from a simple 555 beacon) it appears this is fairly rare among IR receivers. In this project though, you don't necessarily need this ability.

For the LED's I used the Vishay CQY36N.

I chose these units because they were tiny, have a wide viewing angle, no minimum order quantity and they were blue. =)

For the supercap I used Panasonic .22F 5.5V that I bought Here.

For the cap, you have to consider that unlike a battery the voltage on the cap is in direct relation to the amount of energy left. Ideally you want to have as wide a voltage 'band' as possible e.g. the range of voltage in which your components function. The supercap and uC will set the maximum voltage. Ideally you will want to charge to the supercap to the max your components can take. Most supercaps are rated at a low voltage, many @ 2.5v. The caps I used are rated for 5.5v and I charge to 5v to stay on the safe side. Some 'memory back up' supercaps are not capable of dumping current fast enough to start the motors due to their internal resistance being high. If you can find one of similar size, voltage and ESR to mine but with a higher capacitance, I’d strongly recommend it for longer run times. Here is a super cap discharge calc: http://www.circuits.dk/calculator_capacitor_discharge.htm

The other trick you can do is boost the voltage with an external circuit when it drops out of the voltage ‘band’. (Joule thief?)

This leads to the question about the required number of pins. In the picaxe version there are only 5 pins used.

 The Picaxe can work down to pretty low voltages when you disable the brown out detection. I'm also under clocking it to reduce voltage and current requirements. One essential thing the Picaxe does is monitor the voltage on the supercap. Using the calibadc (calibadc10) command, you can return the value of an adc reading of an internal fixed voltage reference. This allows you to determine the voltage without the use of an additional pin and components. The bot needs to know how much power it has left so it knows if it is able to move motors, or tell if it is charging / or charged fully.

Does the attiny have the ability to perform an adc reading upon a fixed internal reference? If not you will need an extra adc pin, an output pin and a few components to make the equivalent circuit. I have a page on my blog that explains how I did this before I realized the calibadc command existed. You might be able to make this work with only one extra pin somehow.

Also, as it was already, I wish I had one extra pin to control/power the IR Receiver from. This would allow for a super low power sleep mode.

There may be a way to drive both motors in a push / pull fashion with a single pin where one motor activates high, the other low and switch the pin to input to turn both off. But you would have to bit bang your own pwm that went high, input, high, input and vice versa for the other motor. Other than that debatably possible idea, I am not sure how to reduce the pin count. I really wouldn't want to lose the ability to reprogram though.




Ladvien's picture

Ok.  So, here is my second go at trying to copy your schematic--sorry, I'm a little dense.

The connections don't match your schematic, but after checking the IR sensor datasheet, it's the only way I knew to make sense of it.  Please advise.  After corrections, I'll add a programming header and then start working on the board.  

Eventually, I'd like to get something like these:

  1. TinyCircuits
  2. Random OSHPark board

I'll shoot for as much as I can load on a board with the diameter of 24.26mm, which is supposed to be the diameter of a US quarter.

Hope you're well, sir.

Yahmez's picture

I see now. The confusion was in the IR Receiver Out pin that appears to be connected to serin. That is actually the ground connection for the IR Receiver, it just so happens to share the same rail in the schematic as the required resistors for the picaxe. Both are just going to ground.

Ladvien's picture

EDIT: Ok, so I decided is was impolite to spam your bot post with my attempts to copy you :)

I created a forum thread: Y-Babies


I woke up this morning and realized I was being stupid :)

Yahmez's picture

You can drop the 10k and 22k resistors, those are for programming the picaxe (the serin pin). The IR Reciever has 3 pins, the 2 power pins and one output. You can tie this output directly to the input pin.

By the way, the quarter is slightly larger than the outside diameter of the ring, not the pcb. I can measure the pcb If you would like.

Oh on the baby bots, the top ring is ground and the bottom ring positive. They are in this orientation because bitty bot has another ring for charging above the baby bot's level. Yet all 3 (charger/bitty/baby) must share the same gnd (middle for bitty and charger / top for babies) connection.


Ladvien's picture

Thank you for the details--that should keep me going for a bit.

I think the thing that confused me was the two LEDs on pins C.4 and C.0.  Are these independent IR signals? Can C.4 be dropped? (It can, otherwise we'd still be using dynamite.  Am I right? :)  I'm assuming that the placement of these LEDs is to allow the Babies to eventually communicate between each other?  Again, I assume that one is on the right side and one on the left to have some control over the direction of the communication?  So, if this is true, do you think C.4 and C.0 could be tied together and direction be controlled by software filter? 

Also, wanted to state I got some ATtiny 84's I've been working with.  It's a14-pin SOIC chip that'll fit on a penny. I'll probably make a version with it as well.  And the QFN version is bogusly small, if only I could convince everyone they are easier to solder than they look. :)

Yahmez's picture

You are correct the left and right LED 'eyes' will provide directional communication. They are independent signals and unfortunaetly I am unaware of how to control them seperately from the same pin, although this in no way means it's not possible.

If you look at the photo of bitty bot, there are 3 IR receivers and 3 IR LED's which give it the ability to locate and communicate with the baby bots without moving around. The baby bots have the two IR LED 'eyes' and one IR receiver. If the baby bots touch rings, they equalize voltages with each other I never pictured them communicating much, rather avoiding one another if possible, maybe listening to another baby bot though, trying to steal the others energy (bad baby bot!). I picture the mom - bitty bot giving info back to the babies about their location, whether she can only see one eye, etc., telling them what to do really. But also coming to the rescue if needed. I hope to have at least two beacon/charger with the same abilities as bitty bot, but immobile. Bitty Bot will guide and help the baby bots make it from one beacon/charger location to another. She will also feed from the beacon/charger and be able to turn off her power ring to stop feeding the baby bots if need be. To help explain the led's, my baby bot's program will look something like this:


Interrupt: incoming signal detected on IR Receiver pin... when Valid IR Command received gosub Make_Decisions timeout after a bit



Check Voltage

If Voltage is increasing wait a bit to store more electrons then goto main

wait a bit ( random min/max limited )

If Voltage high then gosub Dance_Around_A_Bit

ElseIf Voltage medium then goto Look_4_Mom

ElseIf Voltage low then Disable Interrupt and goto SOS





Motor routine (this could be expanded to include whatever you want if there is the power)




Check Voltage

If Voltage is increasing goto Main

send hail signal to L eye

wait a bit random min/max limited )

send hail signal to R eye

wait a bit random min/max limited )

move left or right

(the interrupt is enabled in this subroutine so if there is a response we can deal with it in the Make_Decisions subroutine)

goto Look_4_Mom



Check Voltage

If Voltage is increasing Enable Interrupt and goto Main

send sos signal to L eye

wait a bit random min/max limited )

send sos signal to R eye

wait a bit random min/max limited )

goto SOS



(Here is the logic to test the incoming signal along with the routine and info from where we jumped here from and decide whether to respond to the signal, reply, act or ignore it.)

Return to previous routine


I would love to help you with the attiny, but I am afraid I have never used one. How many pins do you need for programming? Do they need to be isolated from the circuit like the serin pin on the picaxe? Worded another way, can you program this chip in circuit, or do you need some jumpers? The Picaxe uses two pins for progrramming, serin can be used as an input too, but I only used it for programming. Serout is shared with one of the 'eyes'.

The best I can figure the minimum number of pins required is 5:

  • 2 output pins for the IR LED 'eyes' (if you make these ADC pins, you might be able to get light level readings from the LED's as a bonus)
  • 2 output/pwm pins for the motors
  • 1 input pin capable of interrupt for the IR Receiver

Hope this helps. I'll have to update the page with all the info added to the comments, thanks for getting me thinking and typing about this... sometimes I really need to put ideas on paper.