Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Hexabus temperature sensor
Clone this wiki locally
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.
- DALLAS DS18S20 one-wire temperature sensor
- Hexabus Plug or at least Hexabus-LV board
- 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
#define TEMPERATURE_ENABLE 1and
#define TEMPERATURE_SENSOR 0.
- Flash the firmware. Have a look at Hexabusprogramming, to see how to do that.
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.
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.