Difference between revisions of "Team3 imu"

From Sketching with Hardware at LMU Wiki
Jump to navigation Jump to search
(Created page with "test")
 
 
Line 1: Line 1:
test
+
= '''WT901B | AHRS IMU Sensor''' =
 +
 
 +
With the WT901B IMU sensor device one can detect acceleration, angle, angular velocity, magnetic filed and air pressure. The both robust and small product is perfectly suitable for smartwatches.
 +
 
 +
 
 +
== Product Features ==
 +
=== Built-in sensors ===
 +
[[File:Accelerometer.png|50px|Accelerometer]]
 +
Accelerometer: Acceleration X Y Z, 3-axis
 +
 
 +
 
 +
[[File:Gyroscope.png|50px|Gyroscope]]
 +
Gyroscope: Angular Velocity X Y Z, 3-axis
 +
 
 +
 
 +
[[File:Magnetometer.png|50px|Magnetometer]]
 +
Magnetometer: Magnetic Field X Y Z, 3-axis
 +
 
 +
 
 +
[[File:Barometer.png|50px|Barometer]]
 +
Barometer: Air Pressure 1-Axis
 +
 
 +
 
 +
=== Board Dimensions ===
 +
[[File:BoardSize.png|100px|WT901B Size]]
 +
Size: 15mm x 15mm x 2mm, Weight: 1g
 +
 
 +
Tolerance Size & Weight: +/- 0.1
 +
 
 +
=== Board Pin Definition ===
 +
[[File:BoardPinDefinition.png|300px|WT901B Pin Definition]]
 +
* VCC: 3.3-5V input supply
 +
* RX: Serial data input, TTL interface
 +
* TX: Serial data output, TTL interface
 +
* GND: Ground
 +
* DO: Analog input, digital input and output, PWM
 +
* D1: Analog input, digital input and output, PWM, connect GPS
 +
* D2: Analog input, digital input and output, PWM
 +
* D3: Analog input, digital input and output, PWM
 +
* SDA: I2C signal line
 +
* SCL: I2C clock line
 +
 
 +
 
 +
 
 +
== How to get it to work ==
 +
=== Connecting to an ESP32 ===
 +
We need to connect the four pins VCC, RX, TX and GND of the WT901B to the corresponding pins of the ESP32. Therefore, we need to connect WT901B …
 +
* ...VCC to the power supply (3-5V works) of our microcontroller’s 3.3V pin
 +
* ...GND to one of the GND pins on our microcontroller
 +
* ...TX to one of the corresponding pins on our microcontroller
 +
* ...RX to one of the corresponding pins on our microcontroller
 +
 
 +
'''[https://joy-it.net/files/files/Produkte/SBC-NodeMCU-ESP32/SBC-NodeMCU-ESP32-Anleitung-2021-06-29.pdf Pin-Out Joy-it NodeMCU-ESP32 ]'''
 +
 
 +
=== Required Library ===
 +
* Download and save JY901.h:
 +
** Go to: '''[https://drive.google.com/drive/folders/1F2oTeQccvxNKxq6nW6isxhYecPMagr8M]'''
 +
** Download Sample Code zip folder
 +
** Unzip the folder and navigate to Arduino > Arduino > JY901SerialMega2560
 +
** Add folder with files to the library folder of your project
 +
* import library in your main file: #include <JY901.h>
 +
 
 +
=== Code Example ===
 +
<syntaxhighlight lang="python" line='line'>
 +
 
 +
#include <Arduino.h>
 +
#include <Wire.h>
 +
#include <JY901.h>
 +
 
 +
void setup() {
 +
  Serial.begin(115200);
 +
  JY901.StartIIC();
 +
}
 +
void loop() {
 +
 
 +
  //print received data. Data was received in serialEvent;     
 +
  JY901.GetAcc();
 +
  Serial.print((float)JY901.stcAcc.a[0]/32768*16);
 +
 
 +
  JY901.GetGyro(); 
 +
  Serial.print((float)JY901.stcGyro.w[0]/32768*2000);
 +
 
 +
  JY901.GetAngle();
 +
  Serial.print((float)JY901.stcAngle.Angle[0]/32768*180);
 +
 
 +
  JY901.GetMag();
 +
  Serial.print(JY901.stcMag.h[0]);
 +
}
 +
</syntaxhighlight>
 +
 
 +
For more Code Examples, use the drive folder provided by WITMOTION: '''[https://drive.google.com/drive/folders/1F2oTeQccvxNKxq6nW6isxhYecPMagr8M]'''
 +
 
 +
 
 +
== Instructional Video ==
 +
Please insert video from uni2work
 +
 
 +
== Additional links ==
 +
==== Official GitHub Page Witmotion ====
 +
https://github.com/WITMOTION/
 +
==== Official GitHub Page Witmotion WT901B Sensor ====
 +
https://github.com/WITMOTION/WT901B
 +
==== Datasheet ====
 +
https://raw.githubusercontent.com/WITMOTION/WT901B/master/WT901B%20Datasheet.pdf
 +
==== Manual ====
 +
https://raw.githubusercontent.com/WITMOTION/WT901B/master/WT901B%20Manual.pdf
 +
==== Official Google Drive Folder ====
 +
https://drive.google.com/drive/folders/1F2oTeQccvxNKxq6nW6isxhYecPMagr8M
 +
==== Sources of the Pictures ====
 +
All the pictures where taken from the official WT901B Datasheet by WITMOTION.

Latest revision as of 11:02, 17 October 2022

WT901B | AHRS IMU Sensor[edit]

With the WT901B IMU sensor device one can detect acceleration, angle, angular velocity, magnetic filed and air pressure. The both robust and small product is perfectly suitable for smartwatches.


Product Features[edit]

Built-in sensors[edit]

Accelerometer Accelerometer: Acceleration X Y Z, 3-axis


Gyroscope Gyroscope: Angular Velocity X Y Z, 3-axis


Magnetometer Magnetometer: Magnetic Field X Y Z, 3-axis


Barometer Barometer: Air Pressure 1-Axis


Board Dimensions[edit]

WT901B Size Size: 15mm x 15mm x 2mm, Weight: 1g

Tolerance Size & Weight: +/- 0.1

Board Pin Definition[edit]

WT901B Pin Definition

  • VCC: 3.3-5V input supply
  • RX: Serial data input, TTL interface
  • TX: Serial data output, TTL interface
  • GND: Ground
  • DO: Analog input, digital input and output, PWM
  • D1: Analog input, digital input and output, PWM, connect GPS
  • D2: Analog input, digital input and output, PWM
  • D3: Analog input, digital input and output, PWM
  • SDA: I2C signal line
  • SCL: I2C clock line


How to get it to work[edit]

Connecting to an ESP32[edit]

We need to connect the four pins VCC, RX, TX and GND of the WT901B to the corresponding pins of the ESP32. Therefore, we need to connect WT901B …

  • ...VCC to the power supply (3-5V works) of our microcontroller’s 3.3V pin
  • ...GND to one of the GND pins on our microcontroller
  • ...TX to one of the corresponding pins on our microcontroller
  • ...RX to one of the corresponding pins on our microcontroller

Pin-Out Joy-it NodeMCU-ESP32

Required Library[edit]

  • Download and save JY901.h:
    • Go to: [1]
    • Download Sample Code zip folder
    • Unzip the folder and navigate to Arduino > Arduino > JY901SerialMega2560
    • Add folder with files to the library folder of your project
  • import library in your main file: #include <JY901.h>

Code Example[edit]

 1 #include <Arduino.h>
 2 #include <Wire.h>
 3 #include <JY901.h>
 4 
 5 void setup() {
 6   Serial.begin(115200);
 7   JY901.StartIIC();
 8 }
 9 void loop() {
10   
11   //print received data. Data was received in serialEvent;       
12   JY901.GetAcc();
13   Serial.print((float)JY901.stcAcc.a[0]/32768*16);
14   
15   JY901.GetGyro();  
16   Serial.print((float)JY901.stcGyro.w[0]/32768*2000);
17   
18   JY901.GetAngle();
19   Serial.print((float)JY901.stcAngle.Angle[0]/32768*180);
20   
21   JY901.GetMag();
22   Serial.print(JY901.stcMag.h[0]);
23 }

For more Code Examples, use the drive folder provided by WITMOTION: [2]


Instructional Video[edit]

Please insert video from uni2work

Additional links[edit]

Official GitHub Page Witmotion[edit]

https://github.com/WITMOTION/

Official GitHub Page Witmotion WT901B Sensor[edit]

https://github.com/WITMOTION/WT901B

Datasheet[edit]

https://raw.githubusercontent.com/WITMOTION/WT901B/master/WT901B%20Datasheet.pdf

Manual[edit]

https://raw.githubusercontent.com/WITMOTION/WT901B/master/WT901B%20Manual.pdf

Official Google Drive Folder[edit]

https://drive.google.com/drive/folders/1F2oTeQccvxNKxq6nW6isxhYecPMagr8M

Sources of the Pictures[edit]

All the pictures where taken from the official WT901B Datasheet by WITMOTION.