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 >> 4) & 0x07); int16_t temperature = (buf >> 7 ? -1 : 1) * (100 * (buf & 0x0F) + 10 * (buf >> 4) + 1 * (buf & 0x0F)); uint16_t humidity = 100 * (buf >> 4) + 10 * (buf & 0x0F) + 1 * (buf >> 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.