I2C Gyro GY-521 anyone?

CAI_Support

Senior Member
Amazon has a low cost gyro module ASIN: B008BOPN40, that can be controlled by I2C interface.
It would be a good sensor to have for robot movement.  WC8 I2C interface can read the gyro sensor into PLC program.  Anyone has interest in using that?
 
 
CAI_Support said:
Amazon has a low cost gyro module ASIN: B008BOPN40, that can be controlled by I2C interface.
It would be a good sensor to have for robot movement.  WC8 I2C interface can read the gyro sensor into PLC program.  Anyone has interest in using that?
That would be a new market for the WC if real time capability is given for steering- may be better using the WC32 for that purpose?
I may have a project eventually but to early to say something about the gyro - possibly some with analog output...
 
With I2C and SPI bus support, WC8 can be very versatile.
We ordered couple of this sensor to test.  Once we played with it, we will publish PLC command sequence to talk to this gyro sensor.
 
We brought this little board just for fun. It comes with a little board and two 8 pin headers.
The little board has 5V regulator on it, so that this must be powered by 5V power.
The 8 pins are: Vcc. Gnd, SCL, SDA, XDA, XCL, A0, INT.
Only first four pins are needed if just try to read this sensor.  Since this board uses 6050 chip, it supports I2C only.
This sensor I2C bus write address is 0xD0, read address is 0xD1 by default.  If A0 is connected to 3.3V, it will be 0xD2 for write and oxD3 for read
 
It seems from chip register address 0x3B, next 14 bytes will be the values most users care.
To communicate with sensor to read all 14 bytes:
I2CWRITE  1  0  0xD0     ; send start bit, non-stop, write to address
I2CWRITE  0  0  0x3B     ; tell 6050 we will read from this address on
I2CWRITE  1  0  0xD1     ; send re-start bit, tell 6050 we will read now
I2CREAD   1   0  RAM11  ; send ack, non stop read into RAM11
...
I2CREAD    0   1  RAM10  ; send nack, send stop, also read  last byte into RAM10
 
first byte reads into RAM11, next byte reads into RAM10, then we can save RAM1L as a 16 bit unsigned number
 
Since this sensor stores 16 bit for each value, first byte high byte and next byte is low byte
so that first two bytes are X- acceleration, next two bytes are Y ace, next two bytes are Z-acce
next two bytes are temp sensor reading,
then it starts X-gyro, Y-gyro, Z-gyro
totally 7x 16 bits value.
 
Back
Top