MARV line-following robot
An autonomous robot that reads the track under its nose with a strobing RGB LED and phototransistors, tells five surfaces apart, and follows a chosen line without getting lost where lines cross.
- Course
- EMK310, University of Pretoria
- Controller
- PIC18F45K22
- Firmware
- Hand-written assembly
- Role
- Designer and builder
Overview
A line follower only needs to know one thing: what colour is under the nose right now. MARV answers that question with light.
An RGB LED under the sensor head flashes red, then green, then blue onto the track. Phototransistors pick up how much of each flash the surface reflects, and the PIC18's ADC samples them once per flash. Every surface leaves its own three-number signature: white reflects all three, black almost none, and each coloured line reflects mostly its own colour.
A calibration routine records the signature of white, black, red, green and blue on the real track, and sets the decision thresholds between them. From then on the firmware classifies every reading, and steers the two driven wheels to keep the chosen line centred.
See it working
A 30-second 3D film of MARV, modelled from the real build, animated and rendered in Blender.
How it works
Light out, light back, one ADC sample per flash, then a decision and a steering correction, over and over.
Try the calibration
Run the calibration to store each surface's signature, then place the sensor over any surface and watch it strobe, sample and decide. The levels are illustrative, the method is MARV's.
Place the sensor
Pick the surface under MARV's nose.
Not calibrated yet. Readings still work, but nothing can be classified.
Waiting for calibration
Ticks mark the stored signature of each surface on that channel. MARV picks the surface whose stored signature is closest to all three readings at once.
Results
It worked. MARV followed every colour on the practice track and held its line through crossings.
- All five surfaces classified on the real track after calibration: white, black, red, green and blue.
- Followed each coloured line from start to finish, including the black, red, green and blue routes.
- No lost lines at crossings. Where coloured lines crossed over each other, MARV kept to the colour it was following instead of switching to the new one.
3D model
MARV rebuilt in Blender from the photos of the final build, for the film and these stills.
Photos
The final build, and the earlier prototype it grew out of.
