In my final year of University I was lucky enough to take part in the robotics module – as I understand it, people starting the same course as me at the time I was leaving got to do robotics as standard in their first year! Not so with us, it was kept to the last and had limited places and all.
The course was half practical – building and programming a robot – and half theory – how to process data from sensors and control various aspects of the robot. The robots themselves were based on a small micro controller board with many simple I/O ports, built in to a shell made of Lego. I was one of a team of three, and initially we were all unsure of the programming side of it, but confident in our Lego abilities! This changed around pretty abruptly when it came to actually building the thing – turns out Lego can be a pain!
The objective of the robot was to collect coloured cans in a small square arena, and deposit them in the identically-coloured corner of the arena. Obviously, without hitting walls or getting stuck was preferable too.
We had a wide array of range sensors available, and we opted to use two affixed to a single pole at the front of our robot. These would be turned by a motor and 9 readings taken across the sweep. If the range reported from the higher-mounted (and longer range) sensor was less than it’s maximum, it was seeing an arena wall, and if the lower sensor saw something, it was a can – so avoid one, drive at the other. Simple in theory but hard to get right in Lego.
To get the colour of a can we used an LDR with a coloured LED, the theory being that a can of the same colour as the LED would reflect more of that light. It took two test reading with both a red and blue LED illuminated alternately, and decided based on the light intensities whether the can was red or blue.
Annoyingly, we had our robot mostly working about an hour before our demo, but then one of those strange programming mishaps occured, and some small changes meant to tighten up the object detection completely ruined the thing, and we couldn’t figure out why. Our demo was marginally successful, at best!
I leave you with some picture of our crazy looking robot. May it rest in peace in the University robotics labs.