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.
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
| Item | Why you need it |
|---|---|
| Charged 12 V robot battery and matching charger | Powers the robot; the charger must suit the battery type |
| Main power switch and battery adapter cable | Lets you turn the whole robot off quickly |
| Control Hub, Driver Station and a gamepad | The robot's brain, the drivers' screen and the controls |
| Motor power cables, encoder cables, servo extensions | Connect motors, encoders and servos to the hub |
| Zip ties, cable wrap, labels and a flush cutter | Secure, protect and identify every cable |
Build the power path
- 1Mount the batteryHold 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.
- 2Mount the main power switchFix 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.
- 3Mount the Control HubScrew 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.
- 4Connect the power cablesRun 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
- 1Pre-power checkWith 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.
- 2Power onPlug 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.
- 3Connect the Driver StationPair 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.
- 4Create a configurationOpen 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,backLeftandbackRight. Save it and make sure it is the active configuration. - 5Test one motor at a timeRun 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.
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}
Troubleshooting checklist
| Symptom | Check first | Usual fix |
|---|---|---|
| Nothing turns on | Battery charge, battery plug, main switch, power cable at the hub | Swap in a charged battery and reseat every power connector |
| Driver Station will not connect | Hub status light, Wi-Fi pairing, distance from hub | Restart the hub and Driver Station, then pair again following FTC Docs |
| Error that a device cannot be found | Spelling and capitals of the name, active configuration | Make the configuration name and the code name exactly the same |
| One wheel does not move | Port map, motor power plug, a jammed wheel | Reseat the plug, check it is on the right port, spin the wheel by hand |
| Wheel spins the wrong way | Which motors are reversed in code | Set the direction of that motor in code, not by swapping wires |
| Encoder count stays at 0 | Encoder cable on the matching port number | Reseat 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
- 1Mount the battery, main power switch and Control Hub, and connect the power path with the battery unplugged.
- 2Connect all four drive motors and their encoder cables, then label both ends of every cable and write a port map.
- 3Add strain relief and route the cables away from wheels and sharp edges.
- 4Power on, connect the Driver Station and create a configuration with the four motor names.
- 5Run the wheel test OpMode and record which wheel moves, its direction and whether its encoder count changes.
Knowledge check
Answer every question, then check your answers.
Further resources
- FTC DocsOfficial guides to the control system, Driver Station pairing and robot configurationftc-docs.firstinspires.org
- REV Robotics documentationControl Hub ports, status light meanings and battery informationdocs.revrobotics.com
- Game Manual 0 (community)Community advice on wire management and electronics reliabilitygm0.org