Lunchbot II Tuesday, Oct 28 2008 

I made my first microcontroller based robot over the weekend. It is far from finished. But it can drive around randomly. Getting something to move randomly was harder than it should have been. I realised overnight that I don’t actually need a random number generator if I want it to appear to move randomly. I just need to use any function that is chaotic.

The motors are controlled using two h-bridges. I’ve used BD139 and BD140 transistors. They can handle a continuous current of 1.5A. That will be enough for the toy motors I am using.

A PIC16F505 Microchip microcontroller is the brains behind my robot. It’s a pretty limited chip. It has room for 1024 12-bit instructions and 72 bytes of RAM. I’ll replace it once I need some extra functionality. I started writing the code in C but I had lots of problems with it. Certain math functions seem to freeze up and I kept getting confusing errors. So I’m re-writing it in assembly using gputils.

As you can see, there isn’t much to it. Eight transistors to control two motors with a few diodes and resistors and the microcontroller. The container has lots of room to add a big PCB later. In the top right corner you can see a capacitor with the battery leads connected to it. That’s the power switch. When I want to turn it on I plug that into the breadboard. It’s a bit crude, I’ll probably plug it in the wrong way or in the wrong place and fry everything knowing my luck.

I have a few plans for this little robot in the future. I want to give it more brains than any lunch box should ever have. It’ll be able to create maps and mark locations of interest. I’ll attempt to make it appear curious so when it finds something it hasn’t seen before it will keep going back until it isn’t new anymore. Hopefully I’ll make more than one and have them communicate via beeps or flashy lights. Then they can follow each other around and have twice as much fun.

I also want it to be able to recharge itself by homing in on a charging station that sends out a beacon.

I only had a 8-bit “random” number generator when I videoed this. So It repeats itself twice in that short time.

LOLCode Wednesday, Oct 22 2008 

So I found an interesting competition yesterday. Write a program in LOLCode to find square roots. I’ve never heard of this programming language before. It looks like the sort of programming language I would write. It’s kinda fun to play with. Although I do have a headache now. I wrote a small program to find prime numbers. Finding prime numbers is something fun to do with an unknown language. Here it is:

BTW I IZ GOING THRO UR NUMBRZ EATIN 4LL UR COMPOSITES LOL
SO IM LIKE PRIMED WIT U OK?
  PRIMEZ CAN HAS SOME CHEEZBURGER OK OF THOSE U
  GIMME EACH CHECK IN UR NUMBRZ TWINZ AND U OK?
    IZ PRIMEZ LOOK AT CHECK OK KINDA LIKE CHEEZBURGER?
      VISIBLE CHECK
      GIMME EACH T IN UR NUMBRZ CHECK OF THOSE TWINZ AND U AND CHECK OK?
        PRIMEZ SOME T OK CAN HAS EASTERBUNNY BTW I EATZ U LOL

IZ BIGNESS ARGZ OK KINDA LIKE ONE?
  ME CAN HAS ALLFINGERZ BY GRAYSKULL POWER TWO
NOPE?
  ME CAN HAS NUMBR ARGZ LOOK AT 1!!
PRIMED WIT ME!

Now I just need to do the square root code. The first prize is $300, second $200 and third $100. It’s only for Massey students too. So maybe I have a chance of winning something.