Interfacing of 3-Axis Gyroscope Sensor BMG160 With Arduino Nano : 5 Steps - caseyught1967
Introduction: Interfacing of 3-Axis Gyroscope Sensor BMG160 With Arduino Nano
In now's world, to a greater extent than half of the youth and kids are fond of gaming and all those World Health Organization are fond of it, fascinated by the method aspects of gaming knows the grandness of motion detection in this domain. We were also amazed by the assonant affair and just to bring it on the boards, we thought of working along a gyro sensor which rump measure the angular rate of any object. Then, the sensor we took up to consider with the task is BMG160. BMG160 is a 16-bit, digital, triaxial, gyro sensor which can measure up the angular rate in three perpendicular room dimensions.
In this instructor, we are going to demonstrate the running of BMG160 with Arduino Nano.
Hardware that you are going to need for this purpose are as follows:
1. BMG160
2. Arduino Nano
3. I2C Cable
4. I2C Cuticle For Arduino Nano
Step 1: BMG160 Overview:
First of all we would like to familiarize you with the basic features of the sensor module that is BMG160 and the communication protocol on which it works.
BMG160 is basically a 16-bit, digital, triaxial, gyroscope sensor which can measure angular rates. It is capable of computing cuspidate rates in three perpendicular room dimensions, the x-, y- and z-axis, and providing the corresponding output signal signals. It can communicate with the raspberry pi board using the I2C communication protocol. This particular module is designed to take on requirements for consumer applications as well as business enterprise purposes.
The communication protocol on which the detector works is I2C. I2C stands for the inter-integrated circuit. It is a communicating communications protocol in which the communication takes place through SDA(serial data) and SCL(serial clock) lines. IT allows connecting multiple devices at the same time. Information technology is one of the simplest and most efficient communicating protocol.
Step 2: What You Need..!!
The materials that we need for accomplishing our goal includes the shadowing hardware components:
1. BMG160
2. Arduino Nano
3. I2C Cable
4. I2C Shield for Arduino Nano
Step 3: Hardware Hookup:
The hardware hookup section basically explains the wiring connections required between the sensor and the Arduino. Ensuring correct connections is the basic necessity while on the job on whatsoever system for the desired output. So, the requisite connections are as follows:
The BMG160 leave work ended I2C . Here is the example wiring diagram, demonstrating how to telegraph rising each interface of the sensing element.
Out-of-the-box, the board is configured for an I2C interface, as such we recommend using this hookup if you're other than agnostic.
All you need is four wires! Only four connections are mandatory Vcc, Gnd, SCL and SDA pins and these are connected with the assistant of I2C cable.
These connections are incontestable in the pictures above.
Step 4: 3-Axis Gyroscope Measurement Arduino Code:
Lets start with the arduino encode now.
While using the sensor faculty with the arduino, we include Wire.h library. "Wire" library contains the functions which facilitate the i2c communication between the sensor and the arduino board.
The entire arduino code is given below for the convenience of the user:
<p>#include<Wire.h><br>// BMG160 I2C address is 0x68(104)</p><p>#define Addr 0x68 void setup() </p><p>{</p><p>// Initialise I2C communication as MASTER </p><p>Wire.begin(); </p><p>// Initialise Serial Communication, set baud value = 9600 </p><p>Order.commenc(9600);</p><p> // Start I2C Transmission </p><p>Wire.beginTransmission(Addr); </p><p>// Select Range register </p><p>Wire.write(0x0F); </p><p>// Configure full scale leaf range 2000 dps </p><p>Wire.write(0x80); </p><p>// Arrest I2C Transmission </p><p>Wire.endTransmission();</p><p> // Starting signal I2C Transmission </p><p>Wire.beginTransmission(Addr); </p><p>// Select Bandwidth file </p><p>Wire.write(0x10); </p><p>// Put across bandwidth = 200 Hz </p><p>Telegram.write(0x04); </p><p>// Stop I2C Transmission </p><p>Telegraph.endTransmission(); </p><p>delay(300);</p><p>}</p><p>annul loop()</p><p>{ </p><p>unsigned int data[6]; </p><p>// Start I2C Transmission </p><p>Wire.beginTransmission(Addr); </p><p>// Select Gyrometer data register </p><p>Wire.write(0x02); </p><p>// Stop I2C Transmission </p><p>Telegraph.endTransmission();</p><p> // Request 6 bytes of information </p><p>Wire.requestFrom(Addr, 6); </p><p>// Translate 6 bytes of data </p><p>// xGyro lsb, xGyro mutual savings bank, yGyro lsb, yGyro msb, zGyro lsb, zGyro MSB </p><p>if(Wire.available() == 6) </p><p>{ </p><p>information[0] = Telegram.read(); </p><p>data[1] = Telegram.read(); </p><p>information[2] = Electrify.read(); </p><p>data[3] = Cable.read(); </p><p>data[4] = Wire.show(); </p><p>information[5] = Wire.read(); </p><p>} </p><p>delay(300); </p><p>// Convert the information </p><p>int xGyro = ((data[1] * 256) + data[0]); </p><p>int yGyro = ((information[3] * 256) + information[2]); </p><p>int zGyro = ((information[5] * 256) + data[4]); </p><p>// Output data to the serial monitor </p><p>Serial.print("X-Axis of rotation of Rotation: "); </p><p>Serial.println(xGyro); Serial.impress("Y-Axis of Rotation: "); </p><p>Sequent.println(yGyro); Serial.print("Z-Axis vertebra of Rotation: "); </p><p>Serial.println(zGyro); </p><p>delay(500);</p><p>}</p>
Step 5: Applications:
BMG160 has a varied add up of applications in devices like cell phones, human machine interface devices. This sensor mental faculty has been designed to meet requirements for consumer applications much as image stabilisation(DSC and camera-phone), gaming and pointing devices. It is also employed in systems which require gesture recognition and the systems used in interior seafaring.
Live the First to Contribution
Recommendations
-
Anything Goes Competition 2022
Source: https://www.instructables.com/Interfacing-of-3-Axis-Gyroscope-Sensor-BMG160-With-1/
Posted by: caseyught1967.blogspot.com
0 Response to "Interfacing of 3-Axis Gyroscope Sensor BMG160 With Arduino Nano : 5 Steps - caseyught1967"
Post a Comment