en:iot-open:hardware2:sensors_angle
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:hardware2:sensors_angle [2023/08/25 12:21] – external edit (Unknown date) 127.0.0.1 | en:iot-open:hardware2:sensors_angle [2024/05/23 22:44] (current) – pczekalski | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Angle & Orientation Sensors ==== | + | ====== Angle & Orientation Sensors ====== |
| + | {{: | ||
| + | == The Inertial Measurement Unit (IMU) == | ||
| - | ===Potentiometer=== | + | An IMU is an electronic device |
| - | A potentiometer is a type of resistor, the resistance of which can be adjusted using a mechanical lever. The device consists of three terminals. The resistor between the first and the third terminal has a fixed value, but the second terminal is connected to the lever. Whenever the lever is turned, a slider of the resistor is moved; it changes the resistance between the second terminal and side terminals. Variable resistance causes the change of the voltage, which can be measured to determine the position of the lever. Thus, the potentiometer output is an analogue value. | + | |
| - | + | ||
| - | Potentiometers are commonly used as a control level, for example, a volume level for the sound and joystick position. They can also be used to determine the angle in feedback loops with motors, such as servo motors. | + | |
| - | + | ||
| - | <figure label> | + | |
| - | {{ : | + | |
| - | < | + | |
| - | </ | + | |
| - | + | ||
| - | <figure label> | + | |
| - | {{ : | + | |
| - | < | + | |
| - | </ | + | |
| - | + | ||
| - | <figure label> | + | |
| - | {{ : | + | |
| - | < | + | |
| - | </ | + | |
| - | + | ||
| - | An example code: | + | |
| - | <code c> | + | |
| - | + | ||
| - | // | + | |
| - | int potentioPin = A0; | + | |
| - | //The analogue reading from the potentiometer output | + | |
| - | int potentioReading; | + | |
| - | + | ||
| - | void setup(void) { | + | |
| - | //Begin serial communication | + | |
| - | Serial.begin(9600); | + | |
| - | // | + | |
| - | pinMode(potentioPin, | + | |
| - | } | + | |
| - | + | ||
| - | void loop(void) { | + | |
| - | //Read the analogue value of the potentiometer sensor | + | |
| - | potentioReading = analogRead(potentioPin); | + | |
| - | Serial.print(" | + | |
| - | Serial.println(potentioReading); | + | |
| - | delay(10); | + | |
| - | } | + | |
| - | </ | + | |
| - | + | ||
| - | ===The Inertial Measurement Unit (IMU)=== | + | |
| - | + | ||
| - | An IMU is an electronic device | + | |
| * moving forward/ | * moving forward/ | ||
| * moving left/right, | * moving left/right, | ||
| Line 56: | Line 12: | ||
| * yaw left and right. | * yaw left and right. | ||
| - | A **gyroscope** is a sensor that measures the angular velocity. | + | A **gyroscope** is a sensor that measures the angular velocity. |
| Gyroscope sensors are used in aviation, navigation and motion control. | Gyroscope sensors are used in aviation, navigation and motion control. | ||
| - | An **accelerometer** measures the acceleration of the object. The sensor uses microelectromechanical system (MEMS) technology, where capacitive plates are attached to springs. When acceleration force is applied to the plates, the capacitance is changed; thus, it can be measured. Accelerometers can have 1 to 3 axis. The 3-axis accelerometer can detect the device' | + | An **accelerometer** measures the acceleration of the object. The sensor uses microelectromechanical system (MEMS) technology, where capacitive plates are attached to springs. When acceleration force is applied to the plates, the capacitance is changed; thus, it can be measured. Accelerometers can have 1 to 3 axes. The 3-axis accelerometer can detect the device' |
| - | Accelerometers | + | Accelerometers measure objects' |
| A **magnetometer** is a sensor that can measure the device' | A **magnetometer** is a sensor that can measure the device' | ||
| - | There are different | + | Different |
| + | \\ The latter automatically calculates additional information like gravity vector and absolute orientation expressed as an Euler vector or a quaternion. The sample connection circuit for the BNO055 sensor is present in figure {{ref> | ||
| - | < | + | < |
| - | < | + | {{ : |
| - | {{ : | + | |
| < | < | ||
| </ | </ | ||
| - | < | + | < |
| - | < | + | {{ : |
| - | {{ : | + | |
| < | < | ||
| </ | </ | ||
| - | < | + | < |
| {{ : | {{ : | ||
| < | < | ||
| </ | </ | ||
| - | < | + | < |
| {{ : | {{ : | ||
| < | < | ||
| Line 100: | Line 55: | ||
| void setup(void) | void setup(void) | ||
| { | { | ||
| - | bno.setExtCrystalUse(true); | + | |
| } | } | ||
| void loop(void) | void loop(void) | ||
| { | { | ||
| - | //Read sensor data | + | |
| - | sensors_event_t event; | + | sensors_event_t event; |
| - | bno.getEvent(& | + | bno.getEvent(& |
| - | //Print X, Y And Z orientation | + | //Print X, Y And Z orientation |
| - | Serial.print(" | + | Serial.print(" |
| - | Serial.print(event.orientation.x, | + | Serial.print(event.orientation.x, |
| - | Serial.print(" | + | Serial.print(" |
| - | Serial.print(event.orientation.y, | + | Serial.print(event.orientation.y, |
| - | Serial.print(" | + | Serial.print(" |
| - | Serial.print(event.orientation.z, | + | Serial.print(event.orientation.z, |
| - | Serial.println("" | + | Serial.println("" |
| - | delay(100); | + | delay(100); |
| } | } | ||
| </ | </ | ||
| + | |||
| + | <note important> | ||
| + | <note important> | ||
en/iot-open/hardware2/sensors_angle.1692955268.txt.gz · Last modified: by 127.0.0.1
