MPU6050 Interfacing with Raspberry Pi using ‘C’

Introduction:

  • 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

Compile VLC Player with Hardware Acceleration

Thanks to a post on the Raspberry Pi Foundation’s Message Board, where people have detailed the instructions on how to easily compile VLC Media Player with Hardware Acceleration. For this project, you’ll just need a Raspberry Pi and the basic peripherals: a power source, screen, keyboard and mouse, and microSD card (you need all of this to get Raspbian Installed in the first place, anyway).

Before we begin, a quick note for those of you who already have Raspbian, and may have installed VLC Media Player from Raspbian’s repositories: I recommend that you remove that version. You can do so by running the command:

sudo apt-get purge vlc

Read More

Raspberry Pi I2C (Synchronous Serial Communication)

Introduction:

  • I2C (Inter Integrated Circuit) is a synchronous serial protocol that communicates data between two devices.
  • It is a master-slave protocol which may have one master or many master and many slaves whereas SPI has only one master.
  • It is generally used for communication over short distance.
  • The I2C device has 7-bit or 10-bit unique address. So, to access these devices, master should address them by the 7-bit or 10-bit unique address.
  • I2C is used in many applications like reading RTC (Real time clock), accessing external EEPROM memory. It is also used in sensor modules like gyro, magnetometer etc.
  • It is also called as Two Wire Interface (TWI) protocol.

Read More

Raspberry Pi UART Communication Using Python And C

UART (Universal Asynchronous Receiver/Transmitter) is a serial communication protocol in which data is transferred serially i.e. bit by bit. Asynchronous serial communication is widely used for byte oriented transmission. In Asynchronous serial communication, a byte of data is transferred at a time.

UART serial communication protocol uses a defined frame structure for their data bytes. Frame structure in Asynchronous communication consists:

  • START bit: It is a bit with which indicates that serial communication has started and it is always low.
  • Data bits packet: Data bits can be packets of 5 to 9 bits. Normally we use 8-bit data packet, which is always sent after the START bit.
  • STOP bit: This usually is one or two bits in length. It is sent after data bits packet to indicate the end of frame. Stop bit is always logic high.

Read More

Raspberry Pi PWM Generation using Python and C

PWM (Pulse Width Modulation) is a modulation technique by which the width of pulse is varied while keeping the frequency constant. Through PWM technique, we can control the power delivered to the load by using ON-OFF signal. The PWM signals can be used for applications such as controlling the speed of DC motors, changing intensity of an LED, controlling Servo motors, etc.

Raspberry Pi PWM:

Raspberry Pi has two PWM channels i.e. PWM0 and PWM1.

PWM pins for the two PWM channels on 40-pin P1 header are as follows:

GPIO Pin PWM0/PWM1
GPIO12 PWM0
GPIO18 PWM0
GPIO13 PWM1
GPIO19 PWM1

 

Read More

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