![]() |
The Gyro Sensor detects rotational motion. If you rotate the Gyro Sensor in the direction of the arrows on the case of the sensor, the sensor can detect the rate of rotation in degrees per second. You can use the rotation rate to detect, for example, when a part of your robot is turning, or when your robot is falling over. In addition, the Gyro Sensor keeps track of the total rotation angle in degrees. You can use this rotation angle to detect, for example, how far your robot has turned. |
| Data | Type | Notes |
|---|---|---|
| Angle | Numeric | Rotation angle in degrees. Measured from the last reset. Reset with the Reset mode of the Gyro Sensor block. |
| Rate | Numeric | Rotation rate in degrees per second. |
| • | The Gyro Sensor can only detect motion around a single axis of rotation. This direction is indicated by the arrows on the case of the sensor. Make sure you attach the sensor to your robot in the correct orientation to measure rotation in the desired direction. |
| • | The Angle and Rate can both be either positive or negative. Clockwise rotation is positive and counter-clockwise is negative. |
| • | When connecting the Gyro Sensor to your EV3 Brick, you must hold it completely still in order to minimize “drifting” |
| • | The Angle may “drift” over time and become less accurate. For best results, reset the angle using the Reset mode of the Gyro Sensor block before every motion that you want to measure the angle of. |
| • | The Motor Rotation sensor can also measure rotation in degrees, but only for the rotating part of a motor. |


| Block | Mode | Use |
|---|---|---|
| Wait | Gyro Sensor - Compare | Wait for the rotation angle or rate to reach a certain value. |
| Wait | Gyro Sensor - Change | Wait for the rotation angle or rate to change by a certain amount. |
| Loop | Gyro Sensor | Repeat a sequence of blocks until the rotation angle or rate reaches a certain value. |
| Switch | Gyro Sensor | Choose between two sequences of blocks based on the rotation angle or rate. |
| Gyro Sensor | Measure | Measure the rotation angle and/or rate, and get the result on a Numeric data wire. |
| Gyro Sensor | Compare | Compare the rotation angle or rate to a threshold, and get the result on a Logic data wire. |
| Gyro Sensor | Reset | Reset the rotation angle to zero. |
| Data Logging | Gyro Angle Gyro Rate | See Data Logging. |