esp-01 doesn't connect to GY-87 (MPU6050)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ith
New user
Posts: 4
Joined: 06 Jun 2017, 11:26

esp-01 doesn't connect to GY-87 (MPU6050)

#1 Post by ith » 06 Jun 2017, 11:38

Hi All,

I hope I'm posting to the right section of the forum, if not please point me to the right place.
I'm a bit new to ESP9266 and so far this forum has been very helpful, so I wish to thank all of you!

We're trying to connect an ESP-01 to a GY-87 board (with an MPU6050 unit), but no matter what we tried, the ESP doesn't recognize the MPU6050. Running the i2c scanner code doesn't find any i2c device, reading the WHO_AM_I register returns 255 and trying to read raw sensor data shows only values of -1.

Connecting the GY-87 to an Arduino Uno works perfectly: i2c scanner recognizes it on 0x68 as it should, and sensor data is streaming fine. We didn't need any additional resistors to connect to the Arduino Uno, just the simple 3.3, GND, SDA and SCL connections.

The ESP-01 seems to be working fine as well - we're able to setup an access point, send and receive UDP, blink GPIO 0 and 1, etc.

So we have good reasons to believe that both boards are functional, and the problem is either with the connections or with the code.

Our connections:

ESP-01 GY-87
-------- -------
VCC 3.3V
GND GND
GPIO-0 SCL
GPIO-1 SDA

(We also tried to switch between SDA and SCL, but to no avail)

We tried to connect some resistors (10K) after the SDA and SDL - didn't help.
Also tried to connect INTA to GND - didn't help.

The codes we're executing are mostly example codes we found in Arduino Playground, in this forum and in some blogs - nothing special. We're using the libraries Wire.h and MPU6050.h, everything's working with Arduino, but not with the ESP-01.

What are we missing? We're almost desperate :(

Any help, any idea you guys might have, will be very much appreciated,

Thanks,

Ith & Tal - See more at: http://www.esp8266.com/viewtopic.php?f= ... dU6Ap.dpuf

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#2 Post by Domosapiens » 06 Jun 2017, 22:34

Just to make sure ...
Looking at this diagram:
Image
and this picture:
Image


VCC_IN is for 5V
If you use 3.3V you must use the 3.3V connection point (that's after the voltage regulator)

Just my 2 cents
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

talb
New user
Posts: 1
Joined: 06 Jun 2017, 23:16

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#3 Post by talb » 07 Jun 2017, 00:11

Hey, I'm tal - Ith's Partner.
We use 3.3v everywhere on the circuit - the same goes for the GY-87.
The VCC pin on The ESP's output supposed to be around 3.3 because we power it through FTDI set to 3.3 output Or 3.6 Lithium ion battery - however using the 3.3v pin on the GY-87 is supposed to reduce the voltage to the desired one... I guess Voltage is not causing the troubles here.

There are some more "funny" issues occur when trying to connect the SCL and SDA to GPIO 0 adn GPIO 2, there is a specific variation that causes the Blue LED (Indicating Data Transfer and Network activity) to blink irregularly, moreover the network connection seems to freeze. I think that the data received from the SDA pin is causing some interference with the WiFi and some other capabilities of the ESP.

When using the Arduino UNO there were no such issues - We connected the 3.3v pin from the UNO to the (same) 3.3v GY 87 and It worked just great.
So I guess the cause is not the Voltage rather it might be the way the ESP 8266 uses I2C connectivity via it's GPIO pins.

Maybe we should use some resistors somehow on SDA or SCL connections?
I tried some options but none had any success...

Has somebody here tried to connect any 9-dof sensors (with gyro, magnometer and accelerometer) to this ESP and it worked?

Thanks

Tal & Ith

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#4 Post by LisaM » 07 Jun 2017, 01:09

talb wrote: 07 Jun 2017, 00:11 Hey, I'm tal - Ith's Partner.
We use 3.3v everywhere on the circuit - the same goes for the GY-87.
The VCC pin on The ESP's output supposed to be around 3.3 because we power it through FTDI set to 3.3 output Or 3.6 Lithium ion battery - however using the 3.3v pin on the GY-87 is supposed to reduce the voltage to the desired one... I guess Voltage is not causing the troubles here.

There are some more "funny" issues occur when trying to connect the SCL and SDA to GPIO 0 adn GPIO 2, there is a specific variation that causes the Blue LED (Indicating Data Transfer and Network activity) to blink irregularly, moreover the network connection seems to freeze. I think that the data received from the SDA pin is causing some interference with the WiFi and some other capabilities of the ESP.

When using the Arduino UNO there were no such issues - We connected the 3.3v pin from the UNO to the (same) 3.3v GY 87 and It worked just great.
So I guess the cause is not the Voltage rather it might be the way the ESP 8266 uses I2C connectivity via it's GPIO pins.

Maybe we should use some resistors somehow on SDA or SCL connections?
I tried some options but none had any success...

Has somebody here tried to connect any 9-dof sensors (with gyro, magnometer and accelerometer) to this ESP and it worked?

Thanks

Tal & Ith

Isn't gpio1 and 3 being used for tx/rx? On my espeasy2, gpio 1/3 are grayed out for the i2c interface.
Gpio 0/2 should be available for i2c. Did you also try it with an esp-12 and different gpio's for i2c?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#5 Post by Shardan » 07 Jun 2017, 14:58

LisaM wrote: 07 Jun 2017, 01:09 Isn't gpio1 and 3 being used for tx/rx? On my espeasy2, gpio 1/3 are grayed out for the i2c interface.
Gpio 0/2 should be available for i2c. Did you also try it with an esp-12 and different gpio's for i2c?
Yep, definitely.
Please use GPIO0 and GPIO2 for the I2C.

GPIO1/3 are used for serial communication.
In general it is possible to use GPIO1/3 for other purposes by switching off serial in the ESPEasy setup.
I nevertheless would avoid using them for I2C.

If you monitor your ESP on serial you will see some erratic letters and numbers on bootup.
The ESP sends some bootup messages there with another serial speed, that's why you see letter garbage.
If using these GPIOs for I2C you may send some data to the connected sensors at boot they can't understand.
I'm not sure if the following initialization process gets rid of this data and init all I2C devices correctly.

Regards
Shardan
Regards
Shardan

ith
New user
Posts: 4
Joined: 06 Jun 2017, 11:26

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#6 Post by ith » 18 Jun 2017, 10:12

Hi, bumping this one last time..
We're close to desperation and are considering to drop the ESP8266 altogether and switch to Arduino Nano (which is less suitable to our needs, but at least it works!)
:(
Hasn't anyone succeeded in connecting ESP-01 and MPU6050 via I2C ?
Isn't it supposed to be super-simple?
Please help if you have ANY thoughts.

ThanX
ith

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#7 Post by grovkillen » 18 Jun 2017, 10:54

Have you tried another ESP? In general gpio 4 and 5 are used for I2C.

https://www.letscontrolit.com/wiki/inde ... figuration

Is a WeMos D1 mini to big for your application?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ith
New user
Posts: 4
Joined: 06 Jun 2017, 11:26

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#8 Post by ith » 18 Jun 2017, 12:25

Thanks for responding, grovkillen!

Our project needs to be very small, that's why I chose to use the ESP-01, which only has GPIO 0 and 2.
Anyhow, as I understand it, it shouldn't really matter because I can use Wire.begin(0,2) to set i2c communication via GPIO 0 and 2.

What am I doing wrong??

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#9 Post by grovkillen » 18 Jun 2017, 15:26

Sorry for bugging you but have you tried a WeMos just to make sure that it's not the board that is the problem?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ith
New user
Posts: 4
Joined: 06 Jun 2017, 11:26

Re: esp-01 doesn't connect to GY-87 (MPU6050)

#10 Post by ith » 18 Jun 2017, 16:01

grovkillen, you're not bugging me at all - like I said ANY information is helpful :)

And indeed, I wasn't aware of WeMos so thanks so much about that tip! The D1 series seems to fit our needs so we'll test it soon.

So far I've been using a generic ESP-01, tried three units with zero success - what are the odds I'll get 3 broken ones in a row?
On Arduino Uno everything works right away so I'm guessing it's not the code or the wiring.

Thanks again, I'll post an update after I've tested WeMos.

Any other thoughts from anybody?

ith

Post Reply

Who is online

Users browsing this forum: No registered users and 90 guests