Introduction: Arduino Controlled Landing Reusable Rocket - With Tinkercad Simulation
Who doesn't remember this moment in history when the 2 synchronized SpaceX rockets landed together?
My son had his own school project with this cool idea.
This step‑by‑step Instructable shows how to build a demo soft‑landing system using an Arduino, an HC‑SR04 ultrasonic sensor, two DC motors driven by an H‑bridge, and a landing indicator LED. The system measures distance to the ground and adjusts motor speed with PWM so the rocket/device descends gently and stops when close to ground.
The project demonstrates a simple control loop that uses an ultrasonic sensor to measure altitude and PWM motor control to implement a staged descent. It’s a great educational demo for understanding sensors, motor control, and feedback loops. You can use it in STEM workshops, classroom demos, or as part of a model rocket/rotorcraft prototype.
What you will learn:
- How to read distance using an HC‑SR04 ultrasonic sensor.
- How to control two DC motors using PWM and an H‑bridge driver.
- How to implement staged control logic for soft landing.
- How to debug sensor noise and add smoothing/hysteresis.
Estimated build time: ~ 40 minutes (depending on assembly and testing).
Supplies
Components (Bill of Materials)
Qty Item
1 Arduino Uno (or compatible)
1 HC‑SR04 ultrasonic sensor
For distance measurement
1 H‑bridge motor driver (L298N or L293D)
Supplies motor direction & PWM control
Small brushed DC motors (3–6V)
1 5V LED
Landing indicator
1 External motor power supply
e.g. 9V battery pack or bench PSU (match motors)
Assorted Jumper wires, breadboard, screws, mount For assembly
Safety note: Use a separate power supply for motors. Motors can draw high current and cause voltage dips or damage the Arduino if powered from the Arduino 5V rail.
Step 1: Circuit Connection
The wiring below assumes an H‑bridge that has separate EN (enable/PWM) pins and IN pins for direction (common for L298N and similar drivers). Check your driver's datasheet and adapt pins accordingly.
Pin mapping used in software
- motorPin1A (IN1) → Arduino pin 9
- motorPin1B (IN2) → Arduino pin 10
- motorPin2A (IN3) → Arduino pin 11
- motorPin2B (IN4) → Arduino pin 12
- enA (ENA PWM) → Arduino pin 3 (PWM)
- enB (ENB PWM) → Arduino pin 5 (PWM)
- trigPin → Arduino pin 8
- echoPin → Arduino pin 7
- ledLanding → Arduino pin 13
Wiring steps
- Power
- Connect the H‑bridge motor supply input to your external motor battery (observe polarity).
- Connect the H‑bridge ground to the Arduino GND (common ground is required).
- If your H‑bridge has a 5V regulator output and you intend to power Arduino from it, read the module manual carefully — usually it’s safer to power Arduino separately or from USB for programming.
- Motors
- Connect Motor A wires to the H‑bridge motor outputs A.
- Connect Motor B wires to the H‑bridge motor outputs B.
- Control pins
- Wire IN1 → Arduino 9; IN2 → Arduino 10; IN3 → Arduino 11; IN4 → Arduino 12.
- Wire ENA → Arduino 3 (this will receive analogWrite() PWM signals).
- Wire ENB → Arduino 5 (PWM).
- Ultrasonic sensor
- Vcc → 5V (Arduino)
- GND → GND
- TRIG → Arduino 8
- ECHO → Arduino 7
- LED
- Connect LED anode (long leg) to Arduino 13 (or to a 220Ω resistor then to pin 13).
- Connect LED cathode to GND.
- Serial Monitor
- Connect Arduino to your computer via USB so you can view debug prints at 9600 baud.
Wiring tips & noise mitigation
- Place a 0.1µF ceramic capacitor close to the motor power input to filter high‑frequency noise.
- If motors produce heavy interference, add 100µF electrolytic across motor supply and small RC snubbers across motor terminals.
- Keep the ultrasonic wiring short to reduce signal noise.
Step 2: Arduino Code
Arduino Code
Copy the following code into the Arduino IDE and upload to your board. Adjust PWM pins or thresholds if your motors behave differently.
Step 3: Tinkercad Simulation
Tinkercad is a great place to simulate the circuit before building it physically. Follow these steps to build the simulation:
- Go to [Tinkercad Circuits] and create a new Circuit project.
- Drag an Arduino Uno and place it on the workspace.
- Add an HC‑SR04ultrasonic sensor and connect Vcc→5V, GND→GND, TRIG→pin 8, ECHO→pin 7.
- Add an H‑bridge (L298N) or two motor drivers (Tinkercad includes L293D toggle) and place two small DC motors.
- Wire motor driver IN/EN pins to Arduino pins as per the pin mapping in the "Circuit Connection" section.
- Place an LED and connect through a 220Ω resistor to pin 13 and GND.
- Copy/paste the Arduino code into the Tinkercad code editor (select Arduino mode) and upload to run.
Simulation tips:
- Tinkercad's motor models are simplified; use the serial monitor and printed distances to validate logic.
- Use Tinkercad’s variable resistor or button to emulate ground proximity if you need precise test cases.
Step 4: Final and Future Work
Final
- You now have a working demonstration of a soft‑landing controller that stages motor speed by altitude and indicates when landing is complete.
- Use the serial monitor to calibrate the altitude thresholds for your particular motors and setup.
Future improvements and extensions
- Add smoothing/hysteresis: Average multiple distance samples to reduce noise and prevent jitter near thresholds.
- PID control: Replace the simple threshold logic with a PID loop to compute motor PWM smoothly based on distance error and rate of descent.
- Altitude sensor upgrade: Use a laser rangefinder or barometric sensor for more precise altitude measurement in real applications.
- Logging & telemetry: Add an SD card or radio link to log descent profile and motor outputs for analysis.
- Safety features: Implement an emergency cut‑off if sensors fail or if descent rate is too high.
Step 5: Troubleshooting
- Distance reads 0 or very large: Check the HC‑SR04 power and wiring; ensure echo pin is connected and nothing blocks the sensor.
- Motors don't spin: Verify motor power supply, common ground, and that EN pins receive PWM. Test motors directly with battery.
- Excessive noise or MCU resets: Motors may be drawing too much current—add decoupling capacitors and confirm the power supply can deliver the current.





