The sensor values are retrieved by using the I2C serial data bus, which requires only two wires (SCL and SDA). In particular, it is shown how to retrieve the raw sensor values. This tutorial gives only a brief introduction to the GY-521/MPU-6050. Usually, the DMP processes algorithms that turn the raw values from the sensors into stable position data. The digital motion processor can be used to process complex algorithms directly on the board. The GY-521 module is a breakout board for the MPU-6050 MEMS (Microelectromechanical systems) that features a 3-axis gyroscope, a 3-axis accelerometer, a digital motion processor (DMP), and a temperature sensor. If you would like any more information, I'm happy to provide it.GY-521 breakout board with an MPU-6050 MEMS. I have also tried receiving raw values from MPU6050 with the example code from the same library - I am sometimes able to get raw values for 2-3 seconds, but then it 'crashes' and no more data.Īny suggestions for things to try next would be really appreciated. It's worth noting that the problem occurs during initialisation of the DMP, I simply receive "DMP Initialization failed (code 1)" error on startup, as shown in attachement 8. Could it be trying to do this in the background and throwing off the MPU6050 ISR? What I don't understand is how and if the Arduino decides to request/receive data from the Pixart. I understand that the GY521 stores data in a FIFO buffer and uses an interrupt signal to tell arduino when there is data ready (to prevent buffer overflow). I now wonder if problem may be one of software. The problem now vanishes - the DMP works fine! To test both of these, I soldered the GY 521 back into the circuit but disconnected the SDA and SCL lines of the WiiCam. Or maybe another part of the circuit is interfering (i.e. Maybe my 1m length of wire is adding impedance (?) and causing problems. I added some on both the 3.3V side and the 5V side, as shown in attachements 5, 6 & 7, but no differenceĤ. I only have 6.5k or 16k, so tried the former. I'd forgotten pull up resistors, so I added some. To test this, I de-soldered it from my circuit and tested again with the breadboard. Maybe I have somehow broken the GY 521 board during the soldering process. This successfully found both devices MPU6050 = 0圆8 (I understand I could change this to 0圆9 if necessary) and Pixart camera = 0x58, so this shouldn't be a problem.Ģ. Maybe the addresses of the 2 slaves are the same. So my initial thoughts on the problem were as follows:ġ. Using the same code as in Step 2, it does not work as part of my soldered circuit. However, the MPU6050 is a different beast, and is not playing ball. Using the same code as in step 1, I checked the WiiCam still works - success! No problems with the WiiCam whatsoever.ĥ. Having successfully got both components working separately, and having researched the basic theory behind I2C, and how to connect masters and slaves together, I then designed and built a circuit using stripboard and soldered everything together, as shown in attachments 3 & 4.Ĥ. I tested both raw and DMP outputs and everything works as expected.ģ. Then I got the MPU6050 working on a breadboard by connecting it as shown in attachment 2 and using the example code found in Step 2 here. I made the circuit shown in attachment 1 on a breadboard and it was an immediate success - the camera works great!Ģ. I first got the WiiCam working with Arduino, by following steps and instructions found here, along with the code found here. This will be used to track an infrared light source.ġ. Pixart IR Camera ("WiiCam") from Nintendo Wii remote.For now I'm just looking to read the values from the DMP, I'll deal with the processing and control system later on. I will ultimately be using this to try and stabilise a home-made camera gimbal. MPU6050 Digital Motion Processor, on a GY-521 breakout board.Hopefully it's something simple and stupid that I've done wrong, but I've done a fair bit of reading around online and am yet to find a solution. I am attempting to use an Arduino Uno R3 to communicate with the following 2 sensors via I2C, but I'm struggling, having never used either sensor, or I2C, in the past. Whilst I've been playing with Arduino for a few years now, I'm fundamentally a Mechanical Engineer, so my understanding of all things software and electronics is basic. Hi Guys, I'd really appreciate some help with an arduino-based project I'm working on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |