# CAN Lidar (am-5684)

### Overview <a href="#overview" id="overview"></a>

The AndyMark Lidar Sensor is a compact, 3.3V CAN device that reports **distance measurements, measurement status, and signal quality data (signal strength and ambient light levels)**. It’s designed for easy integration on robots and test rigs where you need reliable, real-time distance detection.

Use this page to understand what the sensor is good for and how to get started.\
Detailed electrical limits, pinout, and mechanical drawings live on **Specifications**.\
Programming walk-throughs and Java/C++ samples live on **Examples**.

***

#### When to use this sensor <a href="#when-to-use-this-sensor" id="when-to-use-this-sensor"></a>

* Detecting the **distance to objects on the field** (game pieces, walls, targets, tape lines).
* **Precision positioning** (aligning to scoring locations, walls, or field elements).
* **Presence / approach detection** (e.g., “object is entering the intake”).
* Monitoring **distance changes over time** (detect motion, confirm mechanisms are working).
* Evaluating **signal quality** to determine if a reading is reliable in real-world conditions.

***

#### What this sensor is not <a href="#what-this-sensor-is-not" id="what-this-sensor-is-not"></a>

* It’s not a camera or vision system; it provides a **single distance measurement**, not images or object identification.
* It’s not guaranteed to work equally well on all surfaces (very dark, reflective, or angled targets may reduce performance).

***

#### Highlights (at a glance) <a href="#highlights-at-a-glance" id="highlights-at-a-glance"></a>

* Time-of-Flight (ToF) based **distance measurement sensor**
* Reports:
  * Distance (mm)
  * Measurement status (valid / error conditions)
  * Signal strength and ambient light (for validation)
* Standard FRC **CAN interface**
* Tunable performance:
  * Distance mode (Short / Medium / Long)
  * Timing budget (speed vs accuracy)
  * Signal thresholds and ROI
* Works with common 3.3 V robot controllers and microcontrollers
* Keyed 4-pin header for simple wiring (see Specifications → Wiring for pin order)
* Example code provided for fast bring-up (see Examples)

***

#### Typical integrations <a href="#typical-integrations" id="typical-integrations"></a>

* Mount on a drivetrain or mechanism for **auto-alignment to field elements**
* Place near an intake to **detect when a game piece is acquired**
* Use for **distance-based triggers** (e.g., stop intake when object detected)
* Install on elevators or arms to **measure position relative to a surface**
* Use in autonomous routines for **precise stopping distance control**

***

#### Best-practice tips <a href="#best-practice-tips" id="best-practice-tips"></a>

**Tune for your application:**

* Increase timing budget for more stable readings
* Lower minimum signal rate to allow longer-distance detection
* Adjust ROI to focus on a specific target area

**Validate your readings:**

* Always check **Status**
* Use signal strength and ambient values to confirm reliability (see Validation section)

**Mind your target surface:**

* Flat, light-colored surfaces give the best results
* Dark or angled surfaces may reduce signal strength

**Control the environment:**

* Avoid direct exposure to bright lights when possible
* Be aware that sunlight and reflective materials can affect readings

**Test at real distances:**

* Use a tape measure to verify accuracy during setup
* Validate performance at the exact distances your robot will use

**Re-check at events:**

* Field conditions (lighting, materials) can change performance
* Do a quick validation before matches

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.andymark.com/frc-electronics/can-sensors/can-lidar-am-5684.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
