Skip to content
Video course · Lesson 2 120 min

Workshop: Wiring and Electronics

Wire the battery, main power switch, Control Hub, motors and servos neatly and safely, power the robot on for the first time, configure the motors and learn a checklist for fixing problems.

VIDEO COMING SOON

Our team is preparing this lesson. Written materials and practical exercises are available below.

In this lesson you will

  • Connect the battery, main power switch and Control Hub in the correct order
  • Route, label and strain-relieve motor and servo cables
  • Configure motor names on the Driver Station and test each motor on its own
  • Troubleshoot power and motor problems using a systematic checklist
  • Charge, store and handle robot batteries safely

Lesson

Most robot failures in a match are not broken code or broken metal: they are loose plugs, pinched wires and flat batteries. Good wiring is invisible when it works and very hard to fix in the two minutes before a match. In this workshop you will turn your chassis into a robot that powers on, connects to the Driver Station and drives each wheel on command, with wiring neat enough that anyone on the team can follow it.

Tools and parts

ItemWhy you need it
Charged 12 V robot battery and matching chargerPowers the robot; the charger must suit the battery type
Main power switch and battery adapter cableLets you turn the whole robot off quickly
Control Hub, Driver Station and a gamepadThe robot's brain, the drivers' screen and the controls
Motor power cables, encoder cables, servo extensionsConnect motors, encoders and servos to the hub
Zip ties, cable wrap, labels and a flush cutterSecure, protect and identify every cable

Build the power path

Driver HubGamepadsControl HubCPU · IMU · I/OBattery 12 VSwitchWi-FiMotorsServosSensors
Power flows from the battery through the main switch to the Control Hub, which powers and controls the motors, servos and sensors and talks wirelessly to the Driver Station.
  1. 1
    Mount the battery
    Hold the battery firmly with a bracket, strap or holder so it cannot slide or fall out in a collision. Place it low and near the centre of the robot, and where it is easy to swap between matches.
  2. 2
    Mount the main power switch
    Fix the switch where a person can reach and see it quickly from outside the robot, away from moving parts, so it cannot be bumped off by accident. Check the current Competition Manual for rules about the switch and its position.
  3. 3
    Mount the Control Hub
    Screw the hub to a flat plate or the frame with the ports facing where cables can reach them easily. Make sure its status light stays visible and that mechanisms cannot hit it.
  4. 4
    Connect the power cables
    Run the battery cable to the switch and the switch to the hub's power input using the cables made for your parts. Use proper adapters instead of cutting and splicing wires.

Motor and servo cables

The Control Hub has numbered motor ports (0 to 3), each with a power connector and a separate encoder connector, plus numbered servo ports (0 to 5). Plug each drive motor's power cable into its own motor port and its encoder cable into the matching encoder port with the same number. Servo plugs have three wires; check the colour order printed next to the port so the plug is not reversed. Push every plug in until it is fully seated, then give it a gentle tug to make sure it holds.

  • Label both ends of every cable with its name and port, for example frontLeft M0.
  • Keep a written port map in your notebook showing which device is on which port.
  • Add strain relief: zip-tie each cable to the frame a short distance from the plug, so a pull on the cable stresses the zip tie, not the connector.
  • Leave a small service loop of slack near each plug so you can unplug it without stretching the cable.
  • Route cables along the frame, away from wheels, gears, chains and sharp edges, and use cable wrap where they rub.
  • Trim zip-tie tails flush so they do not scratch hands or catch on other robots.

First power-on and motor configuration

  1. 1
    Pre-power check
    With the robot on a stand so the wheels are off the table, check that no bare metal is showing, no wire touches a wheel and every plug is seated.
  2. 2
    Power on
    Plug in the battery and turn on the main switch. Watch the hub's status light and compare what you see with the REV documentation. If anything smells hot or smokes, switch off at once.
  3. 3
    Connect the Driver Station
    Pair the Driver Station with the Control Hub over Wi-Fi as described in the official FTC Docs, and confirm that it shows the robot is connected.
  4. 4
    Create a configuration
    Open Configure Robot, create a new configuration and, under the Control Hub's motors, choose the motor type for each port and type a name such as frontLeft, frontRight, backLeft and backRight. Save it and make sure it is the active configuration.
  5. 5
    Test one motor at a time
    Run a simple test OpMode like the one below. Spin each wheel alone at low power and check that the correct wheel moves. Note which motors need to be reversed in code so all wheels drive forward together.
JAVA
1package org.firstinspires.ftc.teamcode;
2
3import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
4import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
5import com.qualcomm.robotcore.hardware.DcMotor;
6
7@TeleOp(name = "Wheel Test")
8public class WheelTest extends LinearOpMode {
9    @Override
10    public void runOpMode() {
11        DcMotor frontLeft = hardwareMap.get(DcMotor.class, "frontLeft");
12        DcMotor frontRight = hardwareMap.get(DcMotor.class, "frontRight");
13        DcMotor backLeft = hardwareMap.get(DcMotor.class, "backLeft");
14        DcMotor backRight = hardwareMap.get(DcMotor.class, "backRight");
15
16        waitForStart();
17
18        while (opModeIsActive()) {
19            // Low power so the robot cannot run away
20            frontLeft.setPower(gamepad1.x ? 0.3 : 0);
21            frontRight.setPower(gamepad1.y ? 0.3 : 0);
22            backLeft.setPower(gamepad1.a ? 0.3 : 0);
23            backRight.setPower(gamepad1.b ? 0.3 : 0);
24
25            telemetry.addData("FL ticks", frontLeft.getCurrentPosition());
26            telemetry.addData("FR ticks", frontRight.getCurrentPosition());
27            telemetry.addData("BL ticks", backLeft.getCurrentPosition());
28            telemetry.addData("BR ticks", backRight.getCurrentPosition());
29            telemetry.update();
30        }
31    }
32}
A test OpMode: hold X, Y, A or B to spin one wheel slowly. The names must exactly match the configuration, including capital letters.

Troubleshooting checklist

SymptomCheck firstUsual fix
Nothing turns onBattery charge, battery plug, main switch, power cable at the hubSwap in a charged battery and reseat every power connector
Driver Station will not connectHub status light, Wi-Fi pairing, distance from hubRestart the hub and Driver Station, then pair again following FTC Docs
Error that a device cannot be foundSpelling and capitals of the name, active configurationMake the configuration name and the code name exactly the same
One wheel does not movePort map, motor power plug, a jammed wheelReseat the plug, check it is on the right port, spin the wheel by hand
Wheel spins the wrong wayWhich motors are reversed in codeSet the direction of that motor in code, not by swapping wires
Encoder count stays at 0Encoder cable on the matching port numberReseat or replace the encoder cable

Charging and handling batteries

  • Label each battery with a number and record when it was charged and how it performed.
  • Check the voltage before every test; swap batteries early rather than testing on a nearly flat one.
  • Carry batteries by the case, never by the wires, and do not drop them.
  • Store batteries in a cool, dry place away from metal objects that could short the terminals.
  • Use only battery types allowed by the current Competition Manual.

Key terms

Main power switch
The switch that turns the entire robot on and off by connecting or disconnecting the battery.
Control Hub
The REV device on the robot that runs your code and powers and controls motors, servos and sensors.
Encoder cable
A small cable that carries rotation counts from a motor's encoder back to the hub's matching encoder port.
Strain relief
Securing a cable near its plug so pulling forces go into the frame, not into the connector.
Robot configuration
The saved list on the Control Hub that gives each port a device type and a name used by your code.

Practical exercise

Wire, configure and test your drivetrain

  1. 1Mount the battery, main power switch and Control Hub, and connect the power path with the battery unplugged.
  2. 2Connect all four drive motors and their encoder cables, then label both ends of every cable and write a port map.
  3. 3Add strain relief and route the cables away from wheels and sharp edges.
  4. 4Power on, connect the Driver Station and create a configuration with the four motor names.
  5. 5Run the wheel test OpMode and record which wheel moves, its direction and whether its encoder count changes.
Deliverable: A powered robot whose four wheels each spin on command, plus a notebook page with a wiring photo, the port map, the configuration names and a troubleshooting log of any problems you fixed.

Knowledge check

Answer every question, then check your answers.

  1. Q1When should the battery be plugged in during the wiring workshop?
  2. Q2Your code stops with an error that it cannot find a device named frontleft. What is the most likely cause?
  3. Q3What is the purpose of strain relief on a cable?
  4. Q4A battery feels very hot and its case looks swollen. What should you do?

Further resources

Mark lesson complete