Both the CTRE PDP and the REV PDH log current per channel and report battery voltage over CAN. WPILib exposes all of it through the PowerDistribution class, so you can build a real dashboard that tells your drive team exactly where the amps are going. This is how you catch a stalling intake or a failing battery before it costs you a match.
Construct the object for your hardware:
import edu.wpi.first.wpilibj.PowerDistribution;
import edu.wpi.first.wpilibj.PowerDistribution.ModuleType;
// REV PDH default CAN ID is 1
PowerDistribution pdh = new PowerDistribution(1, ModuleType.kRev);
// CTRE PDP default CAN ID is 0
// PowerDistribution pdp = new PowerDistribution(0, ModuleType.kCTRE);
Read and publish metrics each loop:
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
@Override public void robotPeriodic() {
SmartDashboard.putNumber("Battery Voltage", pdh.getVoltage());
SmartDashboard.putNumber("Total Current (A)", pdh.getTotalCurrent());
// getTotalPower(), getTotalEnergy() and getTemperature() are CTRE PDP only.
// WPILib returns 0 for all three on the REV PDH, so there is nothing to publish.
// Per-channel current, e.g. the four drive motors on channels 0-3
for (int ch = 0; ch < 4; ch++) {
SmartDashboard.putNumber("Drive Ch " + ch + " (A)", pdh.getCurrent(ch));
}
}
A practical brownout warning widget:
if (pdh.getVoltage() < 7.5) {
SmartDashboard.putBoolean("LOW VOLTAGE", true);
}
if (edu.wpi.first.wpilibj.RobotController.isBrownedOut()) {
// A brownout already happened this loop
DataLogManager.log("BROWNOUT at " + Timer.getFPGATimestamp());
}
The brownout cutoff is 6.3V on the roboRIO 1 and 6.75V by default on the roboRIO 2, so a 7.5V warning gives the driver a meaningful heads-up before outputs actually cut. (7.5V is also the voltage the roboRIO must climb back above to exit brownout.)
Known PDH quirk to design around: the REV PDH's four low-current-class channels (20-23) have a documented firmware bug where current readings above 15.9375A wrap back toward 0A (so 20A reads as roughly 4A). Readings below 15.9375A are accurate. Keep anything you actually want to current-monitor on the 40A high-current channels (0-19), and treat low-current channel readings above ~16A as unreliable.
Graph total current against time during a practice match. A healthy battery holds voltage; one that sags to 9-10V under a 150A draw is on its way out and belongs on the test bench, not in the next match.
the part worth keeping
Key takeaways
- PowerDistribution(1, ModuleType.kRev) for the PDH or (0, ModuleType.kCTRE) for the PDP gives per-channel and total telemetry over CAN.
- Surface a 7.5V low-voltage warning so the driver reacts before the 6.3V/6.75V brownout cutoff (7.5V is also the brownout-recovery threshold).
- PDH low-current channels 20-23 mis-report current above 15.9375A (wraps toward 0A); keep monitored loads on the 40A channels.
Electrical & WiringWorked Examples & Mini-Projectslesson 3 of 5
Keep going
Take the quiz+10 XP with an accountwhere this came from
Sources and corrections
This lesson is AI-assisted: drafted from primary sources, then reviewed and edited by hand. Errors still get through. When one is reported we fix it and write down what changed, in public, in the corrections log.
sources and further reading
- docs.wpilib.orgWPILib: Power Distribution Module software
- docs.revrobotics.comREV: Power Distribution Hub Troubleshooting (low-current channel bug)
- docs.wpilib.orgWPILib: roboRIO Brownouts
clipped to this lesson
Articles that go further on this
The lesson gets you through the topic. These go wider on it, and they read in one sitting.
- 19 min readFRC PDH: The Power Distribution Hub Explained (Channels, Fuses & Wiring)A complete guide to the REV PDH (Power Distribution Hub): all 24 channels, breaker and fuse sizing, clean wiring, the switchable channel, CAN telemetry, and PDH vs PDP./blogread it
- 7 min readFRC Brownout: Why Your Robot Goes Limp and How to Actually Fix ItThe exact roboRIO brownout voltage stages, how to spot one in the Driver Station log, and the fixes ranked by payoff: current limits, battery health, gearing, and compressor scheduling./blogread it
- 20 min readREV Robotics for FRC: NEO Motors, Spark MAX/Flex, PDH & MAXSwerveA practical guide to the REV Robotics FRC ecosystem: NEO, NEO Vortex and NEO 550 motors, Spark MAX and Spark Flex controllers, the PDH, and MAXSwerve./blogread it
answer sheet
Lesson quiz
All 3 right completes the lesson. Miss one and only that question comes back, anything you already answered correctly stays banked.
0 of 3 answered
01Which WPILib class is used to read live voltage, per-channel current, and temperature from a CTRE PDP or REV PDH over CAN for a power-monitoring dashboard?
02What are the default CAN IDs that WPILib's PowerDistribution uses for the CTRE PDP and the REV PDH, respectively?
03On a live dashboard, which PowerDistribution method gives you the current draw of one specific output channel?
Answer every question to submit.
All 35 lessons in Electrical & Wiringopenclose
01 / prerequisites
02 / control-system-components
03 / power-battery-breakers
04 / motor-controllers-can-bus
05 / connections-rules-troubleshooting
06 / worked-examples-mini-projects
- Not read yet:Mini-Project 1: A Single-Motor Test Stand from Battery to Spin
- Not read yet:Mini-Project 2: Current-Limited Drivetrain (CTRE and REV)
- Not read yet:Mini-Project 3: A Live Power-Monitoring Dashboard
- Not read yet:Mini-Project 4: A Switchable Channel for Lights and Vision
- Not read yet:Mini-Project 5: CAN Device Bring-Up with Tuner X and the Hardware Client
07 / common-mistakes-troubleshooting
08 / advanced-techniques-case-studies