One robot, two brains: Arduino C and pure x86 assembly.
A line-following robot built with a 6-person team, driven by five IR sensors (two per side plus one centre) feeding an 8-branch decision cascade. The code and logic was implemented twice: once as real-time Arduino C actually driving the motors, and once as an x86 assembly program replicating the identical decision logic at the lowest level.
Both versions share one physical build: a two-layer clear acrylic chassis carrying an Arduino Uno, a small breadboard wired in purely as a distribution hub, five IR reflectance sensor modules each with its own sensitivity trim-pot bolted along the front edge, two yellow-gearbox DC motors driven through a red L298N dual H-bridge module, and three 18650 lithium-ion cells (2000mAh each) supplying power from a holder at the rear. Only the Arduino build actually drives that hardware — the assembly version (used for demonstrating the understanding of the x86) takes the same five 0/1 sensor readings from the keyboard and prints the resulting action, translating the exact if/else-if chain into compare-and-jump instructions.
The same 8-branch cascade, two ways — Both implementations walk an identical priority chain: centred → forward, any/both right sensor(s) → turn right, any/both left sensor(s) → turn left, side+centre combinations → forward, all sensors clear → creep forward, line lost → stop.
A real chassis, not a breadboard sketch — The robot is a two-layer clear acrylic chassis: an Arduino Uno and a small breadboard (wired in purely as a distribution hub, not for prototyping logic) sit on the top deck, while five IR reflectance sensor modules each with its own sensitivity trim-pot are bolted along the front edge of the lower deck to scan the track surface. Two yellow-gearbox DC motors drive the wheels through a red L298N dual H-bridge module, powered by three 18650 lithium-ion cells (2000mAh each) in a holder at the rear, all tied together through dozens of jumper wires run back to the Uno's digital pins.
A genuine low-level demonstration, not just a rewrite — The 8086 assembly program is a real DOS text-mode simulator: it prompts for each of the five sensor values one keystroke at a time, validates that each entry is '0' or '1' before proceeding (re-prompting via a jump loop otherwise), stores them as individual bytes, and calls a shared PRINT_SPACE routine via call/ret which results in a genuine stack-based procedure call, not just inline text.
PWM-scaled motor response, not just on/off — The Arduino doesn't just switch motors on or off: turning and forward-on-line both run at PWM 100, while the 'all sensors clear' case deliberately throttles to PWM 80 which is a slower creep-forward reserved for turns to increase the accuracy or for when the robot has lost sight of the line but hasn't yet triggered a full stop.
Branch-for-branch fidelity between languages — The 'any right sensor' and 'both right sensors' conditions (and their left-side mirrors) are checked separately in both languages even though they resolve to the same motor action, they are preserved deliberately so the assembly translation mirrors the Arduino's if/else-if chain one branch at a time, rather than optimizing the logic away in translation.
- 5-sensor IR reflectance array (2 left, 1 centre, 2 right) into an 8-branch decision cascade
- Two-layer acrylic chassis with a breadboard wiring hub and two yellow-gearbox drive motors
- Differential steering via a red L298N dual H-bridge motor driver module
- Powered by 3x 18650 lithium-ion cells (2000mAh each)
- PWM-scaled motor speed for lower speed turns vs. throttled creep-forward
- Identical decision logic in Arduino C and interactive x86 assembly
- Input-validated sensor entry and call/ret subroutines in the assembly version
Arduino C · x86 Assembly (8086) · Arduino Uno · L298N Driver · IR Reflectance Sensors · 18650 Li-ion Cells · DOS Interrupts
- 5 IR sensors
- 8 decision branches
- 2 implementations
ARDUINO CODE/— the real-time Arduino C sketch that drives the physical robot's motors from live sensor inputASSEMBLY CODE/— the x86 (8086) assembly program that replicates the identical decision logic as an interactive DOS text-mode simulatorLine Following Robot Presentation.pdf— full project write-up and presentation
Part of Zeiad Abogebba's portfolio — see the full write-up and gallery in the portfolio site.