![]() |
![]() |
|
|||||
March Break 2011 - Robot Challenge
For the "brain" I decided to use the PIC18F1320. I had a bunch of these lying around looking for a problem. The PIC18F1320 can run using an internal 8MHz clock so this helps reduce the overall part count. It also sports numerous timers, three digital ports that can trigger interrupts (great for switches), plus a six channel, 10bit A/D convertor. For power I used a 4-cell AAA pack. The design works with both rechargable LiMH as well as straight alkalines.
Rear view: The gap between components is reserved for the two servos that will drive the robot.
Surface mount resistors are used to help keep the design small.
Here the servos have been mounted. A snug fit. A pair of 4cm diameter toy wheels have been attached. I wanted the robot to be able to perform several classic actions. Line following is a fun behaviour and amenable to racing. Secondly I thought that a mini-sumo-like mode would be fun. Lastly, if time permits, a follower mode would be nice. I've included a mode switch so that toggling between modes will be easy. Line following requires at least one downward facing sensor. I used a simple red LED to provide light plus a phototransistor (Everlight EL-PT204-6C) to measure the reflection. The LED is fed directly from the PIC digital output. The PIC18F1320 digital lines are current-limited to 25mA eliminating the need for a series resistor. When the sensor faces a white surface, light is reflected back towards the phototransistor which conducts and the voltage drop across the serial 47K resistor is about 3.4V. When over a thick black line, the phototransistor sees less light and conducts less. The voltage drop across the resistor decreases to around 1.9V. An easy different to measure with the PIC's A/D. For sumo behavior a forward facing sensor is needed to hunt for the opponent. The downward facing sensor will be used to keep the robot in the ring. I used an ultra-bright red LED to provide light and another phototransistor to look for reflections. The ultrabright LED needs more current than the PIC can deliver so I used a PNP transistor to turn the LED on and off. When the controlling digital I/O line is high, the current is off. When it's low, the LED shines. Looking into a void, the voltage drop at the sensor is near 0V. Facing a white card the voltage drop is 4.5V at 2cm, 2.8V at 4cm, and 1V at 6cm. To guard against changes in ambient lighting, both sensors measure first with the LED's off and then again with the LED's on. The difference between these two readings is used to determine actions. Finally, a couple of collision sensors (switches) could prove to be fun. So far I haven't used these as bumpers but rather as input switches for calibration mode.
Learning from past projects I decided to eliminate as many wires as possible by mounting everything directly onto a PCB and to use that as a chassis. So that the board would be easy to make I decided on a single sided design that I could make via toner transfer. Next Section: Building The Bot
|
|||||||
![]() |
|||||||
![]() |
![]() |
||||||
![]() |
|||||||