> For the complete documentation index, see [llms.txt](https://wiki.purduesigbots.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.purduesigbots.com/vex-electronics/vex-sensors/smart-port-sensors/rotation-sensor.md).

# Rotation Sensor

![V5 Rotation Sensor](/files/fAVMkMzZZkwOBj8l6Z9g)

### Functionality

The <img src="/files/kdNW4UqPk9goMcFBXQ73" alt="" data-size="line"> **V5 Rotation Sensor** is an smart sensor to determine the angle bound by \[0,36000) and the position in centidegrees, as well as the angular velocity in centidegrees / second.  The sensor connects to the [V5 Brain](/vex-electronics/vex-electronics/vex-v5-brain.md) through a smart port, and functions similarly to a[ encoder](/vex-electronics/vex-sensors/3-pin-adi-sensors/encoder.md) or [potentiometer](/vex-electronics/vex-sensors/3-pin-adi-sensors/potentiometer.md).&#x20;

### How it Works

The measurement component of the sensor is comprised of a Hall Effect sensor that measures the magnetic field of 2 magnets to track the absolute angle (\[0,36000)) of the rotation sensor. The angle resets every full rotation of the rotation sensor. A chip inside the rotation sensor (a Cortex M0+) then keeps track of the total rotations which acts as the relative position measurement, which does not reset every rotation.

Since the rotation sensor angle ([get\_angle](https://pros.cs.purdue.edu/v5/pros-4/group__cpp-rotation.html#gac675e49bc52b4b25ce2351742b69b6cb)) is absolute, as it's based on the magnetic field generated, the angular position of the shaft will not reset when it loses power. However, since the chip loses power the position ([get\_position](https://pros.cs.purdue.edu/v5/pros-4/group__cpp-rotation.html#ga28a657dab4a1609b0bddc8ba0c345b57)), which is relative, of the rotation sensor is not tracked and it resets to zero every time the sensor is turned on.

#### Teams/Individuals Contributed to this Article:

* Alyssa Agarie (Former VEX Competitor)
* [BLRS](https://purduesigbots.com/) (Purdue SIGBots)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wiki.purduesigbots.com/vex-electronics/vex-sensors/smart-port-sensors/rotation-sensor.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
