GY-87 micropython library
-
@robert-hh ohhh, I didn't even thought about that. But could be. Can you recommend some other sensor?
pytrack has built-in gyro. what i need pressure, and compass.
(The weather ballon will have a camera, and when it took a picture, I would like to know the direction)
-
@tttadam I justz received a sample of the board that you have linked. Three observations:
- the HMC5883 does not show up in the i2c.scan(), even if the address is ping'ed.
- the bmp180 returns nonsense-values.
- the pull-up resistor values on the board are pretty low,
effectively 1.1kOhm. I will look tonight into the signals with an oscilloscope to verify the signal quality.
So all-in-all, the board might just be crap.
-
@robert-hh
First of all sorry for the long delay.
I just checked, and seems like no, the last sensor didn't show up on i2c.scan()
I checked the documentation and the MPU6050 is has some kind of mode/option, where it's connected to other I2c devices, and gather data from them. Maybe the compass is connected to the mpu6050?>>> from machine import I2C >>> i2c = I2C(0, I2C.MASTER, baudrate=400000) >>> i2c.scan() [64, 104, 119] >>>
-
@tttadam I looked for MPU6050 libraries. What I found is for RasPi, but it should be easy to adapt them by replacing the calls for I2C send and receive.
About the third sensor HMC5883L. Acording to the data sheet there is no enable pin. The DRDY signal could come from that chip. You should check whether you init the I2C bust at a baudrate <= 400000, because that is the max rate mentioned in the data sheet.
-
@robert-hh Thank you for the library, it is working fine! :)
I am checking out something fo MPU6050
But I am still not sure where is the third sensor. mybe the gy87 is damaged?
-
@robert-hh I took some picture of the wiring.
Sorry for the confusion, I will fix the title. The sensor what I have is GY-87. This is where I bought it.
-
@tttadam 104 should be the address of the MPU6050 device,
The hmc5883l device address is told to be 30 decimal. If the SI7021 is also connected, you should get four I2C addresses.
So when connecting the GY-87, you should see that. By the way, the title of your post says GY-80, but you link to the GY87.
-
@tttadam 119 is the address of the BMP180. I have a driver for that at https://github.com/robert-hh/BMP085_BMP180. Do not be confused that the file is called bmp085.py. It cintains the classes for both devices. In fact, they behave identical.
-
@elizar Thank you, I think the wiring is okay, but I am not sure.
This is what I2C scan returs: [64, 104, 119]
64 for is the si7021 sensor for sure.
But, GY-80 has 3 sensor as far as I know, but the there is only 2 additional on shows up at the scan, 104 and 119.
print(si7021.readRH(), si7021.readTemp()) is working fine.
Now, I need to find a micropython library, can you recommend me one?
Thank you,
Ádám,
-
@tttadam Just have a look at http://www.techmonkeybusiness.com/the-gy87-combined-sensor-test-sketch.html for wiring.
Yes, there are some more pins but you probably don't need them for a start.
-
@elizar yes I meant paralel sorry. English is not my first language. I know the teory, but I never used more tahn one I2C sensor. But GY-87 has more pins than Vcc, gnd, scl and sda.
-
@tttadam I²C bus devices are connected in parallel, SDA at SDA, SCL at SCL and so on. Therefore You need no extra pins.
All I²C bus devices have different device ID numbers (see the datasheet for that ID). So the controller can access each device individually.