How to Make an Autonomous Robot for Under $30
by amarsbar in Circuits > Arduino
164 Views, 2 Favorites, 0 Comments
How to Make an Autonomous Robot for Under $30
Transform a secondhand iRobot Roomba into an autonomous mobile robot with camera streaming, obstacle avoidance, and a 3D printed robotic arm for object manipulation. Total cost under $30. This robot can avoid obstacles, fetch you redbull, pick up your socks, it can do everything except clean lol ( for now ).
Supplies
SUPPLIES
Hardware:
- iRobot Roomba (secondhand, broken one works fine, $5)
- ESP32 development board ($10)
- ESP32-CAM module ($8) OR Raspberry Pi with camera (borrowed)
- HC-SR04 Ultrasonic distance sensor ($2)
- 3D printed robotic arm components (filament cost ~$3, STL files available)
- Motor driver board compatible with ESP32 (L298N or similar, $5)
- LiPo battery pack with USB-C output (5200mAh recommended, or reuse Roomba battery)
- LiPo balance charger (if using LiPo battery)
- Jumper wires and connectors ($2)
- Mounting brackets and screws
- Heat shrink tubing
- USB-C cable for power distribution
Tools:
- Screwdrivers (Phillips and flathead, various sizes for Roomba disassembly)
- Wire strippers
- Soldering iron and solder
- Multimeter for testing connections and voltage
- 3D printer (or access to makerspace, library, or friend's printer)
- Hot glue gun or epoxy for securing components
Software (All Free):
- Arduino IDE for ESP32 programming
- ESP32 board support package
- ESP32-CAM libraries for camera streaming
- Web server code for video streaming
- SSH client (if using Raspberry Pi instead of ESP32-CAM)
Optional but Recommended:
- Voltage regulators (if battery voltage doesn't match component requirements)
- Capacitors for noise filtering on motor lines
- Zip ties for cable management
- Electrical tape
Total Cost: Under $30 (excluding tools you may already have)
SCHEMATICCCCSSS
What you're looking at:
This is the complete wiring diagram showing how all the components connect together to make your autonomous Roomba robot work.
Power System (Bottom):
The Zeee 5200mAh LiPo battery is your main power source. It connects to the LiPo balance charger for charging. The battery powers everything through a distribution system that splits power to different components at the right voltages.
Main Control Board (Center):
The green circuit board is the Roomba's base with the motor connections. You can see the two drive wheels shown in the side images with their motors and gearboxes. These motors connect to the main board and are controlled by your ESP32.
Motor Control (Left side, small board):
The small blue Arduino board (likely your ESP32 or motor driver) controls the two drive motors. Red wires are positive power, black wires are ground, and the other colored wires (green, yellow) are control signals telling the motors when to spin and how fast.
Robot Arm (Top):
The black robotic arm sits on top of the Roomba base. It has its own servo motors that need power from the battery system and control signals from the ESP32.
Ultrasonic Sensor (Top, small component):
The small blue sensor module on top is your HC-SR04 ultrasonic distance sensor. It connects with 4 wires: power (VCC), ground (GND), trigger, and echo pins going to the ESP32.
How it all works together:
- Battery provides power to everything
- ESP32 reads the ultrasonic sensor to detect obstacles
- ESP32 sends commands to the motor driver
- Motor driver controls the two drive motors to move the robot
- ESP32 also controls the robotic arm servos
- Everything shares a common ground connection (black wires)
Key wiring points:
Red wires = Positive power Black wires = Ground (must all connect together) Green/Yellow/Other colors = Signal or control wires The battery charger is separate and only connects when charging, not during operation
How Long Did It Take?
About 2 weeks working on and off. The initial motor swap and getting it driving took a weekend. Adding the camera and streaming took a few days. Mounting and integrating the robotic arm took another week of testing and calibration.
DIFFICULTY LEVEL Intermediate to Advanced. You need basic electronics knowledge, programming experience with Arduino or Python, and some mechanical skills for mounting components. But if you can follow instructions and debug issues, you can definitely build this.
Find and Acquire a Cheap Roomba
Check thrift stores, Craigslist, Facebook Marketplace for broken Roombas. Look for ones without chargers or with motor issues since they're cheapest. $5 to $15 is a good price range. Don't worry if it doesn't work, we're replacing everything anyway. Make sure the chassis and wheels are intact.
Disassemble the Roomba
Remove all the screws from the Roomba bottom cover. Carefully lift off the cover and set aside. Disconnect the original Roomba control board. Keep the battery compartment and wheel motors. Remove the brush assembly (we'll use that motor later). Take photos as you disassemble to help with reassembly.
Assess and Test the Motors
Use a multimeter to test which motors still work. In my case, one drive motor was dead and the brush motor was good. Test the working drive motor by applying power directly. Test the brush motor the same way. Note the different power characteristics between the two motor types.
OPTIONAL: Motor Swap and Wiring
Remove the dead drive motor from its mounting location. Install the brush motor in place of the dead drive motor. Note: The brush motor is a DC motor while the original may have been different. Wire both motors to the motor driver board. Connect the motor driver to the ESP32. Connect power supply to the motor driver.
Program the ESP32 Motor Control
Install Arduino IDE and ESP32 board support. Write code to control both motors through the driver board. The tricky part: the brush motor has different torque and power draw. You need to compensate in code by adjusting PWM values to each motor. Test by running both motors and adjusting until the robot drives straight. Add turn functions by varying motor speeds.
Downloads
Add Ultrasonic Sensor
Mount the HC-SR04 sensor on the front of the Roomba. Connect VCC to ESP32 5V or 3.3V, GND to GND. Connect Trigger pin to a GPIO pin on ESP32. Connect Echo pin to another GPIO pin on ESP32. Update the ESP32 code to read distance measurements.
Implement Obstacle Avoidance
Write code on ESP32 to check distance constantly. If distance is less than a threshold (like 20cm), stop motors. Execute a turn maneuver to avoid the obstacle. Continue forward after turning. Test the avoidance by placing objects in front of the robot.
Check the code included above to get started. Message me for full Obstacle avoidance code with model training for obstacle detection
Camera Module (Budget Option: ESP32-CAM)
Mount the ESP32-CAM on top of the Roomba. Connect to power supply. Program the ESP32-CAM to stream video to a web server. Access the stream from any device on your network. This keeps your total cost under $30 instead of needing a Raspberry Pi.
Alternative: Raspberry Pi Camera Setup (If Borrowed)
Create a mounting platform on top of the Roomba for the Pi. Secure the Pi to this platform with screws or standoffs. Connect Pi to its own power supply. Connect Pi Camera module or USB camera. Install necessary camera libraries on the Pi. Write a Python script using Flask to stream video. Test by accessing the Pi's IP address from a browser.
3D Print Robotic Arm Components
Find or design a small robotic arm suitable for mounting on the Roomba. Use a free design from Thingiverse or similar. 3D print all the arm components (around $3 in filament). Print mounting brackets to attach the arm to the Roomba. If you don't have a printer, use your library or makerspace.
Calculate total current draw from all components. ESP32 and motors need suitable voltage and current. ESP32-CAM needs proper power. Servos for the arm need appropriate power. Use proper voltage regulators if running everything from one battery. Add fuses for safety. You can often reuse the Roomba's original battery if it still holds charge.