Beyond yes/no switches, two analog quantities are extremely useful: distance and electrical current.
Distance sensors#
FRC teams most often use time-of-flight (ToF) laser sensors, which fire an invisible Class 1 laser and time the reflection to measure absolute distance fairly independently of target color or reflectance.
- The REV 2m Distance Sensor (part REV-31-1505) is based on the ST VL53L0X ToF module. It reports distance over I2C (address 0x52) with a measurement range of roughly 5 cm to 200 cm (2 m) at millimeter resolution. It ships with a 4-pin JST-PH cable.
- The Playing With Fusion Time-of-Flight sensor (SEN-36005) is built on the newer ST VL53L1X and communicates over the CAN bus (1 Mbit). It supports up to 254 configurable CAN IDs so you can chain several on one bus, and ranges about 1.4 m in short mode and up to ~4 m in long mode depending on lighting.
Uses include detecting how far a robot is from a wall before scoring, sensing a game piece inside a mechanism, or measuring elevator height as a sanity check against the encoder.
Key limitation: ToF sensors have a measurement cone and a maximum sample rate that drops with ambient light, so they are best for short, well-defined gaps, not long open-field ranging.
Current sensing#
Every channel on the REV Power Distribution Hub (PDH) and the older CTRE Power Distribution Panel (PDP) measures the current flowing through it, reported over CAN via WPILib's PowerDistribution class. Modern smart motor controllers (Talon FX, Spark MAX/Flex) also report their motor output current over CAN.
Why current is a sensor:
- Stall / contact detection: When an intake grabs a game piece or an arm hits a hard stop, current spikes. You can detect a successful intake by watching for a current threshold instead of adding a beam break.
- Brownout protection: Watching total current helps you stay under the limits that cause the roboRIO to brown out and reset.
- Mechanism health: Abnormally high steady-state current can warn of a jam or binding.
PowerDistribution pdh = new PowerDistribution(1, ModuleType.kRev);
double intakeAmps = pdh.getCurrent(5); // channel 5
if (intakeAmps > 30.0) { /* probably have a game piece */ }
Current-based detection is cheap (no extra hardware) but noisy, so filter it (a moving average or WPILib LinearFilter) and require the threshold to persist for several loops before acting.
the part worth keeping
Key takeaways
- Time-of-flight sensors give absolute distance: the REV 2m sensor (VL53L0X, I2C, ~2 m) and the Playing With Fusion SEN-36005 (VL53L1X, CAN, ~1.4 m short / ~4 m long).
- The REV PDH and CTRE PDP report per-channel current over CAN; smart motor controllers report motor current.
- Motor current spikes can detect intakes, stalls, and jams without extra sensors — but filter it before acting.
Programming, Controls & SensorsSensing Fundamentals: Digital, Analog, and CAN Inputslesson 3 of 3
Keep going
Take the quiz+10 XP with an accountMore in Sensing Fundamentals: Digital, Analog, and CAN Inputs
where 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
- revrobotics.comREV 2m Distance Sensor (REV-31-1505)
- playingwithfusion.comPlaying With Fusion: CAN ToF sensor (SEN-36005)
- docs.wpilib.orgWPILib: Power Distribution module
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.
- 17 min readFRC Sensors Explained: Encoders, Gyros, Beam Breaks, and Limit SwitchesA practical FRC guide to encoders (quadrature, absolute, CANcoder, through-bore), gyros (NavX2, Pigeon 2.0), limit switches, beam breaks, and current sensing./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
- 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
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
01The REV 2m Distance Sensor (VL53L0X) is a time-of-flight laser rangefinder. How does it report its distance reading to the roboRIO?
02The Playing With Fusion Time-of-Flight sensor (SEN-36005, VL53L1X) differs from the REV 2m sensor in how it connects. Which interface does it use?
03How can a team measure the current drawn by an individual motor channel on a REV PDH or CTRE PDP?
Answer every question to submit.
All 51 lessons in Programming, Controls & Sensorsopenclose
01 / prerequisites
02 / foundations-tools-and-first-program
03 / robot-program-and-command-based
04 / motors-and-control
05 / autonomous-trajectories-simulation
06 / sensing-fundamentals
07 / encoders
08 / gyros-imus-orientation
09 / closed-loop-control
10 / vision-pose-estimation
11 / worked-examples-mini-projects
- Not read yet:Mini-Project: A Closed-Loop Elevator with Motion Magic
- Not read yet:Mini-Project: A Velocity-Controlled Shooter on REVLib
- Not read yet:Mini-Project: A Teleop Swerve Drive Subsystem
- Not read yet:Mini-Project: An Autonomous Routine with PathPlanner
- Not read yet:Mini-Project: Vision-Aligned Scoring with Limelight
12 / common-mistakes-troubleshooting
13 / advanced-techniques-case-studies
- Not read yet:State-Space Control and Kalman Filtering
- Not read yet:Log Replay Architecture with AdvantageKit
- Not read yet:Advanced Pose Estimation: Multi-Tag Fusion and Standard Deviations
- Not read yet:Robot Coordination, Alerts, and Operator Feedback
- Not read yet:Case Study: Hardening Software Before an Event