ExoSynk

Build an autonomous RC car — virtually

Public·Apr 24, 2026·0

Build an autonomous RC car — virtually

Complete walkthrough: design the circuit, write the Arduino sketch, model the 3D chassis, and watch your car drive on the live physics map. No hardware required.

Build an autonomous RC car — virtually

This is the flagship ExoSynk demo: a fully-simulated RC car that drives itself, avoids obstacles, survives tilt, listens for remote commands, displays live telemetry — and runs end-to-end in your browser.

Fork the attached lab and follow along. Every part, every line of sketch code, and every 3D primitive is already wired up for you — this tutorial walks through why each piece is there and how to extend it.


1. The circuit (17 parts, 39 wires)

Three logical bands:

Power & drive — 9V battery feeds a power switch, a 7805 regulator (→ 5V logic rail), and directly feeds the L298N's VS motor-supply pin. OUT1/OUT2 drive the left motor; OUT3/OUT4 the right.

Sensor & MCU — Arduino Uno on 5V. HC-SR04 on D2 (TRIG) / D3 (ECHO). MPU6050 + OLED share the I²C bus on A4/A5.

Status & comms — SSD1306 OLED for mode + distance. 8-LED NeoPixel strip on D12 for headlights + brake lights. Piezo speaker on D8 for tone() horn. HC-05 virtual BT on D4 for remote override.

Tip: ground nets are stitched via three ground parts — one per band — so every low-side net resolves cleanly.


2. The sketch — layered control loop

Open the code panel and hit Run. The loop runs three priority layers every 40 ms:

Priority 1 — BT override. While BT.available(), drain keystrokes:

  • S → emergency stop, red lamp, 440 Hz beep
  • F → force forward
  • L / R → force turn
  • A → return to autonomous

Type these into the BT input row below the Serial panel. The remote wins every time.

Priority 2 — crash / tilt detect. Reads MPU6050 ACCEL_XOUT_H (0x3B) over I²C, sign-extends the int16, divides by 16384 to get g. If |ax| > 0.6g, halt for 300 ms, orange lamp, alarm beep.

Priority 3 — autonomous roam. HC-SR04 ping distance via pulseIn(ECHO, HIGH, 30000) / 58:

  • < 12 cm → back up, swivel right, red lamp
  • < 30 cm → slow forward, yellow lamp
  • >= 30 cm → full speed, green lamp Posts distance to the OLED at 2 Hz.

3. Watch it drive

When you place an L298N, the World · RC panel auto-opens bottom-right. The yellow triangle is your car, integrated at 60 Hz from the H-bridge output voltages through a differential-drive kinematic model (65 mm wheels, 130 mm wheelbase, 80 ms motor lag). Hit a wall and it bumps (70% speed kill).

Try this:

  1. Click the HC-SR04 in the 2D canvas → Inspector → set distanceCm: 8. Car halts, backs up, turns.
  2. Click the MPU6050 → set ax: 0.7. Orange alert fires.
  3. Type S in BT input. Emergency stop.
  4. Open the Oscilloscope, probe D5. Watch the real PWM waveform drive ENA.

4. The 3D chassis

Switch to the 3D tab. The chassis is built entirely from ExoSynk primitives:

  • hollow-box 140 × 24 × 95 mm with bevel: 4 — rounded corners on the body
  • plate with bevel for the battery bay
  • standoff at the corners for the PCB
  • revolve primitives with a 6-point profile that shapes a real tire tread cross-section
  • plate bumper in yellow
  • cylinder sensor mast for the HC-SR04

Every primitive is editable. Select any part in the 3D canvas, use Mirror / Array in the top toolbar, adjust the Revolve profile in the Inspector, export STL to 3D-print the real thing.


5. Extend it

Ideas to hack on:

  • Swap the reactive loop for a PID on desired heading using MPU6050 gyro
  • Add a second HC-SR04 on D13 and do left/right obstacle comparison
  • Wire a rotary encoder and use attachInterrupt(digitalPinToInterrupt(2), onTick, CHANGE) for odometry
  • Build a second lab with matching RF.setChannel(76) code — send steering packets via RF.send()
  • Upload the STL to a slicer and print the chassis for real

6. Why this matters

The same sketch runs on real Arduino with zero changes. The L298N wiring is textbook-correct. The tire profile is STL-exportable. We simulated every component with real math — MNA solver, PWM edges, I²C register maps, differential-drive kinematics — so what you prototype here you can build physically tomorrow.

Build it virtually. Ship it physically.

ExoSynk

The Virtual Electronics Lab. Design circuits in your browser, wire them up, run real physics — then (later) order your build as actual hardware.

See @exosynk's profile →

Comments

0
Sign in to leave a comment.
No comments yet. Be the first.