Step 10: Programming

The Pingbot is not much more than a remote controlled puppet. It doesn't have any sensors and it can't track its own movement. It only does what the remote tells it to do. Because of this the program is limited in its options and uses only a few basic commands and some semi-tricky dance moves. I am not very experienced with programming these chips and I'm certain there are functions that I am unaware of. What little programming I have learned was from the PixAxe manuals and their website.

PicAxe Programming Editor, the software used to program the 08M2, is available FREE from the PicAxe website.

Serial Programming
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.
<p>I have been kind of wanting to build this for more than half a year. Or is it a year now... I don't know how, and have very limited experience in the field. The most I have done is one of those robots on a platform that move when you move a remote. I did write the code myself though, with the help of my teacher. It was written in C, which of course would not work for this project. I am no longer in contact with the teacher that was going to help me with this, and there are no robotics teams near me currently. I was just wondering if anyone has any suggestions? </p>
<p>Oh and one more thing, do you think I can do this with an arduino mini or something instead of building my own circuit? Or is that a necessary part? </p>
<p>I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>The first road I would try would be to add a sound sensor. Then you could set up 3 IR/Sound beacons in a room. The robot would receive a light and sound signal from the beacon and measure the time between the IR and audio to determine distance.</p><p>www.bosswallpapers.com</p>
saya sudah mebuat ini tetapi saya bingung bagai mana cara nya saya untuk memasukan data program dan bisakah saya minta data untuk memprogram pingbot? makasih
<p>ean man i wish i had one</p>
<p>Its tremendous<br><br></p>
<p>I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.</p>
<p>ean man i wish i had one</p>
clean man i wish i had one
thanks for sharing
I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes.
when suggesting scavenging from old appliances a picture of the component would be nice if only to save us some time.
that is so cool is this going to be on the market or is there even a need for this?
I'm not sure if there is a need really, although I have had a handful of students and teachers contact me looking to make their own versions for educational purposes. <br> <br>As for marketing, well, I'm learning about the process, but I'm certain that this will never be made into toy that your going to find at the store. However, the kit bundle version should be available soon; it has been submitted to Club Jameco and is making the final rounds now. <br> <br>Thanks for checking out the project, happy you liked it :)
yeah I thought it was neat
that looks AWESOME, Where did the idea come from?
Thank you Jenson that's great to hear :D <br>The idea came from all over the place. For the look of the robot, the movie &quot;Batteries Not Included&quot; had a major influence. As for the actual robot, I'd seen several of these little picaxe robots, such as the one by Mikey77 here on instructables, and wanted to make one of my own as a way to learn Picaxe and li-po battery charging.
These are great. Instead of remote control does anybody have ideas on how to make something like this autonomous so that it would move to a specified location or to a homing beacon?
Thanks Wrecks. <br>The first road I would try would be to add a sound sensor. Then you could set up 3 IR/Sound beacons in a room. The robot would receive a light and sound signal from the beacon and measure the time between the IR and audio to determine distance. After getting this info from all three beacons the bot could then triangulate its position. <br> <br>In theory anyway. I personally don't quite have the skills to tell you exactly how to do this, and I'm not sure if a PICaxe chip would be able to handle it. I bet an Arduino/Atmell would though. <br> <br>Another possibility would be to use a GPS sensor. It would be a little big to fit into a robot this size, but those sensors seem to get smaller everyday. <br> <br>Hope this helps and thanks again for the interest :D
Tom, this is absolutely a thing of beauty! :) <br /> <br />I agree with everyone else; the first thing I thought of was the little bots from BATTERIES NOT INCLUDED. The little semi-spherical dome also reminded me of a little R2-D2 unit, yet unique. I did some sketches a few years back (inspired by the cute little robots in the Calvin &amp; Hobbes comic strip - which also reminded me of R2-D2.) I like the idea of a unique little artoo-like bot - and a community of them created by other people. <br /> <br />I am an electrical engineer and design this kind of thing in my spare time as a hobby. I am extremely impressed by your expertise in varied areas of design - electronics, pcb fabrication, 3D model design, etc. I do all of these things too, and I have been searching and searching for exactly this type of thing to inspire some of my new creations! Finally, someone with originality and creativity!!! <br /> <br />Anyway, kudos! This is fantastic - and possibly the best, most thorough, and most creative instructable that I have seen yet! <br /> <br />Aaron :) <br /> <br />
Aaron, I really appreciate your comments, I think after that my ego is just about to burst over into the next county :D<br /> <br /> I'm over the top ecstatic with the response this instructable has gotten, I kind of see it like a full circle of knowledge sharing. I goof off with this stuff purely as a hobby and a large percentage of what I know I've learned from this website. By writing this I was able to take that knowledge and inspiration and put it back into the creative machine so it can be reprocessed by others. That feeling literally makes me giddy like a 12 year old.<br /> <br /> You mentioned some fantastic ideas that I'm hoping to add to Pingbot v2, and I know exactly the Asimov story your talking about. While we are on the subject, I learned about these robots shortly after writing this instructable and I think they are just the sweetest thing ever. They are like, Pingbot advanced level 10 without out the hard candy shell. I have a feeling that you'll find it fascinating:<br /> <br /> <div class="media_embed"> <iframe frameborder="0" height="315" src="http://www.youtube.com/embed/ISMwLCFwgK4" width="420" /></div> <br /> And check this out, you can <a href="http://www.k-team.com/mobile-robotics-products/kilobot/manuals-downloads" rel="nofollow">download the manual for free!</a><br /> http://www.k-team.com/mobile-robotics-products/kilobot/manuals-downloads
love it !!!!
The circuit reminds me of <br>https://www.instructables.com/id/SOCBOT-the-next-generation-vibrobot/ <br>Biometronics didn't use transistors to power the motors. Instead, each motor was powered by two pins simultaneously to get enough mA. <br> <br>I like that your design saves pins for use with lights and sound. I'm a big fan of the PICAxe for people like me who don't have time to delve into the more complex languages. You should add the tag &quot;picaxe&quot; to this instructible. I search for picaxe projects from time to time and there aren't many to find on this site.
Thanks Bennet, I wonder if had seen that circuit before or not, it is very similar. <br> <br>I'm becoming a big fan of PICaxe too, they have really helped introduce me to microcontrollers. Plus most of the things I want to make don't really need advanced programming. <br> <br>Light and sound are super important lol. As advanced as robots have gotten I still think that R2D2 tops them all in personality and all he did was beep and spin his head. <br> <br>I'm adding the picaxe tag right now, thnx again :)
And by-the-way I found this via http://www.clubjameco.com/index.php/projects/project_brief/24/20921. <br> <br>If you'd like to see this as a kit goto the link and vote for it.
Do you have a larger version of the PCB and Schematic I can download from somewhere? I am having trouble making out the writing. Cheers!
No problem at all. Hover your mouse over the image and in the upper left hand corner you will see a small white box with an &quot;i&quot; in it, click that box. when the next screen pops up you will see the image and right under it will be something like this: &quot;original file: (1942x2383) 375 KB&quot; <br />Click on that and you will be able to download the full size image.
Oh, thanks - found it. I don't suppose you have the original Illustrator file (clear - without the components drawn in) so I can use it to print off a PCB?
Oops, never mind. Just found this: <br />https://www.instructables.com/file/F58QMCVH267L4NP/?size=ORIGINAL <br /> <br />Thanks for all your help. Now I know how to look at different pictures too. I look forward to seeing more of your work - this is awesome!
Ah - Turns out I do need your illustrator file if at all possible???
you could add on to that robot and make it better
A few other thoughts... <br /> <br />Although your little bot is cute, it would be great if it did something slightly more useful / interesting than just dance around (something that a mere BEAM robot does). <br /> <br />Ideas... I don't know your level of programming proficiency; but if you understand IR communication protocol (like SIRC), you could make your robots have two-way communication capabilities - transmitters and receivers. That way, they could communicate between themselves and perform interesting team behaviors - to accomplish a common task. I get this idea from a short story that Isaac Asimov wrote about some mining robots which performed duties like a hand and its fingers. It would be interesting if each of the little robots had its own unique function and could perform a different task to accomplish the team's common goal. <br /> <br />Also, if you used some geared motors and wrote some good path-following algorithms, you could put a pen in the center of your bot and have it follow a path that would enable it to write messages on a piece of paper - or something like that. <br /> <br />Just some ideas... <br /> <br />Aaron :)
This is what I call a GREAT Instructable... <br> <br>1) great project Idea <br>2) great implementation <br>3) great instructions <br>4) Totally awesome results... and repeatable too. <br> <br>Two thumbs up. <br>Jerry
Hey... enter in the LASER contest so I can vote for you.
Dang, thanks Jerry :D I did have a lot of fun working on the robot and the instructable and it is sweet to hear such positive feedback. <br> <br>This guy is already in two contest and I really want to make something new for the Laser contest. I hope you like that one too and vote for it ;) Thanks again!
Your design totally reminds me of the little robots from the movie &quot;batteries not included&quot;. :) <br> <br>http://mtmeyerstudio.com/wp-content/uploads/2009/01/kids2.jpg
Thats the first think to come to mind on this end too! Good Flick!
You nailed it Bray! I saw that movie when I was about ten years old and thought to myself &quot;Someday I will have one of those.&quot; Now if I could just get it to fly ;)
You should get together with the guy who made the PCB quadrotor https://www.instructables.com/id/PCB-Quadrotor-Brushless/ --the scales are about the same. Print off another body and have your flying version. <br> <br>Awesome little bot and yep, I thought Batteries Not Included when I first saw it too.
clean man i wish i had one <br> <br> <br> <br>
Awesome! Very fine work.
Other trick to prevent the soaking under the tape is a very simple one. <br>When you have applied the tape fist paint it in the color that's under the tape. Wait until the paint is dry. Then apply the color you want. <br> <br>What you do is first filling the holes under the tape with the color already there. So you won't notice it. Then apply the other color which can't run under the tape. <br> <br>Only disadvantage is that you have to wait until the filling paint is dry. <br> <br>Advantage is that you have razor sharp edges.
Nice tip Tallman, I would have never thought of that but it makes perfect sense! I'll use your technique the next time a do a stencil.
Thanks for such an awesome design. Ticks all the boxes - small, cheap, easy to build, versatile (due to the PICAXE and dare I say it, cute!
Thanks for the comments :D <br>Feel free to ask questions or give suggestions!
Nice work! Very complete project :D
Great job on this :)
awesome project. definitely has my vote.

About This Instructable




Bio: When I was young I took all of my toys apart just to see inside. Eventually I learned how to put them back together.
More by Tomdf:Star Trek Doorbell Hack Sculpting with Polymer Clay Gear Set for 3D Printing 
Add instructable to: