Measuring bank angles with the MPU6050 and Raspberry Pi - Wiring the components and installing the required software packages
The software requirements:
The last time I showed a short overview of the project I am going to post throughout the next blog enries. By now you should have the hardware and we can start to set everything up.
First of all your raspberry operating system needs some additional software parts, that are usually not included in the "out of the box" version of raspbian. At first you have to make sure, that the I2C kernel module is switchted on. To do that you have modify the advanced options in the configuration tool. To do so, type:
In the command line and then switch to "Advanced Options". Select "A6 I2C" and enable the automatic loading of the I2C kernel module. The next step is to update and upgrade your operating system. A standard procedure, done with typing:
sudo apt-get upgrade
For the sensor readout you need the smbus library, as well as the i2c tools. Type the following commands into a command window:
sudo apt-get install python-smbus
sudo apt-get install i2c-tools
The last thing you need in terms of software is gnuplot. A very helpful piece of software putting together nice graphs from raw data. If you want to postprocess the raw data with your own software tools, you will not need the following line:
sudo apt-get install gnuplot
Now you can wire up the MPU6050 to the raspberry pi and do some initial testing to see, if your sensor works properly. I will not describe this process here, as there is already an excellent blog that covers this topic. It can be found here. Keep in mind to note the adress of the sensor down - You are going to need it in the code lateron.
Now that you have wired up the MPU-6050 you can start to read out data. Again, i refer to this blog, as I basically use the same code to read and write the raw- or filtered data.
Setting up the hardware:
While the software packages are being installed, we can take care of the rather simple wiring of the hardware. The following figure shows the wiring of the raspberry pi with all the necessary components, namely the sensor, the switch and the led. The figure shows the components on a breadboard - I will show how I soldered everything together later. The basic idea behind this is that you have a start- and stop button. The LED shall be on, when the measurement is running and blink, when the measurement is starting/stopping. When there is no measurement, the LED shall be off.
Wrapping up this blog entry:
Right now you have everything you need for the gyroscope setup. You can already test it with the software used in the blog mentioned above. The next time I will show how to generate and "interpret" the data of the files my code generates. I will also show some tests by actually putting the sensor on a motorcycle and go a little into the details of what are the pitfalls for this measurement.
The last time I showed a short overview of the project I am going to post throughout the next blog enries. By now you should have the hardware and we can start to set everything up.
First of all your raspberry operating system needs some additional software parts, that are usually not included in the "out of the box" version of raspbian. At first you have to make sure, that the I2C kernel module is switchted on. To do that you have modify the advanced options in the configuration tool. To do so, type:
sudo raspi-config
In the command line and then switch to "Advanced Options". Select "A6 I2C" and enable the automatic loading of the I2C kernel module. The next step is to update and upgrade your operating system. A standard procedure, done with typing:
sudo apt-get upgrade
For the sensor readout you need the smbus library, as well as the i2c tools. Type the following commands into a command window:
sudo apt-get install python-smbus
sudo apt-get install i2c-tools
The last thing you need in terms of software is gnuplot. A very helpful piece of software putting together nice graphs from raw data. If you want to postprocess the raw data with your own software tools, you will not need the following line:
sudo apt-get install gnuplot
Now you can wire up the MPU6050 to the raspberry pi and do some initial testing to see, if your sensor works properly. I will not describe this process here, as there is already an excellent blog that covers this topic. It can be found here. Keep in mind to note the adress of the sensor down - You are going to need it in the code lateron.
Now that you have wired up the MPU-6050 you can start to read out data. Again, i refer to this blog, as I basically use the same code to read and write the raw- or filtered data.
Setting up the hardware:
While the software packages are being installed, we can take care of the rather simple wiring of the hardware. The following figure shows the wiring of the raspberry pi with all the necessary components, namely the sensor, the switch and the led. The figure shows the components on a breadboard - I will show how I soldered everything together later. The basic idea behind this is that you have a start- and stop button. The LED shall be on, when the measurement is running and blink, when the measurement is starting/stopping. When there is no measurement, the LED shall be off.
Wrapping up this blog entry:
Right now you have everything you need for the gyroscope setup. You can already test it with the software used in the blog mentioned above. The next time I will show how to generate and "interpret" the data of the files my code generates. I will also show some tests by actually putting the sensor on a motorcycle and go a little into the details of what are the pitfalls for this measurement.


Comments
Post a Comment