Sensor - Kvel2D/ecs193-wireless-sensor-network GitHub Wiki

Sensor: Sparkfun wtrprf ds18b20

Sparkfun wtrprf ds18b20 is a waterproofed version of the DS18B20 Temperature sensor. Because it is digital, you don't get any signal degradation even over long distances! Because each DS18B20 contains a unique silicon serial number, multiple DS18B20s can exist on the same 1-Wire bus. This allows using one pinout for placing a large number of temperature sensors. It is usable with 3.0-5.5V systems.

Install

  • The sensor has three wires, red (power line), black (ground line), and white (data line).
  • Because the sensor uses the one-wire bus interface, a 4.7k (or little less than 4.7k) ohm resistor needs to be connected with the power line and data line so that the data line has an electric current. If the resistor is too high or low, the sensor will give -127.
  • The data line connects with all sensors. The order of sensors reading is random, but the sensor.h file changes it to base on the increment order of the sensor serial number, which can only be obtained by the software.
  • For Adafruit Feather 32u4 Radio with RFM69HCW Module, where we use three pinouts, 3V, GND, and port pin2 (SDA), pinout 3V links to the power line. Pinout GND links to the ground line and port pin2 (SDA) connects to the data line.
  • If you want to know the temperature data is from which sensor, you need to use read-serial-number.ino to order and label the sensors in the real world.

Header File for Sensor

  • After finishing the installation, the create_address_book() is called in setup(). It uses the insertion sort to arrange the order of sensor readings.
  • The read_temperatures(float temperatures[]) is called to assign the temperature readings into @temperatures[]. The first reading is the lowest serial number sensor and the last is the highest.