Configure a SCUTTLE Robot with a Camera
Requirements
- A Raspberry Pi with Raspberry Pi OS 64-bit Lite and the
viam-server
installed.
Refer to Installing Raspberry Pi OS on the Raspberry Pi, if necessary.
- A SCUTTLE Robot
- A USB camera (webcam)
Start configuring your robot
- Go to the Viam app.
- If you already created your robot in the app, navigate to its Config tab and skip to Configuring the board.
- Create an Organization. If you already have an Organization, then this step is optional. If you need help with organizations and locations, see our guide to using the Viam app.
- Create a Location. If you already have a Location, then this step is optional.
- Create a robot and navigate to its Config tab.
We will stay in Builder mode for this tutorial (as opposed to Raw JSON).
Note
When naming components, remember to use consistent letter casing to avoid problems with “missing” components.
Configuring the board
Add your first component, the board (in this case the Raspberry Pi).
- Enter a name for your board in the Name field. In this tutorial, we’ve named the board “local.” As long as you’re consistent, you can name the board whatever you want.
- Select the component Type, “board.”
- Select “pi” from the Model drop-down.
- Click Create Component and the board component panel will expand.
We don’t need to worry about any other attributes for this component.
Configuring the motors
Adding the right motor
The next step is to add a motor and make it spin a wheel.
- Begin by adding the right motor, naming the component “right”.
- Select “motor” from the Type drop-down.
- Select “gpio” from the Model drop-down.
- Click Create Component, which will generate the motor component panel.
- Then select
local
from the Board drop-down (since the motor is wired to the Raspberry Pi named “local”). - Set Max RPM to
100
. - Next, you’ll need to describe how the motor is wired to the Pi:
- Switch the Component Pin Assignment Type to In1/In2.
- Set A/In1 to
16
. - Set B/In2 to
15
. - Leave the
pwm
(pulse-width modulation) pin blank, because this specific motor driver’s configuration does not require a separate PWM pin.
Note
If your wheel turns in reverse when it should turn forward, add the dir_flip
attribute (found by clicking Show more) and set it to “true.”
Testing the motor configuration
Having configured a board and a motor component, you can now actuate your motor. Save the config by clicking Save config at the bottom of the page, then click over to the Control tab.
Here you’ll see a panel for the right motor
.
You’ll use this panel to set the motor’s power
level.
Be careful when activating your robot! Start with the power level set to 10% and increase it incrementally until the wheel rotates at a reasonable speed, clicking Run at each increment.
Note
A “whining” sound emitted from the motor indicates that the power level is not high enough to turn the armature. If this happens, increase the power level by 10% increments until it starts to turn.
Adding the left motor
Now, you’re ready to add the left-side motor. This will be similar to adding the right motor.
- Name the component “left”.
- Select “motor” from the Type drop-down.
- Select “gpio” from the Model drop-down.
- Click Create Component.
- Select
local
from the Board drop-down. - Set the Max RPM attribute to
100
. - Configure the motor’s pins:
- Switch the Component Pin Assignment Type to In1/In2.
- Set A/In1 to
12
. - Set B/In2 to
11
.
With both motors configured, the Control tab now display panels for both motors:

Viam (https://app.viam.com) displays component panels in order of their creation. Don’t worry if your motor panels are not adjacent.
Configuring the base
It’s time to configure a base component, which describes the geometry of your chassis and wheels so that the software can calculate how to steer the rover in a coordinated way. Configuring a base component will give you a nice UI for moving the rover around.
From the Config tab:
Give your base a name.
Enter “base” in Type.
Enter “wheeled” in Model.
In the Right Motors drop-down select “right.”
In the Left Motors drop-down select “left.”
Enter “400” in
width_mm
(measured between the midpoints of the wheels).Enter “250” in
wheel_circumference_mm
.The
left
andright
attributes represent the motors corresponding to the left and right sides of the rover. Since we named the motors “left” and “right”, you can simply add “left” and “right” between the brackets for your set of motors, respectively.
The attributes of your base component’s config should look something like this:
{
"width_mm": 400,
"wheel_circumference_mm": 250,
"left": ["left"],
"right": ["right"]
}
When you save the config and switch to the Control tab, you’ll see new control buttons for the base. In the Keyboard tab, toggle your keyboard control to active. Use W and S to go forward and back, and A and D to arc and spin.

If you click the Discrete tab, then you’ll see different movement modes such as Straight
and Spin
; and different movement types such as Continuous
and Discrete
and directions such as Forwards
and Backwards
.

Now you have a rover that you can drive using Viam’s UI! Awesome!
Try driving your SCUTTLE Robot around using the WASD keyboard controls described above.
Caution
Ensure that your robot has sufficient space to drive around without hitting anyone or anything.
Configuring the encoders
Before configuring the encoders, you must configure I2C bus 1
on the board:
{
"name": "<board_name>",
"type": "board",
"model": "<model_name>"
"attributes": {
"i2cs": [
{
"bus": "1",
"name": "main"
}
]
},
"depends_on": [],
}
Now, configure the left and right encoders as follows:
Left encoder:
- Configure the left encoder with Name
lenc
, Typeencoder
, and ModelAMS-AS5048
. - Paste the following in the Attributes field, changing the board name to match the name of your board:
{ "name": "<encoder_name>", "type": "encoder", "model": "AMS-AS5048" "board": "<board_name>", "attributes": { "board": "<board_name>", "connection_type": "i2c", "i2c_attributes": { "i2c_bus": "main", "i2c_addr": 64 } } }
- Configure the left encoder with Name
Right encoder:
- Configure the left encoder with Name
renc
, Typeencoder
, and ModelAMS-AS5048
. - Paste the following in the Attributes field, changing the board name to match the name of your board:
{ "name": "<encoder_name>", "type": "encoder", "model": "AMS-AS5048" "board": "<board_name>", "attributes": { "board": "<board_name>", "connection_type": "i2c", "i2c_attributes": { "i2c_bus": "main", "i2c_addr": 65 } } }
- Configure the left encoder with Name
Configuring the camera
Finally, we’ll add a camera to your SCUTTLE Robot.
- Enter a name of your choice in Name.
- Enter “camera” in Model.
- Click Create Component.
Now, you’ll see the config panel for the camera component:
On the camera config panel, set the video_path
.
Once you save the config, you’ll be able to see your camera’s stream in the Control tab.
On completion
After successfully completing this tutorial, you have a fully configured SCUTTLE Robot. You can drive it around and view its camera stream.
To take things to the next level, check out our Color Detection with SCUTTLE Robot tutorial or create your own camera-related tutorial. Alternatively, you can check out our Bluetooth Gamepad For SCUTTLE tutorial or our Line Follower Robot tutorial.
Documents referenced
Have questions, or want to meet other people working on robots? Join our Community Discord.
Was this page helpful?
Glad to hear it! If there is anything we could be doing better, please create an issue.
We're sorry about that. If you'd like to talk to us for help, please join the Community Discord. To ensure we know what's wrong with this page, you can also open an issue.