Fyrryx Rover
A remote-controlled exploration rover; I built its magnetic field sensor and sensing firmware
- 12 cm magnetic detection range, against a 5 cm spec
- 9.74 ms per field reading, inside a 10 ms budget
- 6 people on the team
The first-year Electronics Design Project at Imperial asked each team to build a rover that could explore a remote planet. In a lab arena, the rover had to find “aliens” and report three things about each: its name, broadcast as a 61 kHz radio signal; its age, encoded in infrared pulses; and the direction of its magnetic field. The budget was £60 and the arena floor was weight-sensitive.
There were six of us. Katie Gloag and Sam Barber built the radio name detector, Zian Lin and Kiertan Solanki the infrared age detector, William Huynh the remote control link and ground station, and Sam and Zian the 3D-printed chassis with mecanum wheels. I was responsible for magnetic field detection and for integrating the sensors.
Magnetic field detection
The detector had to output the field’s direction (up, down or none) from more than 5 cm away, weighing under 10 g, drawing under 8 mA and costing under £5. I compared a magnetometer, a digital Hall sensor and a linear Hall sensor, and chose the linear Hall sensor (a Honeywell SS49E at £0.68) because it was the only cheap option that reports direction, and its built-in filtering removed the need for a separate filter circuit.
Initial tests across five sensors gave a range of only about 2 cm, because noise hid the small changes in reading from a distant magnet. I compared a hardware filter and amplifier against averaging in software, and chose averaging as the simplest, fastest and cheapest fix. Each extra sample improves precision but costs time, and the reading had to finish in under 10 ms so it would not hold up the rest of the rover’s code. I measured the standard deviation and execution time for different sample counts, fitted a line to the timings, and settled on 80 samples: 9.74 ms per reading with a standard deviation of 0.02.
A fixed threshold for “no field” would not have been reliable, because the sensor’s resting output drifts over time. Instead the detector calibrates itself at start-up, recording the minimum and maximum of its stabilised readings; anything inside that band counts as no field. More calibration samples mean fewer false positives but a longer start-up, and since the rover might need to recalibrate during a run, I chose 500 iterations: about 3 seconds, with 0.43 false positives per second. The final detector reached 12 cm, more than twice the required range, at 4.3 g and 6 mA.
Moving the sensors to a second board
The rover’s main controller was an Adafruit Metro M0 with a Wi-Fi shield. Once the sensors were moved onto it, the magnetic and infrared readings became far noisier, from the shield’s loose pin connections and the board’s higher sensitivity. Rather than redesign every sensor, we kept the sensors on the original board and linked the two microcontrollers over I2C. This also let sensing and driving run in parallel.
I wrote the firmware for the sensing board. Each sensor is a class, the board runs as an I2C peripheral, and when the main controller requests data it replies with a small JSON message holding the latest name, age and magnetic reading. The main controller can also trigger a magnetic recalibration over the same link. The name detector’s serial port runs at 600 baud so the alien’s name is decoded directly by the hardware UART.