Mine rescue robot
- Team
- Two engineers
I wrote PIC firmware that reads colour cards to drive a robot through a test maze, then retraces its route back to the start.
Result
Ran the simple maze unaided; the harder two needed 3 and under 10 manual nudges
The robot and its ambient-light shield
Colour-card navigation schematicDesign
Each card colour is an instruction: red turns right 90°, green left 90°, blue 180°, and so on, until a white card ends the run.
- Sensing to command. When the colour sensor’s interrupt says a card is close, the robot stops and reads red, green, blue and clear values. The firmware normalises them, scores them against the stored mean and spread of each card colour, and acts only if the best match clears a confidence threshold. Otherwise it drives on.
- Return path. Every forward run, timed with Timer0, and every turn goes into a movement log. The half-square reverse the robot makes to turn after reading a card is not part of the route, so the logged distance is corrected for it. At the white card, the robot replays the log backwards, swapping each move for its opposite.
- Light shield. A black matte PLA shield around the sensor blocks ambient light, so the reading comes from the card.
Testing and results
We ran three mazes of increasing complexity.
- Simple maze: completed, with an accurate return to the start.
- Moderate maze: completed with 3 manual nudges, with some drift in the turn angles.
- Complex maze (40+ moves): the first run stopped mid-maze because the movement log overflowed at 40 records; stops were being logged too. We raised the capacity to 60, and the next run completed with fewer than 10 nudges.
What I’d change
Turns drift by about ±5° between identical runs, because the two motors respond differently and their speed falls with the battery. I’d read the battery voltage and compensate the turn timings and sensor thresholds, and size the movement log from the expected maze instead of a fixed constant.