Measuring temperature and humidity with a JeeNode

In a previous article we looked at the Arduino. Now we will look at an (almost) Arduino compatible clone, the JeeNode.

It is a bit smaller and cheaper than the original version and operates at 3.3V instead of 5V. This makes it easy to connect 3.3V peripherals, such as the radio module RX868 by ELV.

Connecting this device to the JeeNode means that we can listen to signals sent out by the temperature and humidity sensor S555TH.

Many thanks go out to JeeLabs for providing the On-Off Keying (OOK) decoding used by the S555TH, and Pieter Meulenhoff for supplying me with the idea of using this sensor and initial versions of the software.

The S555TH transmits the following data within the S300 protocol:

The first byte contains the sign of the temperature value and the address of the sensor. If the first bit is ‘0’, the temperature sign is ‘+’, else it is ‘-‘. The second to fourth bit are used for the address (1-8) of the sensor. This is used for identifying the sensor, but also helps in avoiding packet collisions. Each sensor will wait for (177 minus 0.5 * address) seconds between transmissions.

The second through fourth bytes contain the temperature and humidity values. For example, the humidity value is obtained by multiplying 10 with the first nibble of the fourth byte, adding the second nibble of the fourth byte, and adding 0.1 times the first nibble of the third byte.

In code this looks like:

uint8_t address = 1 + ((buf[0] >> 4) & 0x07);
int16_t temperature = (buf[0] >> 7 ? -1 : 1) * (100 * (buf[2] & 0x0F) + 10 * (buf[1] >> 4) + 1 * (buf[1] & 0x0F));
uint16_t humidity = 100 * (buf[3] >> 4) + 10 * (buf[3] & 0x0F) + 1 * (buf[2] >> 4);

Serial.print("S555TH: address=");
Serial.print(address, DEC);
Serial.print(" temperature=");
Serial.print(temperature / 10.0, 1);
Serial.print(" humidity=");
Serial.println(humidity / 10.0, 1);

Note that we multiplied the temperature and humidity values by 10 to be able to print them nicely to the serial monitor, in which we divide by 10 again.

The complete Arduino sketch can be downloaded here.

Advertisements
This entry was posted in Hardware, programming and tagged , , , . Bookmark the permalink.

One Response to Measuring temperature and humidity with a JeeNode

  1. Carsten says:

    Congratulation.
    I would like to do something similar.
    Can you say a bit more about the receiver settings.
    On what frequency the sensor is working? Does it send a preamble and/or synchronization?
    If not how you now of the receiving of valid data?

    Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s