Step 1

Note: There are 2 different Climate modules.
Any module shipped after July 10, 2014 is the si7020 instead of the si7005.

Also note that temperature and humidity readings can be skewed by the operating temperature of the Tessel. Distancing the the climate module from the Tessel via wires is recommended for accurate readings.

Make a directory inside your "tessel-code" folder: enter mkdir climate into your command line, then change directory into that folder: cd climate

Step 2

Plug the climate module into Tessel port A with the hexagon/icon side down and the electrical components on the top, then plug Tessel into your computer via USB.

Step 3

Check if your module is a si7020 or a si7005

If it's a si7005 install by typing

npm install climate-si7005

Otherwise if it's a si7020 install with

npm install climate-si7020

Step 4

If you're using a si7020, replace climate-si7005 with si7020.

Save this code in a text file called climate.js:

// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/

/*********************************************
This basic climate example logs a stream
of temperature and humidity to the console.
*********************************************/

var tessel = require('tessel');
// if you're using a si7020 replace this lib with climate-si7020
var climatelib = require('climate-si7005');

var climate = climatelib.use(tessel.port['A']);


climate.on('ready', function () {
  console.log('Connected to si7005');

  // Loop forever
  setImmediate(function loop () {
    climate.readTemperature('f', function (err, temp) {
      climate.readHumidity(function (err, humid) {
        console.log('Degrees:', temp.toFixed(4) + 'F', 'Humidity:', humid.toFixed(4) + '%RH');
        setTimeout(loop, 300);
      });
    });
  });
});

climate.on('error', function(err) {
  console.log('error connecting module', err);
});

Step 5

In your command line, tessel run climate.js
See the temperature and humidity change if you cup your hands and breathe on the module.

Bonus: Change the code so the temperature reads out in celsius rather than Fahrenheit.

To see what else you can do with the climate module, see the module docs here.

Step 6

What else can you do with a climate module? Try a community-created project.


What are you making? Share your invention!

If you run into any issues you can check out the climate forums.

Choose another module

Or if you're all set, move on to Wifi.

Fork on Github