Archive for August, 2012

First Bot Part 02

Posted: August 14, 2012 in Arduino

So here is the working version of the robot, I will talk through some of the steps that stopped the bot from working in part 01.

As the wheels are plastic, and my house is all tiles and laminate, the wheels would just spin. Because the Bot uses differential steering grip is a must, as it wouldn’t turn enough.   Rather than replace the wheels all together I cut strips out and then, added in little pieces of rubber.  Not perfect, but MUCH better.

The main problem for my bot was power, the 9v that I had mounted on the breadboard up top wasn’t enough. So went on ebay and got a few 4 battery pack adapters. As these are fairly bulky I didn’t want to add this on top of the 9v, which I kept to power the Arduino. So I moved the 9v to under the bot, got rid of the breadboard, and have just the battery pack up top now.

I glued the head servo to a metal bracket, and cut a piece of plastic for the ultrasonic sensor. The pins of the sensor feed through the plastic, as there was much to attach this to.

Couple of pics below to see what the bot looks like now, taped a few wires as they kept being caught on the wheels.

Just so you can see a size comparison of my Bot, Smudge my cat decided to get in on the camera action.

VIDEO   —-   I will create and upload video in next day or so, just need to tweak code more, then upload that also.

First Bot Part 01

Posted: August 14, 2012 in Arduino

So I went round a few shops looking for parts. I didn’t want to spend more than £10 for a toy that I was just going to rip to pieces for parts.

Then I found the below for £6.99 and £2.99…

    

Lets see what I did with these 🙂

As you can see from the below, this was the way I attached the Servo horn to the wheels. Good old glue gun. **Things to note, first attempt popped off straight away, due to the ultra smooth plastic wheel. I sanded the area down and this gave better results.***

Made a basic bracket for the servos to sit on, then used glue gun to attach them. (dunno if this was  a good idea, could be a night mare if i want to use them elsewhere.

Rear wheels complete.

Was getting a little excited at this point, seeing it starting to come together. Front wheels are held together with a small bar that came with the set.

I wanted the Arduino to be in its own little section, so firstly I put a strip of plastic down this was then held in place with bluetac. I then added another metal strutt above so this would then hold the battery and breadboard. The head servo and ultrasonic sensor was added at this point. As you can see I used bluetac to help me work out where I would have pieces. Bluetac is good but only for static pieces, the amount of times the head(ultrasonic sensor) fell off was unbelievable.

Below was the finished build, that would enable me to test code…   I had a few mistakes at this point.

  • Bluetac to hold head servo
  • The wheels are made of plastic, so just spin on laminate flooring.
  • and most embarrasingly, thinking I could power this with a 9V battery.

See next posts for newer version, which has the above problems ironed out.

Knight rider LED’s

Posted: August 2, 2012 in Arduino

Saw a robot with leds on its head doing the knight rider sequence. I thought this looked pretty cool, and maybe I’ll eventually do it on mine.

First things first lets have a play. As you can see from the first video, I just turned 1 LED on then off then the next LED on. This doesn’t work, as you don’t get  a flow to it.

Now take a look at my second attempt. This was done by turning  LED1 on then turn on LED2 then turn off LED1 before turning LED3 on. Its not perfect, but shows a bit of flow and looks a lot better.

Due to work, and family I don’t get lots of time to work on code, so it will be messy and I’m sure can me made a lot smaller. Something for me to look into. Here’s the code I made for the second video.

int led1 = 8;
int led2 = 9;
int led3 = 10;
int led4 = 11;
int led5 = 12;
int led6 = 13;
int time = 100;
int time2 = 50;

void setup() {

pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
pinMode(led5,OUTPUT);
pinMode(led6,OUTPUT);
}

void loop() {

digitalWrite(led1, HIGH);
delay(time);
digitalWrite(led2, HIGH);
delay(time2);

digitalWrite(led1, LOW);
delay(time);
digitalWrite(led3, HIGH);
delay(time2);

digitalWrite(led2, LOW);
delay(time);
digitalWrite(led4, HIGH);
delay(time2);

digitalWrite(led3, LOW);
delay(time);
digitalWrite(led5, HIGH);
delay(time2);

digitalWrite(led4, LOW);
delay(time);
digitalWrite(led6, HIGH);
delay(time2);

digitalWrite(led5, LOW);
delay(time);
digitalWrite(led6, LOW);
delay(time2);

digitalWrite(led5, HIGH);
delay(time);
digitalWrite(led4, HIGH);
delay(time2);

digitalWrite(led5, LOW);
delay(time);
digitalWrite(led3, HIGH);
delay(time2);

digitalWrite(led4, LOW);
delay(time);
digitalWrite(led2, HIGH);
delay(time2);

digitalWrite(led3, LOW);
delay(time);
digitalWrite(led2, LOW);
delay(time2);
}