# V1 Specifications & Examples

## General Specifications&#x20;

| Parameter Description | Parameter                              |
| --------------------- | -------------------------------------- |
| Sensor Type           | I2C                                    |
| I2C Address           | 0x39                                   |
| Sensor Part           | TMD37821                               |
| Measurement Channels  | Red, Green, Blue, Alpha, and Proximity |

### Electrical Specifications

<table data-header-hidden><thead><tr><th width="241">Parameter</th><th align="center">Min</th><th align="center">Typ</th><th align="center">Max</th><th align="center">Units </th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td align="center"><strong>Min</strong></td><td align="center"><strong>Typ</strong></td><td align="center"><strong>Max</strong></td><td align="center"><strong>Units</strong> </td></tr><tr><td>Operating Voltage Range</td><td align="center">-</td><td align="center">-</td><td align="center">3.3</td><td align="center">V</td></tr><tr><td>Proximity Sensor Range</td><td align="center">5</td><td align="center">-</td><td align="center">25</td><td align="center">cm</td></tr></tbody></table>

## Mechanical Drawings

{% hint style="info" %}
All dimensions are in millimeters.
{% endhint %}

<figure><img src="/files/hoTc6nAw8uAT8NlWZ4yF" alt=""><figcaption></figcaption></figure>

## Pinout&#x20;

<figure><img src="/files/xfS1UQn2r9TCRllontHO" alt=""><figcaption></figcaption></figure>

## Application Examples

### Application Information <a href="#application-information" id="application-information"></a>

The REV Robotics Color Sensor has two sensing elements, proximity and color.

Proximity measurements are based on IR reflectance and can vary depending on lighting conditions and target reflectivity.

Color measurements consist of Red, Green, Blue, and Alpha (clear) values. The white LED on the sensor has a slide switch to turn the LED on or off. Unlit targets are best illuminated with the build-in LED while bright or light-emitting targets may not require the build-in LED. Color data is best collected within 2cm of the target for the strongest color differentiation.

### FTC Application&#x20;

#### Configuring for the Control System

When working with the Color Sensor V1 configure your robot to use the "REV Color/Range Sensor" as shown in the image below. &#x20;

<figure><img src="/files/hcVvfnOq1LeacGGJBR09" alt=""><figcaption></figcaption></figure>

In this example, the Color Sensor V1 is configured on I2C bus 2. The Color Sensor V1 can be configured on any of the I2C busses.

{% hint style="info" %}
Recall that I2C sensors must have different addresses in order to operate on the same bus.&#x20;
{% endhint %}

#### Programming Example&#x20;

This program shows the values from the Color Sensor on your phone. Your team will need to figure out the logic to use this information in your program. Below there are three examples of different color modes and their readings. Light Detected mode will read the amount of light on the sensor from 0-1.0. Because the sensor is close to a surface, the LED in the sensor reads 1.0 in the examples.

{% tabs %}
{% tab title="OnBot Java" %}
{% hint style="info" %}
The code assumes that the Color Sensor was configured with the name “Color.”
{% endhint %}

```java
package org.firstinspires.ftc.teamcode;
 
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.ColorSensor;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
 
@TeleOp
public class TestColorSensor extends LinearOpMode {
    // Define a variable for our color sensor
    ColorSensor color;
    
    @Override
    public void runOpMode() {
        // Get the color sensor from hardwareMap
        color = hardwareMap.get(ColorSensor.class, "Color");
        
        // Wait for the Play button to be pressed
        waitForStart();
 
        // While the Op Mode is running, update the telemetry values.
        while (opModeIsActive()) {
            telemetry.addData("Red", color.red());
            telemetry.addData("Green", color.green());
            telemetry.addData("Blue", color.blue());
            telemetry.update();
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Additional Resources

Additional information about the TMD37821, its capabilities, and its features can be found in the following datasheet:

* [TMD37821 Datasheet](http://www.revrobotics.com/content/docs/TMD3782_v2.pdf)


---

# 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.revrobotics.com/rev-crossover-products/sensors/color-sensor/discontinued/v1.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.
