Hexabus temperature sensor

eBrnd edited this page Jun 2, 2012 · 7 revisions
Clone this wiki locally

Abstract

It's rather simple to fit a temperature sensor to a hexabus plug. Based on the work started by Mathias, I threw together a working prototype.

Materials needed

  • DALLAS DS18S20 one-wire temperature sensor
  • Hexabus Plug or at least Hexabus-LV board

How to

  • Find the header ST1 on the Hexabus-LV board, we'll be using the pins 7, 9, 10.
    • pin 7 is PA6 (pin 31 at the microcontroller), this is where the DQ pin (2) of the DS18S20 goes
    • pin 9 is GND, connect this to pin 3 of the DS18S20
    • pin 10 is VCC, connect this to pin 1 of the DS18S20
  • Check out the branch "development".
  • Edit the file hexabus/firmware/contiki-2.x/platform/Hexabus-Socket/hexabus_config.h to set #define TEMPERATURE_ENABLE 1 and #define TEMPERATURE_SENSOR 0.
  • Flash the firmware. Have a look at Hexabusprogramming, to see how to do that.

Issues

Supply voltage

Make sure you have modified your Hexabus-LV board to run on 3.3V (see Supply-modification-the-Low-Voltage-board for reference), otherwise the DS18S20 sensor may give (very!) false readings. At room temperature it seems to work anyhow, so if you intend to stay under circa 50°C, the 3.3V modification is probably not required.

self-heating

When installing a DS18S20 as proposed in this article, you will measure too high temperatures. Reason for this is probably heat from the board, which is either conducted via thermal radiation or the leads of the sensor. Extending the leads with some wire (5-10 cm) and placing the sensor outside the plug enclosure helps to reduce the error.

How it works

When booting, the plug scans the bus for temperature sensors. If a sensor is found, the measurement can be queried at EID 3. If configured accordingly, the measurement can be automatically broadcasted. If no sensor is found, it behaves like a normal plug.

closed hexabus plug with temperature sensoropen hexabus plug with temperature sensor