I've built a few experimental robots in the past and, to be honest, they all looked the part. They were nothing more than circuit boards with wheels glued on.They did help me learn, but they just didn't feel like completed robots. The main purpose of this project was to combine electronics and 3D fabrication into a robot complete in both form and function. A fun robot with a sleek look and a bit of personality. The second goal was to make the robot as small as possible, smaller than half a ping-pong ball (hence the name).
In this Instructable I will share what I've learned while creating the Pingbot. Included is information about PICAXE Micro-controllers, surface mount soldering, PCB design, Autodesk's 123D 3D design software and 3D fabrication, rechargeable lithium-polymer batteries, as well as a few painting techniques.
Included are schematics, a PCB layout, PICAXE code, 123D model files and pictures of the construction process. You will also find a wealth of links to detailed information that is relevant to the project, as well as suppliers for the parts used in the Pingbot.
MSurguy, a friend I made through this instructable, has finished his own version of the robot. Instead of a 3D printed shell he used an actual pingpong ball cut in half, check out the video: http://vine.co/v/bJViYxMAzTw
Step 1: Body Shell 123D Design and Fabrication
Choosing a Material
It is important to choose a materialbefore you start working on a model as each material has different guidelines that you must follow while you are designing. The materials vary in the minimum wall thickness, minimum detail size, flexibility, and other properties. Some materials are weaker than others, large models made from them may need inner structure to support the weight.
I chose to have the shell for the Pingbot printed from the Durable Fine Plastic. This material is strong enough to be used as a working prototype and its minimum detail is a minute .2 mm. It is more costly than other materials, but since the cost of a model is partially determined by its volume, the shell was incredibly inexpensive to have fabricated. All totaled, it uses less than 1/3 cubic centimeter of material.
Creating the 3D Model
Although it was printed as one solid piece, the 3d model was made from separate components that come together to make a hemisphere. This was necessary as it allowed the edges of each of the parts to be rounded off.
To begin I created a hollow hemisphere with a 1mm wall thickness. I then copied/pasted the original shell, drew new shapes, and extruded these new shapes to subtract (and intersect) from the hemisphere. After completing all the parts I beveled the edges to create the seams. I've included a couple of pictures of the process.
While designing this robot's shell it was important to remember to add holes for the components that needed to be accessed from the outside. For the USB connector and micro-switch I use the PCB design along with the components' data sheets to determine where, and how big, the access holes needed to be. I also added some holes in the back to help let out the sound from the peizo speaker (the speaker was plenty loud and these holes were likely not necessary).
Upload and Fabrication
In order for a model to be printed, all the separate components need to be welded together to create one solid piece. Once this is done It can be saved as a STL file and uploaded for printing and sharing. (You will need to be logged into 123D to be able to save as an STL.)
This video is of the Object Connex 3D fabrication machine, which is likely close enough to the model of machine used to create the Pingbot shell. It demonstrates how the machine prints the model in layers along with a support material. When fabrication is complete the support material is blasted away leaving the final piece.
Step 2: Painting the Base Coats
The surface of the 3D printed model was fairly smooth, but I decided to sand it a little to help the paint stick. I used some 400 grit sandpaper to sand the entire surface, then followed by dipping the same piece of sandpaper into water and sanding the model again. The model was then completely cleaned using a toothbrush, water, and rubbing alcohol. This cleaning removed any dust, oils, or other smudges that might have prevented the paint from adhering.
I began by painting the entire shell with a few light coats of matte black spray paint. Normally I would have painted it with a primer first, but the black paint was the type made for using on plastic. After letting these coats dry for a full day, I used a thin masking tape made by Nichiban to mask the areas that I wanted to remain black. I like using this tape because it smoothly bends around curves and its adhesive leaves essentially no residue on the model. I made sure to tuck the tape into the seams and roll it around the edges of areas that stuck out from the main sphere. Blue painter’s tape was then used to cover the larger areas.
Nichiban can be difficult to find and you may need to resort to an alternative. I do like blue painter's tape, but the factory cut edge on its sides is fairly rough. To get a crisp edge from the tape you need to cut the rough edges off with a sharp blade. It also helps to cut it into small, manageable strips when working on smaller jobs.
The masked model was then painted with a several coats of gloss blue. I know it's difficult to resist immediately ripping the masking off to see the new paint job, but doing so too early can lift and stretch the paint. Wet spray paint can stay a little rubbery for hours after being applied, so I made sure to let these coats dry an entire day before lifting up the masking tape.
Step 3: Detailing
After masking off a sizable area around the numbers, I used a stiff brush to tap yellow paint into the stencil. When wet paint is used on stencils made from masking tape it has a tendency to soak underneath the tape and leave a rough edge. This can be avoided by dipping the tip of the brush in paint, wiping some of it off on a paper towel, and then dabbing the brush on the stencil. I needed to apply several coats to get the yellow to stand out against the blue, but it was worth the extra effort.
Again, I made sure to let the paint dry completely before removing the tape.
Step 4: Weathering
I dry brushed a metallic silver acrylic paint over the entire surface of the model. This was done by dipping the brush into the paint and then wiping the paint off on a rag. Once there was next to no paint left on the brush, it was used to go over the edges, holes, and rough spots of the shell. The silver paint caught on the higher surfaces and made the base coats look like they had worn off to reveal metal underneath.
Applying the Wash(es)
To start I got some brown, orange, and black acrylic paint, something to mix them in (I prefer pickle jar lids), and a few paint rags. I put a wee tiny dab of black, and we tinnier dablett of brown into the lid and added about one tablespoon of water. This was well mixed and then soaked up with a rag. I gently dabbed the wash into the crevices and corners of the model. After a few seconds of drying a crumpled up piece of cloth was used to dab up the access paint.
The process was repeated with several other shades and hues of washes that were made with different combinations of the paints. If you're in an experimental mood try mixing some green or red in there why not. The idea is to make the model look like it's been sitting in the backyard for a few years collecting dirt. I like to look at pictures of weathered metal for inspiration.
After I felt that I had added enough grit, I added two coats of flat clear spray paint to hold the finish.
Step 5: Circuit and Schematic
A 08M2 PICAXE micro-controller serves as a mind for the Pingbot. This chip is incredibly easy to program, it automatically understands universal TV remotes, it's cheap, and it has the ability to play music with the tune command! On top of all that there is an incredibly large amount of documentation and instructions available directly from the PICAXE website.
Once it is soldered into circuit the 08M2 can be reprogrammed with a USB port, the AXE027 serial converter cable, and a micro-USB cable; the chip does not need to be removed from the PCB. This makes it simple to change the behavior of the robot and experiment with different commands.
The 08M2 uses a 38Mhz IR receiver to decode up to 17 commands from a universal television remote. You can buy the IR receiver online, or you can scavenge one from an old appliance. Pretty much all older DVD players and VCRs were made with one of these receivers.
Power Supply and Recharging
The robot is powered by lithium-polymer battery (LiPo). A MAX-1555 IC is used to charge this battery via the same micro-USB cable used for programming. When the cable is plugged into the robot, the 1555 connects to the USB port's +5V pin and charges the LiPo battery. A micro-slide switch connects the batteries ground to the circuit; the battery will not charge while the switch is turned off. While charging the 1555 lights up the red LED, and then turns it off when the battery is full.
LiPo batteries are very light and hold a lot of energy for their size thus making them ideal for small robots and RC toys. However, if charged incorrectly, Lithium-Polymer batteries can be dangerous! They must have a charger designed for lithium batteries. Using a Ni-Cad or NiMH to charge a lithium-poly battery is VERY BAD and can result in explosive fire! The battery and charging IC used in the project are made to work together. If you want to experiment with other Litho-poly batteries, please do your research first!
Two small pager motors are mounted through the circuit board in such a way that their shafts touch the ground and work as wheels for the robot. They are controlled by the 08M2 and two 3904 NPN transistors. These transistors receive signals from the 08MX and act as switches for the motors, turning them on and off. A diode is used across the motors' leads to protect against reverse voltage. For more info on how this works check out this tutorial with details on this and other useful methods of small motor control.
These types of vibrating motors are readily available online. While shopping you should try to find ones that do not have the weighted ends that make the motor vibrate, those things can be a huge pain to take off. The best way that I've found to remove them has been to use a similar sized shaft taken from a dissected motor. With a pair of pliers, I grab the weight attached to the motor intended for the robot. Then with another pair of pliers, I push the extra shaft down into the hole in the top of the first weight. With a bit of force the motor's shaft usually slides out.
Personality - Lights and Music
Personality is a great way to make your robot feel like more than a mess of components, and the 08M2's tune command is perfect for giving a robot a bit of charisma. With it you can play old cellphone ringtones through a peizo speaker, and have a LED blink along with the music. To make use of this function the circuit includes a 12mm piezo speaker and two small LEDs. Excess leads cut from previous soldering work are used to attach the LEDs to the circuit board so that they can be bent into position behind the CD lens eyes.
These circuits are found in the MAX-1555 and 08M2 datasheets and manuals with very little modification.
Step 6: PCB Design
Drawing the Circuit Board
Using Adobe Illustrator I created different layers for the traces, components, the grounding plane, and the part labels. Using the component's data sheets as reference I then drew out all the components to their actual size and arranged them to fit within a 37mm diameter circle. Traces were drawn according to the schematic to connect the components.
I used Illustrator because I am familiar with it, but the most common way to design circuit boards is Eagle PCB, a free software from Cadsoft . This program can be used to draw out a schematic that can be converted into a PCB layout. The designs and files that it generates can be printed out or sent to a manufacturer to be fabricated.
Charge LED, I'm Doing it Wrong
While designing this PCB I had assumed that the MAX1555's charge LED should be connected to ground. After I had finished soldering I did some testing and found that the LED wasn't doing anything. It should have lit up when the robot was connected directly to a USB port and the battery was charging, but that didn't happen. Turns out the LED should have gone to +V...
To fix this I desoldered and lifted the LED's lead, the one that I thought went to ground, from the PCB and connected it to +V with a jumper wire above the board. I stuck a dab of hot glue under this LED to make sure the lead didn't touch the ground pad. This error was corrected in the schematic, but I have not fixed it in the PCB layout. Instead I've just shown the jumper wire.
Step 7: PCB Fabrication
Developing and etching circuit boards at home involves chemicals that are dangerous if used improperly. It is important to always wear gloves and work in a well ventilated area like outside. Always read the material data sheets and follow the instructions provide with these products!
Developing the Circuit Board
After drawing out the circuit a photo-positive was created by printing the design onto a transparent film. Most print shops will be able to do this, but you can also buy a box of the transparencies and do it at home. Different transparencies are made for inkjet and laser printers, be sure to buy the appropriate type. Also, be sure to print it at a 1:1 scale; I forgot about this and etched the first board before noticing that the design was too small and needed to start over.
While in a dark room I removed the protective plastic film from the pre-sensitized circuit board and lined the positive up on top of it. To hold everything in place I put a small plate of glass on top of the positive. The instructions that come with the board say to expose the board 1ft under a 100 watt bulb for 10 minutes, but I've always needed to go for at least 12.
I prepped the development solution about a minute before the exposure finished. The solution is a mix of 1 part development concentrate with 10 parts warm water. Cold water halts the developing process and prevents further development. If used at this point, cold water would essentially ruin the board.
After 12 minutes of exposure I placed the board in a plastic tub with the warm development solution. I gently rocked the tub to keep the solution moving around. The developer quickly washed away the areas of green sensitized film that were exposed to light while leaving the circuit traces behind. The board was then run under cold water to complete the development.
Next the board was placed into a small tupperware container along with a mix of Ferric Chloride and warm water. Again I rocked the tub back and forth to keep the mix flowing. After a few minutes the exposed copper was eaten away leaving only the protected circuit design and the fiberglass board.
The remaining photosensitive coating was scrubbed off the circuit board with nail polish remover and an old toothbrush. It is important to clean the board really well. If it is not perfectly clean you will be able to see the dirty areas later on, after it is too late.
Drilling the Through Holes
I'm sure there is a standard in what size PCB holes should be, but not knowing it I just drilled them with the smallest bit I had on hand.
I also needed to drill out two larger holes for the two motors. Drilling these holes was easy enough with a miniature drill press, but they also needed to be angled to allow the motors to act as wheels. To do this I used a small file to shape the fiberglass board. During this filing I made sure to put the motors into the holes and test the angle until i got it right. It was crucial that these holes be filed to the exact same angle so that the motors would sit correctly.
I sorta screwed this up and the motors sat lop-sided, causing the shafts to contact the ground at different points. This changed their speed and one motor ended up being faster that the other and in the long stretch this difference makes the robot veer off to one side. It is still easy to control and I don't really mind that it isn't perfect, but in the future I will be much more precise when setting motors. I may even use a protractor.
In the process pictures you will notice that there are some components already soldered to the board before the motor holes are drilled. I had made another mistake and forgot to drill these holes before I began soldering, and had to go back and drill them.
Tinning the Traces
Tin plating makes soldering the surface mount components much easier and it protects the copper from oxidization. To do this I used a product called Tinnit that I bought as a kit.
I began by drilling all the through-holes and thoroughly cleaning the board with more nail polish remover. Again it is very important to do a good job cleaning the board off. I failed to do so on this one and you can clearly see finger prints on the traces. >_<
The dry concentrate was mixed with warm water and microwaved until it reached about 140° F. The board was placed into a plastic tray with the tinning solution and jostled every 5 minutes. After roughly 20 minutes the copper traces became plated with a micro-thin layer of shiny tin. Finally, the board was then cleaned with ammonia to remove the remaining tinning residue. The remaining tinning solution was poured back into the bottle to be reused later.
Once mixed Tinnit only lasts about 6 months. Unless you plan on tinning a few dozen boards in the near future, it is wise to mix it in small batches. To do this you'll need a small scale to weight out the powdered concentrate and something for measuring fluids. I divided my concentrate into four smaller batches, which should keep me in the tinnin business for the next couple years.
Step 8: Soldering the Components
To begin I needed to learn how to solder surface mount components. I've done a fair amount of standard sized soldering, but hadn't touched surface mount since school (a long time ago) and that was with one of those fancy air tip soldering irons. Watching this incredibly well-done tutorial on surface mount soldering by CuriousInventor gave me the instructions and confidence I needed to work on this project.
For each component I first placed a small drop of flux on each of the points of the board to be soldered. The flux I had on hand was in a small tub, not a tube with an applicator, so I needed to dip a paper clip in the flux and then dab it onto the pads. I then held the part to be soldered in place with a pair of tweezers, loaded the iron's tip with a droplet of solder, and quickly touched the iron to one of the components leads. That first soldered lead held the component in place and made soldering the other leads much easier.
To give myself more working room I soldered the parts starting with the smallest resistors and moved up to the larger ICs and LEDs. The LEDs were soldered onto some leftover leads I had cut earlier, and these leads were then soldered to the board. My first attempt at doing this resulted in the wire lead becoming hot enough to desolder the LED from the wire. It was necessary to use a small alligator clip as a heat sink to prevent this. The leads were then bent back to fit behind the CD lens eyes (and fine tuned in a later step).
While soldering the PicAxe08M2 I made sure to not get the chip too hot. I soldered one pin and then waited a good two minutes before soldering the next. Truth be told I likely could have just used a socket, but I was unsure if there would be enough room in the shell for one.
The jumper that I had intended to use to switch from the eye LEDs to the programming pin ended up being to big to fit in the shell. To slim the jumper down I removed all of the plastic leaving just the contacts. I also needed to solder the jumper pins to the board at an angle to make room for the jumper.
The most difficult part of the soldering was the micro-usb connector. The pins on this part are very close together and I just couldn't get my iron in there without bridging the solder across them. After a half dozen failed attempts at doing so, I finally took the advice from the above linked video and used a stripped piece of braided wire as an improvised soldering wick to soak up the extra solder from the pins. Afterwords I made sure to test all the pins with a multimeter to ensure that they were not bridged in anyway.
The male micro-usb connectors have spring loaded pins that lock into the female socket. These pins are strong enough that considerable force is needed to disconnect the two. The female connector has multiple ground solder pads connected to it's metal body. Securely soldering these pads prevents the connector from being ripped from the PCB when the two are separated.
After a majority of the components had been soldered to the board, it was scrubbed down with a toothbrush and denatured alcohol. This removed most of the ugly flux and dust that accumulated on the board leaving it nice and shiny.
After this cleaning, the IR sensor and piezo speaker were added. To allow it to extend through the top of the shell, the leads of the IR sensor needed to be bent around the peizo speaker.
The motors were then soldered to the board and secured with hot glue.
Step 9: Final Assembly
Next up I soldered in the LiPo battery and used some double sided foam tape to secure it to the underside of the board.
To keep the robot from leaning to far forward or backward I hot glued some bent paper clips to the board. These were bent using a set of jeweler's pliers with smooth, round tips. I love using these pliers and believe they should be part of every electronic tool set. They are especially useful for free-form soldering.
While designing the shell I included some holes for screws that would hold the PCB in the shell. Unfortunately I managed to put one of them in the wrong spot and it did not line up with hole in the circuit board. On top of that mistake I had also made the wall thickness of these holes only .5mm and they were too delicate to thread. I ended up using a screw I had saved from taking things apart, one that had sharp threads to bite into the plastic. The next time I need to add holes for threads in a project I will make the wall thickness at least 1mm thick.
Step 10: Programming
PicAxe Programming Editor, the software used to program the 08M2, is available FREE from the PicAxe website.
To program a PicAxe chip via a USB port an AXE027 programming cable is needed. While designing the circuit I was working under the assumption that the 08M2 could be programmed with a direct connection to the USB port's data+ and data- pins. I thought I could skip the 027, and would need only the Micro-USB connector to program the chip. After a few failed attempts at uploading the program to the bot, I did some testing/research and found out that the AXE027 cable contains a serial converter. I don't know the exact details of how this converter works, but It is necessary to program the PicAxe over a USB port.
It was far too late to go back and fix this in the design, everything had already been put together! Besides, there wasn't room to add a stereo jack for the AXE027 onto the circuit board. To program the chip I needed to make an adapter that could receive the stereo jack from the AXE027 and connect it to the Micro-USB cable.
I rummaged through my box of computer stuff and found a PS2 -USB adapter that I was not emotionally attached to. I cut it apart, removed the female USB connector, and wired that to a 3.5 stereo jack that I had left over from a previous project. The accompanying image details how this adapter was wired.
What the Program Does
The robot is controlled by a standard universal tv remote that I got for $5. The remote is set to the Sony television code, which is what the 08M2 is able to decode. When a button is pressed on the remote it transmits a code from its infrared LED. Meanwhile the 08M2 has been waiting for its IR receiver to pick up this transmission, and when it does it stores the corresponding button number into a variable. The PicAxe checks that variable and runs the code that is associated with the received number. The program then returns to its start and waits for another command.
The 08M2s tune command is awesome. There are thousands of free, old cell phone ringtones that were made to be played on peizo speakers and these can be downloaded and programmed onto the chip. Inserting these songs is as simple as using the PicAxe Programming Editor's ringtone wizard to import the songs into the code. Each note of the song is represented by a number and they can be copied, pasted, and re-arranged to edit the songs. The command also has options for blinking an LED (the eyes) with the music.
I programmed a few of the buttons with songs, and a few others with random beeps. The beeps give the robot some cut little expressions that are fun to use when it bumps into things and such. More info on the tune command can be found here. This page was also very useful, as it shows what code# is used for which remote control buttons.
When one of the Volume + - or Channel + buttons is pressed the program turns on the appropriate motor for 100 milliseconds, then turns it off again. If that button is held down that bit of code repeats, effectively turning the motor fully on. The LED eyes are tied to this same button so that they turn on in synch with the motor. The eyes do blink each time the code repeats, but the motors do not stop long enough to affect movement.
Dancing Robots Have More Fun
The Pingbot can be programmed with dance routines using a mix of the tune command and motor control . The program turns on a motor (or both), plays a few notes, and then turns the motor off. Next the opposite motor is turned on, the next set of notes in the song are played, and the motor is turned off. When these moves are executed together there is no hesitation between the commands and the song plays seamlessly while the robot whirls around in different directions. This can be seen in the video on this Instructable's intro page.
Step 11: Going Further
Professional PCB Fabrication
I used Illustrator to draw out the PCB, printed the design on a transparent sheet, and used that to etch my own board. Although I find DIY fabrication to be a fun challenge, etching your own circuit boards is not ideal. The process is laborious, expensive, and getting good results is an art onto itself. Now-a-days there are reasonably priced options for professional fabrication (batchpcb.com) and the boards they produce are exactly like something you'd pull out of a store-bought item. They also give you advanced PCB design options that would be almost impossible to do at home.
Most significantly professional PCBs can make use of multiple layers of traces that have been laminated together. The Pingbot uses jumper wires underneath the board to connect parts of the circuit that I couldn't get traces to. The jumpers would be unnecessary on a multi-layer board, as they could be replaced with an additional layer of traces and vias. The traces would also take up less area on the board allowing more components to fit into the same amount of space.
Professionally fabricated boards also get coated with a layer of epoxy that protects the traces from corrosion, the pads that the components are soldered to are tinned, and you can have a text and artwork silkscreen printed on the surface of the board.
What's the hitch? You need to know how to use a PCB design software in order to create the files for fabrication. I am just now learning to do this with Eagle PCB software (a free version of which can be found at cadsofusa.com). This program isn't exactly intuitive, and you really have to put on your engineer hat to get into its work flow. Fortunately, the nice guys over at Sparkfun have a fine set of tutorials written for beginners that I've found to be of great help.
Alone the Pingbot is neat, but I think I would like to build more and have about six of them working together. Since the robot receives its commands from an IR remote, it would be possible to give orders to multiple Pingbots at the same time. This little robot squad could be programmed to perform synchronized routines with dancing and music. They could even be given an IR LED that they could use to talk to each other. Right now I can't say exactly what practical use that would provide, but I can think of a few wacky, chaotic ones.
Creating the team would be a fun exercise is mass production. The shells could be made by creating a mold from the 3D print, and casting them from a plastic resin. Instead of just one, a whole batch of circuit boards could be fabricated. A scheme could be created and the bots could all be painted at the same time. This may be my next project!
Thank you for checking out my Instructable and giving me a chance to share my work, I do hope it proves to be useful. If you have any questions or suggestions please fire away!
Step 12: Tools and Part List
Medium-Fine Tipped Soldering Iron and Solder
Circuit Board Developer (Jameco #156734)
PCB Etchant (Jameco #616438)
Tin Platting Kit (Jameco #2097088)
Heat Sink Clip
Needle Nose Pliers / Wire Stripper / Wire Cutters
Black, brown, and orange acrylic paint
Masking Tape (Nichiban #241)
Magnifying Lamp (Optional, but boy howdy you'll want it one when it comes time to solder!)
Some form of circuit board clamp
Paint Rag / Paper Towels
100W light bulb with a reflective hood
Inkjet Transparencies. (If your print shop doesn't sell them individually you can buy a pack to have them print on.)
Plate Glass 8.5x11in by 1/4in thick
Cleaners and Solvents
Nail Polish Remover
1x 08M2 PICAXE Microcontroller (Solarbotics #28412)
1x USB PICAXE Programming Cable (Solarbotics #28405)
1x 3.5mm Stereo Jack (PICAXE Connector) (Solarbotics #17850)
2x 3904 NPN Surface Mount Transistors (Jameco #94967)
2 Small Pager Motors (Radio Shack #273-107)
2x 3.3K Ohm SMD Resistors (Package #0805)
1x 10k Ohm SMD Resistor (Package #0805)
1x 22k Ohm SMD Resistor (Package #0805)
3x 150 Ohm SMD Resistor (Package #0603)
3x 1uf SMD Ceramic Capacitor (Digikey #445-1592-1-ND)
2x 1N4004 Rectifier Diodes (Jameco #35991)
1x IR Receiver 38kHz (Jameco #2109691)
1x USB micro USB SMD Female Connector (Sparkfun #PRT-08533)
1x USB 2.0 Female Connector
1x USB microB Cable - 6 Foot (Sparkfun # CAB-10215)
1x Right Angle Switch (Sparkfun #COM-10860)
1x Jumper / .1 inch Straight Male 1Row 3Pin Header (Jameco #109576)
1x Polymer Lithium Ion Battery - 3.7V 110mAh (Sparkfun #PRT-00731)
1x MAX1555 - Lithium Ion/Polymer USB Battery Charger IC (Sparkfun #COM-00674)
1x Piezo Buzzer Ø12.5mm (Solarbotics #17855)
2x Surface Mount 1.90mm Green LEDs (Jameco #1555104)
1x Surface Mount 1.90mm Red LED (Jameco #1584976
1x Pre-Sensitized, Single Sided Circuit Board (Jameco # 156751)