MPU-6050 on Wemos D1 mini (I2C)

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
deshipu
Posts: 1365
Joined: Thu May 28, 2015 5:54 pm

Re: MPU-6050 on Wemos D1 mini (I2C)

Post by deshipu » Mon Oct 24, 2016 9:44 am

bubulle wrote: - What should be the value of the pullup resistors ?
This really depends on a lot of factors, such as the length of the wires you used to connect the sensor, driving strength of the pins, speed of transmission, etc. There is an excellent article on the topic: http://dsscircuits.com/articles/effects ... -resistors
bubulle wrote: - How do I check that my D1 mini is not damaged ?
- Could my GY-521 have been damaged too ?
It should be fine.
bubulle wrote: - I decided to plug the GY-521 Vin to 5V according to this page (http://playground.arduino.cc/Main/MPU-6050#boards). Can anyone confirm ?
The breakout board that you are using has a voltage regulator that drops the 5V power to the required 3.3V for the sensor (it's the other black part apart from the sensor, the one with 5 legs). So it's quite correct that you powered the module with 5V.

User avatar
deshipu
Posts: 1365
Joined: Thu May 28, 2015 5:54 pm

Re: MPU-6050 on Wemos D1 mini (I2C)

Post by deshipu » Mon Oct 24, 2016 9:49 am

Actually, looking closely at the GY-521 module photo, I can see that it also includes 2.2kΩ pull-up resistors on the SCL and SDA lines...

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: MPU-6050 on Wemos D1 mini (I2C)

Post by torwag » Mon Oct 24, 2016 9:53 am

Huh, I was also in the impression that we talk about a 5V logic peripheral device connected to a 3.3V logic microcontroller.
That was the reason we had this discussion going on for some time now ;)

User avatar
deshipu
Posts: 1365
Joined: Thu May 28, 2015 5:54 pm

Re: MPU-6050 on Wemos D1 mini (I2C)

Post by deshipu » Mon Oct 24, 2016 11:19 am

torwag wrote:Huh, I was also in the impression that we talk about a 5V logic peripheral device connected to a 3.3V logic microcontroller.
That was the reason we had this discussion going on for some time now ;)
It would be fine in such a case too, because a 5V device would have a lower threshold for the logic high, below the 3.3V.

bubulle
Posts: 4
Joined: Sat Oct 22, 2016 2:21 pm

Re: MPU-6050 on Wemos D1 mini (I2C)

Post by bubulle » Mon Oct 24, 2016 5:24 pm

It works!

I added one 10k pullup resistor on each line and now `i2c.scan()` finds the device.
Thanks all.

I will continue to experiment and post some code if I find usefull things.

Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

Re: MPU-6050 on Wemos D1 mini (I2C)

Post by Turbinenreiter » Mon Oct 24, 2016 5:34 pm

This should work with the MPU6050. The base class in imu.py is pretty much the driver for the MPU6050.

bubulle
Posts: 4
Joined: Sat Oct 22, 2016 2:21 pm

Re: MPU-6050 on Wemos D1 mini (I2C)

Post by bubulle » Mon Oct 24, 2016 6:08 pm

Turbinenreiter wrote:This should work with the MPU6050. The base class in imu.py is pretty much the driver for the MPU6050.
Thanks, it will need some adjustments to fit with the API of `machine.I2C` avaible for the esp8266.

Post Reply