MPU6050 Interfacing with Raspberry Pi using ‘C’


  • MPU6050 sensor module is an integrated 6-axis Motion tracking device.
  • It has a 3-axis Gyroscope, 3-axis Accelerometer, Digital Motion Processor and a Temperature sensor, all in a single IC.
  • It can accept inputs from other sensors like 3-axis magnetometer or pressure sensor using its Auxiliary I2C bus.
  • If external 3-axis magnetometer is connected, it can provide complete 9-axis Motion Fusion output.
  • A microcontroller can communicate with this module using I2C communication protocol. Various parameters can be found by reading values from addresses of certain registers using I2C communication.
  • Gyroscope and accelerometer reading along X, Y and Z axes are available in 2’s complement form.
  • Gyroscope readings are in degrees per second (dps) unit; Accelerometer readings are in g unit.

For more information about MPU6050 Sensor Module and how to use it, refer the topic MPU6050 Sensor Module in the sensors and modules section.

Read More

Detecting Colors using the TCS3200 Color Sensor

In this project we are going to Detect the Colors using TCS3200 Color Sensor Module with Raspberry Pi. Here we used Python code for Raspberry Pi to detect the colors using TCS3200 sensor. To demonstrate the color detection we have used a RGB LED, this RGB LED will glow in the same color, of which the object is presented near the sensor. Currently we have programmed Raspberry Pi to detect only Red, Green and blue colors. But you can program it to detect any color after getting the RGB values, as every color is made up of these RGB components. Check the demo Video at the end.Read More

Make a “Safe Shutdown” Button for Raspberry Pi

Pulling the power to your Raspberry Pi can cause image corruptions & other issues that can damage your Pi! In this article, we will create a small push button that will work as a ‘Safe-Shutdown’ option. We’ll connect it to our Raspberry Pi using the GPIO pins and some jumper wires, and with a few lines of code, we will have our own power switch!

First, we are going to look at a simple way to wire a button to the Pi GPIO connector. We will then write a python script that will shut down the Pi safely. The final step will be to setup the Pi so that the button will work all the time. Let’s Get started!Read More

Raspberry Pi weather station using the Sense HAT

Today, we are going to  set up a Raspberry Pi weather station that can be accessed over the internet. For this, we need the Sense HAT, a Raspberry Pi add-on board that was made especially for the Astro Pi mission. The Astro Pi mission sent two Raspberry Pis (each equipped with a Sense HAT and a few other improvements) to the International Space Station, where they joined British astronaut Tim Peake and helped record information about environmental conditions up there in the space ship.Read More

Controlling Arduino with Raspberry Pi using pyFirmata

Although Raspberry Pi and Arduino are two different hardware in terms of their applications and structure, but they both are considered as two competing open source hardware platforms. They both have very strong community and support. Today we will slightly change things, and show you how we can take advantage of both of them. If you have both Arduino and Raspberry pi boards, this article will show you how to use Raspberry pi and Python to control the Arduino.

We will use PyFirmata firmware to give commands to Arduino using Raspberry Pi python script. PyFirmata is basically a prebuilt library package of python program which can be installed in Arduino to allow serial communication between a python script on any computer and an Arduino. This python package can give access to read and write any pin on the Arduino. So here we will run python program on Arduino using Raspberry pi.Read More

Do NOT follow this link or you will be banned from the site!