Step 5: Install I2C packages

Install the i2c-tools and python-smbus packages to complete the I2C setup:

The following commands can be used to install the packages:

sudo apt-get install i2c-tools

sudo apt-get install python-smbus

Finally add the pi user (or whatever login required) to the I2C access group.

The following command can be used to accomplish this:

sudo adduser pi i2c

Use the following command to see what devices are connected to the I2C bus:

i2cdetect -y 1

Note: use the following command if you are using a model A Raspberry Pi

i2cdetect -y0

The I2C address (in hexadecimal) of the temperature sensor should show up if properly connected.

<p>Hi. I am hoping to use the ultimate starter kit to construct an continuous data logging system for pH and temperature. I am an beginner beginner on building raspberry pis and programming!!!</p>
<p>Works great! But I want to connect TWO of these sensors. How do I change the address of the second one?</p>
<p>I like it. Thanks. I ran into a few different troubles and think I found the solutions Has anyone else had an issue with i2cdetect finding the file? I added these steps and it started working afterwards:</p><p>If you are running a recent Raspberry Pi (3.18 kernel or higher) you will also need to update the<strong>/boot/config.txt</strong> file. Edit it with <strong>sudo nano /boot/config.txt</strong> and add the text</p><p><strong>dtparam=i2c1=on<br>dtparam=i2c_arm=on</strong></p><p><strong><br></strong></p><p><strong><br></strong></p><p><strong>and:</strong></p><p><strong><br></strong></p><p><strong><br></strong></p><p><strong><br></strong></p><pre><ol><li>sudo nano /etc/modules</ol></pre><p>and add these two lines to the end of the file:</p><pre><ol><li>i2c-bcm2708 <li>i2c-dev</ol></pre>
<p>excuse me sir if i used thermocouple type k ,can it work using your method?? please reply as soon as possible.thx :D</p>
<p>How to set time, date and timezone in raspberry pi without RTC.</p><p>date in my raspberry pi is default, not date now</p>
<p>Thanks a very awesome tutorial, ZRob314<br>Could you show us how to write your logger record to online SQL database like in Windows Azure's Management Portal?</p>
Hey i am also in Toronto. Very cool projects you have. Would you be i nterested In a paid project? Need something done right away.

About This Instructable


151 favorites


More by ZRob314: Robot Maze Solver Build your own Max 95 Mobile Robot Base Raspberry Pi Robot controlled over Bluetooth
Add instructable to: