Blog Post

Change I2C Speed with Raspberry Pi

23048

Introduction

You may want to change the I2C speed in the raspberry pi to increase your sensor reads or various other applications. Check your current I2C speed by issuing the command in the terminal:

 sudo cat /sys/module/i2c_bcm2708/parameters/baudrate

 

Changing the I2C speed

You can change the I2C speed by editing the /boot/config.txt file.  So you can use the command:

sudo nano /boot/config.txt

This will put you in the editing mode for your boot configuration file.  You must then find the line that says,

dtparam=i2c_baudrate=50000

 

The baudrate value may be different, this is where you change it to the speed you would like. If you cannot find the line above simply add it to the bottom of the page.  For example if I wanted to change my I2C speed to 400kbps I would have the line,

dtparam=i2c_baudrate=400000

After editing or adding that line, if in nano mode use Ctrl+x and then press "y" to save the changes. You must then reboot the pi for the changes to occur.  After rebooting open the terminal and issue the follow command to ensure that your I2C speed has changed.

 sudo cat /sys/module/i2c_bcm2708/parameters/baudrate

 

CAUTION: Changing the I2C speed is not necessary when using the Mindsensors PiStorms, however if you choose to do so there may be issues with the touch screen on the PiStorms.

Comments (4)

Brian X 05.28.2016
How do I do this on RPI3?
Deepak P 05.28.2016
It's the same process for Raspbian operating system on all Pis.
John T 02.24.2017
I have a RPi3 and the above instructions do not appear to work. When I do sudo cat... I always get 0 in response. I have followed the instructions precisely (several times). Can anyone help please. Thanks.
Mindsensorssupport S 02.24.2017
It looks like the /sys/module/i2c_bcm2708/parameters/baudrate file is not effective in Raspbian Jessee, (was for previous versions), but /boot/config.txt is the correct place to put the baudrate you want.
Please Login to add your comments

Featured Posts

The mindsensors Grove Sensor Adapter makes it easy to use a variety of unique Grove sensors with the...

Read more

The mindsensors Grove Sensor Adapter makes it easy to use a variety of unique Grove sensors with the...

Read more

Poll

  • What do you use to program your FRC Robot?
    Total: