Arduino Robot Line-Obstacle Fix

Job ID: 40442576

Budget: $10 – $30 USD

I’m working with a Keyestudio KS4070 4-wheel Bluetooth car that my daughter assembled, but the current sketch isn’t doing what it should. With its line-tracking module, ultrasonic range sensor, and infrared receiver all wired in and verified, the car still refuses to:

• stay on the black line,
• swerve around any obstacle in its path, and
• pause precisely at programmed checkpoints.

I need a clean, well-commented Arduino sketch delivered today that makes those three behaviours rock-solid. Please structure the code into clear functions for line detection, obstacle avoidance, and stop-point handling so future tweaks are easy. Serial-print debug messages are welcome but keep them toggle-able with a macro or flag.

Acceptance criteria
• Upload sketch, I flash it once, car continuously follows a 2 cm-wide black tape loop without drifting.
• When an object is placed 15 cm ahead, vehicle brakes, turns, and rejoins the line smoothly.
• It halts for exactly 2 seconds at each RFID-tagged or IR-marked stop (you can choose which of the existing sensors to use; just document it).

Hand over the .ino file plus any calibration values or library references you use (e.g., Keyestudio_LineTracker, NewPing, IRremote). A quick note on wiring assumptions and a short read-me are appreciated. Speed is critical, so if you’re confident you can meet the deadline, let’s get started right away.