running multiple tmp102 temperature sensors on a pcduino in python

So the first thing you have to do to run multiple sparkfun temp102 sensors on your pcduino or any platform for that matter is to remove the solder bridge for add0
here is the before picture of the solder bridge intact

sparkfun tmp102 solder bridge add0

solder bridge between add0 and ground intact

and here is the after picture. I just used some solder wick and an iron to remove the bridge.

sparkfun tmp102 no solder bridge add0

Now the solder bridge has been removed

Once that is done you can wire up your sensors. In this case I started with two sensors. One for inside temp and one for outside temp. The inside sensor had add0 grounded so it uses i2C address 0×48 and the outside sensor had add0 connected to 3.3 volt and should use i2C address 0×49 .

pcDuino dual tmp102 breadboard prototyping

Dual tmp102 sensors on a breadboard for prototyping

once I got it wired up I ran i2cdetect to make sure my sensors could be seen and they were.
ubuntu@ubuntu:~$ i2cdetect -y 2

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

ubuntu@ubuntu:~$

So at this point I had to modify my code a bit. You can download it here

This code requires i2c tools and python smbus

sudo apt-get install i2c-tools
sudo apt-get install python-smbus


Special note here… “this is not complete or in any way finished code” This is just a starting point. I threw this together in matter of minutes as a proof of concept.

Here is the results of my first run

ubuntu@ubuntu:~$ ./temp102.py
inside temp is 75.875
outside temp is 76.1
the differential is 0.225

So with the sensors sitting right next to each other I have a differential of 0.225 degrees Fahrenheit. That is not too bad.
Now to move one of the sensors out doors and see how it works.

ubuntu@ubuntu:/home/ubuntu~$ ./temp102.py
inside temp is 76.1
outside temp is 99.275
the differential is 23.175

More coding is needed as I add more sensors and more logic to actually do something with the sensor information. The program will get significantly more complex. I envision this as the beginning of a room/climate monitor and possibly control on a shoestring budget. As always your comments are certainly welcome….

Tagged on:

2 thoughts on “running multiple tmp102 temperature sensors on a pcduino in python

  1. Pingback: Getting to know the pcDuino3 | One Mans Anthology

  2. Pingback: Sparkfun TMP102 temperature sensor and arduino code | One Mans Anthology

Leave a Reply

Your email address will not be published. Required fields are marked *