Mini-Project 4: A Switchable Channel for Lights and Vision
The REV PDH (REV-11-1850) has one special switchable low-current channel (15A continuous) that you can turn on and off from code. This is perfect for things that should not always be live: addressable LED strips for signaling, a cooling fan, or a Limelight/camera that you want to power-cycle without re-deploying. (The CTRE PDP does not expose a software-switchable channel; on a PDP you would use a separate relay/switch.)
Wiring: Run the load’s positive lead from the PDH’s switchable channel output (clearly silk-screened on the board) and the negative to any PD negative WAGO. Use 18 AWG for a sub-5A load like an LED strip and respect the 15A channel ceiling. As a low-current channel it must be protected per R620 with an ATM/APM-style mini blade fuse rated 15A or lower (PDH channels can alternatively use an ATC/ATO fuse rated 10A or lower, since that R620 option is available for all PD types, not just one specific PD).
Code it (WPILib):
PowerDistribution pdh = new PowerDistribution(1, ModuleType.kRev);
// Turn the channel on (e.g. when a game piece is acquired)pdh.setSwitchableChannel(true);
// Turn it off (e.g. when empty)pdh.setSwitchableChannel(false);A real example: a status light tied to robot state.
@Override public void robotPeriodic() { boolean haveGamePiece = intakeSensor.get(); pdh.setSwitchableChannel(haveGamePiece);}Now an LED strip on the switchable channel lights up the instant the intake sensor sees a game piece, giving the driver and human player a clear visual cue from across the field, with zero extra relays.
A power-cycle helper for a flaky camera:
public void rebootCamera() { pdh.setSwitchableChannel(false); // re-enable 2 seconds later via a Command new edu.wpi.first.wpilibj2.command.WaitCommand(2.0) .andThen(() -> pdh.setSwitchableChannel(true)) .schedule();}Gotchas:
- Treat the switchable channel as OFF until your code drives it true. If your light or camera never comes on, you probably never called
setSwitchableChannel(true). - Do not put anything safety-critical (radio, roboRIO, RSL) on a switchable channel. The radio and roboRIO should be powered through the PD’s dedicated fused outputs, never through a switched path.
- Confirm the channel actually toggles by watching the load and by reading current draw on the dashboard from Mini-Project 3.
This tiny project teaches a powerful pattern: hardware behavior driven directly by robot state, with no extra wiring beyond a single switched lead.
Key takeaways
Section titled “Key takeaways”- The PDH has exactly one software-controllable switchable channel (15A continuous); the PDP has no software-switchable channel.
- pdh.setSwitchableChannel(true/false) toggles it from code.
- Never put the radio, roboRIO, or RSL on a switchable channel; reserve it for LEDs, fans, or cameras you want to power-cycle.
This lesson was adapted from learnfrc.com.
