Line Follower Robot: Sensor Array, Brain & Bluetooth Tuning
Kit price: ৳1,329 (parts bought separately ৳1,429, you save ৳100)
The control half of a competition line follower: an 8-sensor reflectance array read by the ATmega32U4 Pro Micro, plus HC-05 Bluetooth so you can tune the PID from your phone between runs. Add your own motors and chassis.
What is in the kit
Build guide
Level: Intermediate · Build time: 2–3 days with chassis · Ideal for: University robotics club competitions (LFR events), robotics workshops
A PID line follower that you tune live over Bluetooth instead of re-uploading code for every change.
Wiring
| 8-sensor array | VCC / GND | VCC (5V) / GND |
| 8-sensor array | Outputs 1–8 | A0, A1, A2, A3, A6 (pin 4), A7 (pin 6), A8 (pin 8), A9 (pin 9) |
| HC-05 | VCC / GND | VCC (5V) / GND |
| HC-05 | TXD | RX1 (pin 0) |
| HC-05 | RXD | TX1 (pin 1) through a 1 kΩ / 2 kΩ voltage divider (HC-05 RX is 3.3V) |
Steps
- Install "QTRSensors" (Pololu). For the analog (8A) array call qtr.setTypeAnalog(); for the RC (8RC) version call qtr.setTypeRC(). Then qtr.setSensorPins() with the eight pins above.
- Calibrate: sweep the robot over the line for 5 seconds while calling qtr.calibrate(), then use qtr.readLineBlack() for a 0–7000 position.
- PID: error = position − 3500. Start with only Kp, add Kd to stop wobble, add a small Ki last.
- Pair the HC-05 (PIN 1234) with a phone app such as "Serial Bluetooth Terminal". Parse commands like "P0.08" on Serial1 to change gains live.
- Connect your motor driver: speed (PWM) on pins 3 and 5, direction on pins 7, 14, 15 and 16. Pins 6 and 9 are also PWM pins but are used by the sensor array here.
Not included, you will also need
- TB6612FNG or L298N motor driver
- 2 × N20 or similar micro gear motors with wheels
- Chassis, caster ball, 2S 7.4V LiPo or 2 × 18650 cells
Arduino libraries
- QTRSensors (Pololu)