Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is most likely no translated for the post!




problem using MPU-6...
 
Share:
Notifications
Clear all

problem using MPU-6050 Accel/Gyro with ESP32

Page 7 / 7

 tvr4
(@tvr4)
Estimable Member
Joined: 10 months ago
Posts: 122
Topic starter  

I know the code as posted works for the most part.

I have contacted the developers of the MPU6050 library (Electronic Cats) and the library it was based on (jrowberg/i2cdevlib)

Neighther could offer a solution.  I was advised that it was an issue with the I2C bus timeout.  I believe it was due to an underlying issue with the arduino wire library which needed to be fixed.  

Not sure if that will ever happen.  So I have had to shelve the project for the time.

Disappointing since I had been running my RC cars all summer and could have used this logger.


ReplyQuote
(@michaelzen)
Active Member
Joined: 5 months ago
Posts: 10
 

I'd like to thank you for al the patient replies, for now I'm waiting on a new GPS receiver as I build the one I used into my car 😉

When it arrives I'll go on with this project as I still want it to work!


ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 10 months ago
Posts: 122
Topic starter  

Keep us posted.  I developed this project with the Neo 6m GPS module and a similar Goouuu.  But am interested in any feedback.

 

On the I2C bus freeze issue.  I found  few accelerometer modules that use analog pins instead of I2C.  I ordered one and will experiment with that instead of the MPU6050.

Since it uses three analog pins (x,y,z) i will need to modify the code.  But if it works it will be worth it.

I  will post any news 


Hans liked
ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 10 months ago
Posts: 122
Topic starter  

I have tested an analog accelerometer module MMA3761 and it is erratic, possibly because it is analog.

I hooked it up and ran a test example which used analogread.  It keeps producing reading and does not freeze. 
However, the 0g readings even with  no motion change and do not stabilize.

I have also not been able to find much documentation or code for this module, possibly due to the age and the product being discontinued.

Back to look for another alternative


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 1832
 
Posted by: @tvr4

MMA3761

Did you try this library: Arduino-MMA7361-library ?
It seems to have a sensitivity option, which may help "calm down" the numbers?

Or is this really the wrong model? (3761 is what you typed - I did see a reference here, where 7361 and 3761 were used mixed as well)


ReplyQuote


 tvr4
(@tvr4)
Estimable Member
Joined: 10 months ago
Posts: 122
Topic starter  

@hans
I did look at the library.  It was a complete disaster.

First, the library is 8 years old.  I couldn't even get it to install in the arduino ide.  I had to install it manually.

Then the library is not compatible with the ESP32.  I tried to get the simple sketch to compile and after hours, gave up.
The library may work fine on an uno, nano or whatever. It will not compile for an esp32 or the heltec board

I did find an AXL345 accelerometer board that used SPI and I2C.  I ordered one yesterday.
I am going to try this in SPI mode


ReplyQuote
 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 1832
 
Posted by: @tvr4

the library is 8 years

Oh boy ... that's not good.

I hope the new accelerator works better.
As for the model you have right now; how bad are the numbers bouncing?
Since I have no idea about the values, maybe you can calm them down a little with one or the other math trick?
I'm just spitballing here obviously ... maybe make it a float, divide by 10, trunc the number, and multiple by 10 again (a trick I used in other projects, so this may not be relevant for your project).


ReplyQuote
 tvr4
(@tvr4)
Estimable Member
Joined: 10 months ago
Posts: 122
Topic starter  

I will keep you posted on the new module.

 

 


Hans liked
ReplyQuote
Page 7 / 7

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: