Chinese University Team Advances Low-Cost Robotics with Arduino-Based Line-Following System

Chinese University Team Advances Low-Cost Robotics with Arduino-Based Line-Following System

By leveraging accessible microcontroller platforms and infrared sensing, researchers at Capital Normal University have developed a novel approach to line-following and path control in small-scale robotic systems. Their work, detailed in a recent paper published in the Journal of Capital Normal University (Natural Science Edition), demonstrates how simplified proportional control—paired with digital sensing logic—can effectively navigate complex competition environments without relying on high-speed or computationally intensive algorithms. The implementation, designed for the China Engineering Robot Competition, achieves stable trajectory following and precise turning maneuvers using only eight core functional modules anchored by an OpenDuino control board. This frugal engineering solution underscores a growing trend in global robotics education: the democratization of advanced control techniques through open-source hardware and modular programming paradigms.

The robot’s primary task is to autonomously locate, identify, and transport colored blocks across a 2,260 mm by 2,260 mm competition arena within a five-minute window. Success hinges on its ability to stay aligned with 20 mm-wide black guidance lines while executing accurate rotations at junctions such as the central crosspoint. Unlike high-performance line racers that employ full PID (proportional-integral-derivative) controllers requiring real-time wheel-speed feedback and dynamic tuning, this design adopts a streamlined differential steering method. The approach trades marginal speed for robustness and ease of calibration—key priorities in undergraduate engineering contests where development time and component constraints are significant.

At the heart of the navigation system are four TCRT5000 infrared reflective sensors mounted horizontally across the front of the chassis. These sensors provide both analog and digital outputs. The inner pair—labeled trac1 and trac2 in the implementation—feeds analog voltage readings into the microcontroller’s analog-to-digital converter pins. The analog signal varies continuously from approximately 39 (on pure white surfaces) to 690 (on solid black lines), enabling fine-grained detection of the robot’s lateral offset from the center of the track. The outer sensors—trac0 and trac3—operate in digital mode, outputting binary signals that trigger discrete turning behaviors when crossing intersections or executing sharp directional changes.

The analog-based line-following algorithm calculates the difference between the left and right sensor values and applies a scaled correction to the pulse-width modulation (PWM) signals driving the left and right motors. Specifically, if the right sensor reads a darker value than the left, the robot is drifting leftward and the right motor is slowed slightly while the left motor is accelerated, nudging the chassis back toward alignment. The correction factor—empirically determined as 0.058 in this study—was tuned through iterative on-track testing to minimize oscillation without overcorrecting. At a base PWM speed setting of 115 (on a 0–255 scale), this method achieves smooth, jitter-free tracking even on curves and imperfect surfaces. Crucially, the absence of integral or derivative terms eliminates the risk of overshoot or instability common in beginner PID implementations, making the system highly teachable and reproducible.

Path control at decision points relies entirely on the digital outputs of the outermost sensors. When the robot reaches a junction—such as the arena’s central hub where multiple black lines intersect—it initiates a “cross-line” turning routine. For a 45-degree right turn, the robot executes a function that first rotates in place until trac0 detects the edge of a black line (transitioning from 0 to 1), then continues rotating until it exits the line (transitioning back to 0). This two-phase detection ensures that the chassis has fully traversed one line segment, corresponding to a precise angular displacement relative to the layout geometry. Repeating the function twice yields a 90-degree turn; four repetitions produce a 180-degree reversal. The same logic applies symmetrically for left turns using trac3. This strategy transforms abstract angular commands into observable, sensor-verified physical events, greatly enhancing reliability in unpredictable lighting or surface conditions.

The mechanical architecture adheres strictly to competition regulations: the robot measures no more than 160 mm in width and 270 mm in length. Its chassis integrates a two-wheel differential drive powered by standard DC gear motors, a lifting arm controlled by a servo motor for block retrieval, an ultrasonic sensor for proximity-based object detection, and a color recognition module to match blocks with target zones. All subsystems communicate through the OpenDuino board—a specialized Arduino-compatible platform developed by Oupeng Technology in Shenzhen. This board combines an ATmega328P microcontroller with integrated motor drivers, Bluetooth, and XBee wireless interfaces, eliminating the need for external shields or complex wiring harnesses. For non-computer science engineering students, this integration drastically reduces the barrier to entry, allowing focus to remain on control logic and system integration rather than low-level electronics.

The programming environment follows standard Arduino conventions using a C/C++-based syntax. The motor control function encapsulates directional commands (forward, backward, left turn, right turn, and stop) into a single callable routine that manages both PWM values and digital direction pins. This abstraction enables rapid prototyping: high-level behaviors like “approach block” or “return to center” can be composed from simple sequences of motorRun() calls without repeatedly rewriting pin configurations. Similarly, the tracing() and turnLeft()/turnRight() functions operate as self-contained modules that can be tested and debugged independently. This modular design reflects best practices in embedded software engineering and aligns with pedagogical goals in undergraduate laboratories, where maintainability and readability often outweigh raw performance.

Beyond competition performance, the project illustrates a broader principle in contemporary STEM education: the strategic use of constrained systems to teach complex concepts. By limiting computational resources and sensor fidelity, the design forces students to develop intuition about feedback control, state transitions, and sensor fusion. The analog-digital hybrid approach—using analog for continuous regulation and digital for discrete event handling—mirrors architectures found in industrial automation and autonomous vehicles, albeit at a vastly reduced scale and cost. This “microcosm” methodology allows learners to engage with authentic engineering trade-offs without requiring access to expensive hardware or proprietary software stacks.

Moreover, the reliance on open-source libraries and community documentation exemplifies the collaborative ethos that has fueled the global maker movement. Color sensing, ultrasonic ranging, and servo control all benefit from well-maintained Arduino libraries that standardize initialization and data interpretation. These resources, contributed by thousands of developers worldwide, enable rapid iteration and cross-institutional reproducibility. In the context of the China Engineering Robot Competition—which has engaged tens of thousands of university students since its inception in 2011—such accessibility ensures that teams from diverse academic backgrounds can participate meaningfully, regardless of institutional funding or prior robotics experience.

Looking ahead, the researchers plan to expand the system’s capabilities in a forthcoming paper, focusing on real-time color classification and adaptive grasping triggered by ultrasonic ranging. These enhancements will close the loop between perception and action, enabling the robot to not only follow paths but also make context-aware decisions based on block identity and spatial location. Future iterations may also explore machine learning techniques for line prediction or anomaly detection, though the current philosophy favors deterministic, explainable control over black-box algorithms—a stance that resonates with safety-critical applications and educational transparency alike.

Critically, this work avoids the common pitfall of over-engineering. Many academic robotics projects prioritize novelty or computational sophistication at the expense of practicality. In contrast, the Capital Normal University team demonstrates that elegant, robust performance can emerge from minimal components and straightforward logic—provided the design is grounded in empirical testing and clear functional decomposition. This ethos is particularly relevant in resource-constrained educational environments, where reliability and repeatability often matter more than peak theoretical performance.

The implications extend beyond the classroom. Low-cost, sensor-guided robots of this type are increasingly deployed in warehouse logistics, agricultural monitoring, and assistive technologies in developing regions. The principles validated here—modular sensing, hybrid analog-digital control, and behavior-based programming—are directly transferable to real-world automation challenges where environmental unpredictability and hardware limitations are the norm. As global supply chains demand more flexible and affordable robotic solutions, the pedagogical innovations pioneered in competitions like this may well seed the next generation of industrial automation engineers.

In conclusion, the system developed by Li Zhenyu and colleagues represents more than a competition entry; it is a case study in pragmatic engineering education. By marrying accessible hardware with clear, testable software logic, the team has created a replicable blueprint for line-following robotics that balances performance, simplicity, and pedagogical value. Their method proves that effective autonomy does not require exotic sensors or high-speed processors—only thoughtful design, empirical tuning, and a deep understanding of the interaction between physical constraints and control theory.

Li Zhenyu, School of Mathematical Sciences, Capital Normal University, Beijing 100048. Journal of Capital Normal University (Natural Science Edition), Vol. 42, No. 4, August 2021. DOI: 10.19789/j.1004-9398.2021.04.002.