Build a simple, useful, and affordable outdoor rover | Viam
Build a simple, useful, and affordable outdoor rover
Matt Vella
Developer Relations
Approaching robotics can be daunting. Many of us who have tried have ended up with empty wallets, life to catch up on, and spare parts in our closets. Some of us have had some success starting with robotic kits or learning robots. You know - the ones that are fairly easy to get up and running, but ultimately are expensive toys? In my humble opinion, these robots are somewhat missing the point: people want to create robots that do real things, that solve real-life problems. What to do? Well, you can certainly purchase a very capable outdoor robotic rover for upwards of 12 thousand dollars. It will still be hard to learn how to expand and program it, but it’s at least capable, right?
Fortunately I work at Viam, where we are building a platform that makes robotics and robotic automation approachable, and therefore much easier to build useful robots. Now, when I am an employee at any company one of the most important things is that I truly believe in the product. Therefore, I challenged myself with the following proof: “Can I build a weatherproof, outdoor rover that is capable of doing useful things for under $500?”
Good news: the answer is yes, and it can be done in less than a day.
Overall Boxbot design
The success of this project was based on two key factors:
- Hoverboard hub motors are sealed and waterproof, can carry a good payload, are capable of navigating outdoor terrain like gravel and grass, and are somewhat readily available.
- Pelican-style plastic boxes are not only able to protect your electronics against the elements, but are also sturdy enough for hub motors to be directly bolted on, and able to carry additional payload on top.
Parts list for your Boxbot
Some of the equipment listed here is optional. For example, you might not need a night-vision camera if you won’t operate it at night and you will not need a solar panel and charge controller if you plan on using your rover occasionally and charging it in-between.
- 1 x Weatherproof plastic case ($30.50): This is the key to protecting your electronics and holding the robot together. Make sure it is a thick, strong plastic and can fit the solar panel mounted on top. Finally, get one with adjustable foam inside - this is very handy for cushioning your electronic components.
- 1 x Night vision camera ($40): Night vision is optional, but a webcam of some sort is highly recommended.
- 1 x Raspberry Pi 3B or 4B or 5 with microSD card ($100): Note: Due to supply shortages, Raspberry Pi prices are fluctuating dramatically.
- 1 x 12V Battery ($65): Lots of options here - some motors might run better on 24V. You can use a battery with less storage if you don’t plan to run it continuously.
- 2 x Brushless hub motor wheels (2 x $30 = $60): Better yet - source them from a used hoverboard (this is what I did).
- 1 x USB Gmouse GPS module ($20): optional
- 1 x Solar charge controller ($20): optional
- 1 x 25w Solar panel ($10): optional
- 1 x 12V to 5V DC USB Type-C Right Angle Step-Down Power Converter ($13.50): To power the Pi from a 12V battery.
- 2 x Brushless motor controller(2x $18 = $36)
- 2 x Caster wheel (2x $5 = $10)
- 1 x Galvanized nuts/bolts, water sealing epoxy or caulk, washers, misc wires, brackets, etc ($15): Bolts are for mounting your hub motors and other components.
You’ll also need some basic tools:
- Screwdrivers
- Drill
- Drill bits
- Socket or combination wrenches
- Hack saw
- Soldering iron and solder
Build the base of your Boxbot
Next, you’ll mount the caster wheels to the “front” of the box and the hub motors to the rear. For the hub motor mounts, drill two holes through each mount, line each one up, then drill through these holes into the bottom of the plastic case. While doing this I realized that I’d also want to run the wires from the hub motor into the case under the mount. To attach the hub motors, use galvanized carriage bolts with washers inserted from the inside of the case out to the bottom, then put the bolts through the mounts, add washers and nuts and tighten securely.
Now could be a good time to attach a camera in a similar way to how you attached the wheels, but through the top of the case.
Wire it up
Brushless motor controllers
Be sure to buy motor controllers that are built specifically for brushless motors. This is imperative because brushless DC motors (BLDC for short) have a tradeoff: while they and their controllers are more expensive and complicated to set up, they are more reliable and durable.
Let’s get to it. The procedure for each side will look like:
- Solder motor controller
- Wire the hub motor to the motor controller
- Wire the battery to the motor controller
- Test controlling the motor with the motor controller potentiometer
- Wire to the Raspberry Pi
Next, add wires to the VCC and ground terminals below the motor phase wires - this will supply power to your motor. CAUTION: Be sure your base is on its side or otherwise supported so the wheels are free-spinning before attaching the battery!
Organize the wires and components
Now might be the time to figure out where you’re laying everything out inside your case. You’ll need a space for your already wired motor controllers, battery, Pi, and solar charge controller if you’re going to use solar charging.
Connect the motor controllers to the Pi
Finally, you’ll want to connect the wires from the motor controller to the Pi.
Bring your robot to life
Viam config overview
First, let’s install viam-server on your Pi. It should only take a few minutes and once you’re done, you’re ready to configure your robot.
Setting up our Boxbot config using the Viam app
Board component
Navigate to the CONFIGURE tab of your machine’s page in the Viam app.
Motor component
Next, create another component of type “motor”, model “gpio”. Call it “left” to represent the motor on the left side of your rover. Repeat for the “right” - make sure you’re mapping the correct GPIO pins for each.
Base component
Now, let’s configure a “base” component that references both of our motors. This will allow us to control our robot’s movement through a single interface.
Take your Boxbot for a drive
You can now have some real fun. Try driving your rover by keyboard, programmatically, or use a color detector to interact with the environment.
I had a lot of fun building this rover, and hope you did as well.