KSKrrish Shah
Personal project · Mechanical, electronics and controls

Autonomous Obstacle-Course Rover

A four-wheel rover I designed in CAD, 3D printed, wired and programmed, then ran through a six-stage course on timed moves, a sonar sensor and a light sensor.

RoleSolo: design, build, code
Built withCAD, 3D printing, Phidgets, Java
ResultAll 6 stages cleared
Demo run · the real course, start to finish
The brief

Navigate a course with nothing but sensors and code

The assignment, Maze Navigator & Environment Logger, asked for a rover that finds its way on its own, uses sonar to avoid obstacles and a light sensor to read its environment, and records readings so the run can be analysed afterwards.

1

Hard-coded turns

Follows a timed sequence of drive and turn moves.

2

Sonar obstacle detection

Stops when something is closer than 200 mm and turns.

3

Speed recognition

Drives at a different speed for each part of the run.

4

Light sensing

Creeps toward the lamp and stops when the light level is high enough.

5

Precision turning

Turns calibrated by trial and error to land on the right heading.

6

Textbook push

Pushes a textbook clear of the finish line.

The assembled rover with motor controller, wireless hub and battery pack
The machine · motor controller, wireless hub, battery pack, four driven wheels
Top-down view of the course made from textbooks standing on edge
The course from above · textbooks stand on edge to form the walls
Mechanical design

Drawn in CAD, printed flat, folded along designed bend lines

Everything the rover rides on was drawn in CAD, then made and finished by hand.

What I designed

  • Main frame: the structure everything else attaches to, printed flat and folded along designed bend lines, with bays for the motors underneath.
  • Battery and motor frame: holds the batteries and motors in place.
  • Suspension: keeps the wheels in contact with the ground on uneven floor.
  • Sensor mounts: position the sonar and light sensor for a clear field of view and clearance.
  • Wireless-module mount: carries the piece that connects the rover to my computer's network.

Designing for bending

The frame is printed flat and folds along bend lines I added in CAD. I predicted where the weight of the batteries, motors and wheels would bend it and put the bend lines there. Once the rover was loaded, the parts bent at those lines.

From CAD to hardware

First printed in PLA; that frame bent too easily under load, so the final build uses PETG. None of the 15+ printed parts was usable straight off the printer: I cut, shaped and sanded each one before assembly.

MaterialPETG (first in PLA)
Printed flat168.4 × 202.4 mm
Folded size150 × 120 mm
Mass62 g
Main frame · top: from above and underneath (motor bays) · bottom left: flat printed blank, bend lines in red (mm) · bottom right: folded top view · click to enlarge
Enlarged CAD drawing of the main frame
Design failure and fix

The PLA frame bent under load and tilted the whole rover

The first frame was printed in PLA. With the batteries, motors and wheels fitted, it bent so easily that the rover tilted off balance. My teacher recommended PETG, and the reprinted frame bent less under the same load.

  • Symptom: under the full load, the PLA frame bent and tilted the rover, shifting the balance of every component mounted on it.
  • Why it matters: a tilted frame changes how the wheels meet the ground and where anything mounted on it points, which undermines timed moves and sensor readings.
  • Evidence: I did not photograph the failure, so the model below is a schematic of it, exaggerated for clarity and not measured.
Root cause. A constant bending load on thin, low-ductility bend zones caused local yielding and creep. The permanent set left the frame sagging, and the rover tilted.
Schematic · front view of the rover
As designed: level

The frame sits flat and the weight of the battery, motors and wheels is shared. Choose PLA loaded to see what happened.

Stress–strain explorer · printed PLA vs printed PETG
2.9 %

PLA

Stress σ
Energy absorbed

PETG

Stress σ
Energy absorbed

Drag the slider. PLA yields at 2.9% strain, PETG at 5.9%. The area under each curve is the energy absorbed per unit volume. Curve shapes are sketched between datasheet points.

Stress

Stress (σ) is load per unit area. In bending, σ = M·c / I. The weight of the batteries, motors and wheels created a bending moment that concentrated stress in the thin bend zones.

Strain

Strain (ε) is deformation per unit length. In the elastic range σ = E·ε and the part springs back. Past the elastic limit the strain no longer recovers.

Young's modulus

Young's modulus (E) is stiffness in the elastic range. Beam stiffness scales with E·I, and I = b·t³ / 12, so thin sections are extremely sensitive to thickness.

Yield and ductility

Yield strength marks where permanent (plastic) deformation starts. Ductility is the strain a material tolerates. Printed PLA yields at only about 3% strain.

Creep

Slow permanent deformation under constant load. PLA softens at about 55 to 60 °C (its glass transition), so warm batteries and motors can speed it up.

Why PETG

Printed PETG is not stiffer than PLA. The gain is in how it behaves once the bend zones are loaded: about twice the strain at yield, more energy absorbed before failure, and a higher glass transition.

PropertyPLAPETGWhat it means for the frame
Young's modulus, E2.2 GPa1.9 GPaElastic stiffness. PLA is slightly stiffer.
Tensile yield strength, σy51 MPa46 MPaSimilar strength, so not the deciding factor.
Strain at yield2.9%5.9%How far it bends before it deforms permanently.
Glass transition, Tgabout 55–60 °Cabout 77 °CCreep resistance near warm batteries and motors.

Typical datasheet values for printed specimens in the flat (XY) direction: Prusament PLA (ISO 527) and Ultimaker PETG (ASTM D3039). Test methods and printers differ, so compare the trends, not the decimals. The PLA sheet reports yield only, so its curve stops there.

Result

  • Same geometry and bend lines, reprinted in PETG.
  • Under the same load of batteries, motors and wheels, the PETG frame bent noticeably less and the rover's balance held.
  • Final frame mass: 62 g.

If it needed more

  • Thicker bend zones: stiffness scales with t³, so 50% more thickness gives about 3.4× the bending stiffness.
  • Print orientation: PETG's layer-to-layer strength is about half its in-plane strength (19 against 38.5 MPa at break), so keep bends from peeling layers apart.
  • Check first: estimate deflection with δ = F·L³ / (3·E·I) before printing.
Electronics and sensors

A wireless hub ties the rover to my computer

The code runs on the computer and sends every command to the rover over the network. The sensors send their readings back the same way.

ComputerJava control code Wireless hub192.168.100.1 DC motor controllerch 0 left · ch 1 right Sonar sensordistance, channel 0 Light sensorhub port 3 Drive motors4 wheels 200 mm trigger 100 lux target wireless
Drive

Phidgets DC motor controller

Left side on channel 0, right side on channel 1.

Locomotion

Four motors and wheels

Wired as a left pair and a right pair, so the rover turns by driving the two sides in opposite directions.

Sensing

Sonar distance sensor

Reads distance in millimetres and sees obstacles ahead.

Sensing

Light sensor

Reads light level in lux on hub port 3 and finds the lamp.

Network

Wireless Phidgets hub

Connects every device to my computer's network.

Power

Batteries

Mounted in the printed battery frame. Wiring between sensors, hub and controller is soldered.

Software and iteration

Four versions, each building on the last

The control code is written in Java with the Phidget22 library. I started with a square driven by pure timing and added sensing one step at a time.

Control flow · replay Press run to replay a condensed trace of the logic.
Limits. Turns are calibrated durations, not measured angles, so battery level and floor friction can change them. The sonar decides when to turn, while the turn directions are set in advance. Next step: add a gyro or wheel encoders so turns use real heading feedback.
Results and reflection

All six stages cleared, finishing with the textbook

The rover cleared all six stages on the demo run, finishing by pushing the textbook clear of the line.

Start of the run
0:00Start
Rover entering the course
0:10Into the course
Rover between the walls
0:20Between walls
Rover turning through the course
0:30Turning through
Lamp in view near the end
0:40Lamp in view
Finish
0:47Finish

What worked

  • Building in layers: every version was a working rover before the next sensor went on.
  • Calibrating turns by hand until the rover hit each corner.
  • Smoothing the light signal so the stop point was consistent.
  • Designing the mounts around the sensors, not the other way round.
  • Putting bend lines where I predicted the frame would flex under the weight of the batteries, motors and wheels. It bent at those lines.
  • Treating the tilting PLA frame as a materials problem and fixing it by moving to PETG.

What I'd change

  • Replace timed turns with gyro or encoder feedback.
  • Let the sonar choose the turn direction, not just the moment.
  • Log every sensor reading and analyse the run afterwards, as the brief asks. The current code only prints readings to the screen.
What I took away. Hardware and software limit each other, and material properties decide whether a design works, not just its shape. Every mechanical choice, from how the frame flexes under load to where the sensors sit, changed what the code could rely on, and every sensor reading was noisier than I expected until I filtered it.

Source code and the full demo video are available on request.