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:

  1. 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.
  2. 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.

You’ll also need some basic tools:

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:

  1. Solder motor controller
  2. Wire the hub motor to the motor controller
  3. Wire the battery to the motor controller
  4. Test controlling the motor with the motor controller potentiometer
  5. 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.