Mechanical, electrical, and firmware files for a rugged and submersible temperature, pressure, and relative-humidity sensor
Haar in Ben Bhraggie Woods, Sutherland, Scotland. Photo by Andrew Tryon.
Project Haar takes its codename from the North Sea fogs that roll across Britain. Bobby Schulz designed it after the consistently-near-0C temperatures and 100% relative humidity of Chimborazo Volcano, Ecuador, claimed the lives of many brave but misguided BME-280 units, who then catastrophically bricked their I2C buses and those of their associated data loggers, thus taking down a large fraction of our hydromet network.
Determined to avoid future issues with persistently condensing humidity, we worked to design a unit that would survive in this environment, and indeed, withstand full submersion.
![Haar bare board](/NorthernWidget-Skunkworks/Project-Haar/raw/master/Documentation/images/Haar_v010_top_annotated_20200427.png)
- Microcontroller (computer) core
- ATTiny1634
- Firmware written in Arduino-compatible C++
- Firmware upload via a 0.05" (1.27 mm) pitch 2x3 ICSP header
- Sensors
- Relative humidity and temperature sensor: SHT35-DIS-F2.5KS with PTFE membrane for water and dust protection
- Humidity
- Range: 0--100%
- Accuracy: ±1.5%
- Resolution: 0.01%
- Long-term drift: <0.25%/yr
- Temperature
- Range: -40--125 °C
- Accuracy: ±0.2 °C
- Resolution: 0.01 °C
- Long-term drift: <0.01 °C/yr
- Humidity
- Atmospheric pressure and temperature sensor: LPS35HW
- Pressure
- Range: 260 to 1260 mbar
- Accuracy, calibrated: ±1 mbar
- Accuracy, uncalibrated: ±4 mbar
- Resolution: 1/4096 mbar (approx. 0.00024 mbar)
- Temperature
- Range, full accuracy: 0 to 60 °C
- Accuracy: ±1.5 °C
- Resolution: 0.01 °C
- Pressure
- Relative humidity and temperature sensor: SHT35-DIS-F2.5KS with PTFE membrane for water and dust protection
- Connections and communications protocols
- Power
- Voltage limits: 3.3V ~ 5.5V
- Power consumption:
- Peak = 5.21mA @ 3.3V
- Sleep = 0.524 mA @ 3.3V
- Mean (5 Hz sample rate) = 0.583 mA @ 3.3V
- Mean (1 Hz sample rate) = 0.780 mA @ 3.3V
- Submersible with its Gore-Tex sealed housing
- Entirely IP67 or greater rated components
- Response Time
- Temperature: Ď„ = 377s
- Humidity: Ď„ = 505s
- Pressure: Ď„ <1s
- Programmable using the Arduino IDE https://www.arduino.cc/en/main/software
- Firmware available in this repository.
Haar_Firmware.ino
is the standard firmware to be used. - Software to use this sensor with Arduino-compatible devices
- Open-source licensing via GNU GPL 3.0
- Low-VOC conformal coating as recommended on Page 3 of the humidity and temperature sensor data sheet. We used Dow Corning 1-2577 Low VOC Conformal Coating.
- Fully sealed housing with removable breathable-membrane (IP68) vent
Warning
If applying conformal coating, ensure none comes in contact with the sensor orifices themselves, see Senserion Handling Instructions example
Assembling this sensor is possible by hand with sufficient skill and the following tools:
- Temperature-controlled soldering iron
- Hot-air rework station
- Equipment for stenciling with solder paste
- ESD-safe tweezers and workstation
- Solder wick
Many components on this board are fine pitch and/or have difficult to access pads. However, there are not very many components. We would suggest hand assembly using tweezers, stenciled solder paste, and a hot-air rework station. A soldering iron will be helpful -- if not outright essential -- for attaching the "Hard Mount" plug and (if desired) the 2x3 pin ICSP header to upload the firmware.
After finishing the main board assembly, solder the HardMount plug onto the four SMD pads with the notch (for plug orientation) at the bottom side of the board.
Two different housings have been designed to be used in different situations depending on how much robustness is required by the sensor. Closed: For maximal robustness a sealed IP67 rated housing was designed. This housing can be constructed using FDM printing with ABS plastic and acetone smoothing - an FDM optimized version of the design was made featuring an eyelet to hang the enclosure from during the smoothing process. However, results will be significantly better with PA12 SLS nylon - readily available from many print houses.
Open: For maximal responsiveness an open structure enclosure was designed to allow airflow while still protecting the sensor from mechanical damage. This enclosure has been tested with FDM and SLA printing, methods will depend on your desired material properties.
- Sealing plug with cable such as this -40 degree PVC-jacketed one or this set of Digi-Key search results for all those that are 3 meters or less in both -40 degree rated PVC and in ; these come in a variety of lengths from 0.6 to 20 meters (Digi-Key search results). You may also attach a plug to your own cable. Note that I2C communications become iffy for any cable longer than 3 meters.
- 3D-printed housing barrel, tapped (see below). We recommend light-colored plastic to reduce radiative heating.
- 4-pin HardMount plug
- Amphenol breathable vent
If it is not already attached, you will need to solder the 4-pin HardMount plug onto the four SMD pads at the end of the board far from the isolated humidity sensor. You should do so with the notch (for plug orientation) at the bottom side of the board.
Our recommendation for by-hand assembly:
- Add small pillows of solder to each of the four pads, enough to create contact with the HardMount solder cups but not so much that it is not possible to slide the HardMount plug over them.
- Slide the HardMount plug on; it will take a bit of finesse to keep it from being pushed off of the solder pillows.
- Using some Blu Tack (or equivalent), fix the board and HardMount plug in place
- Double-check that the notch in the HardMount plug is on the back side of the board
- Solder on the first connection
- Check whether the board is straight; reflow the solder as needed until the connection is secure
- Solder the second connection
- Flip the board, ensuring that it is straight (if not, make changes)
- Solder the other two solder-cup connections
Tip
Sometimes the 3D printed threads are not sufficiently fine to work smoothly. In this case, you can 'repair' the threads using a metal tap.
The cable side thread is an M16 x 1.5, and the vent side is a M12 x 1.5 - More economical taps can be found, these placed here for referance.
Here we assume that you are using [standard Alpha Wire cables with waterproof attachments](Alpha Wire 5004C. Because of the wire insulation colors available for these cables and the locations of their attachment points to the 4-pin "HardMount" plug (3D drawing), our HardMount devices do NOT match standard wire-color definitions (or any kind of standard). Wire-color definitions are:
![Haar Connector Pinout](/NorthernWidget-Skunkworks/Project-Haar/raw/master/Documentation/images/Pinout.png)
Color | Connection |
---|---|
Brown | V+ (3.3-5.5 V) |
White | GND |
Black | SDA |
Blue | SCL |
For reference, these are the definitions of the four pads to which the HardMount connector attaches:
- Top left: SDA
- Top right: SCL
- Bottom left: VCC (3.3V to 5.5V)
- Bottom right: GND
Go to https://www.arduino.cc/en/main/software. Choose the proper IDE version for your computer. For Windows, we suggest the non-app version to have more control over Arduino; this might change in the future. You will have to add custom libraries, so the web version will not work (at least, as of the time of writing). Download and install the Arduino IDE. Open it to begin the next steps.
To install firmware on the Haar board, you use the 2x3-pin 6-pin ICSP (also called ISP) header with a special device called an "in-circuit system programmer" (or just "in-system programmer; yup, that's what the acronym stands for).
Many devices exist to upload firmware, including:
- The official AVR ISP mkII (no longer produced but available used)
- Using an Arduino as an ISP
- The versatile Olimex AVR-ISP-MK2 (recommended)
- The Adafruit USBtinyISP
Important
The Haar has a half-sized (0.05" pitch) ICSP header. Therefore, you will need to have the appropriate 2x3-pin header to form a connection - see detailed assmbly instructions.
Note
Frequently on Windows machines the driver configuration of the ISP programmer can become problematic. See discussion of how to get drivers and the use of Zadig to configure them in this Sparkfun Guide
Using this ISP, upload (as of the time of writing): the Arduino sketch in this folder. To do so, follow these steps:
- Open the Arduino IDE.
- Follow these instructions to install the ATTinyCore board definitions
- Select ATTiny1634 (No bootloader)
Caution
Check your ISP target voltage before you connect! Make sure the target voltage is set to 3.3v, 5v can damage the sensor irreparably
- Plug your ISP of choice into your computer (via a USB cable) and onto the 6-pin header. There are two ways to place it on; the header is aligned such that the ribbon cable should be facing away from the board while programming. If this fails without being able to upload, try flipping the header around. This should both power the board and provide communications.
- Go to Tools --> Programmer and select the appropriate programmer based on what you are using.
- Go to Tools --> Burn Bootloader. Yes, we know that you just selected "ATTiny1634 (No bootloader)", but this step sets the fuses, which configure their internal oscillator and brown-out detection.
- Go to Sketch --> Upload Using Programmer. After several seconds, you learn whether you succeeded or failed. Hopefully it worked!
Uploading using the in-system programmer.
Note
Linux Users: You must supply permissions to the Arduino IDE for it to be able to use the ICSP, or you will have to run it using sudo
. The former option is better; the latter is easier in the moment.
Once the is bootloaded and connected with a LiDAR Lite sensor, you should be able to use any standard Arduino device to connect to it and read its data.
This code is intended for any generic Arduino system.
// Include the Haar library
#include "Haar.h"
// Declare variables -- just as strings
String header;
String data;
// Instantiate class
Haar myTPRH;
void setup(){
// Begin Serial connection to computer at 38400 baud
Serial.begin(38400);
// Obtain the header just once
header = myTPRH.getHeader();
// Print the header to the serial monitor
Serial.println(header);
}
void loop(){
// Take one reading every (10 + time to take reading) seconds
// and print it to the screen
myTPRH.updateMeasurements();
data = myTPRH.getString();
Serial.println(data);
delay(10000); // Wait 10 seconds before the next reading, inefficiently
}
The Margay data logger is the lightweight and low-power open-source data-logging option from Northern Widget. It saves data to a local SD card and includes on-board status measurements and a low-drift real-time clock. We have written a library to interface with the Margay, which can in turn be used to link the Margay with sensors.
// Include the libraries
#include "Margay.h"
#include "Haar.h"
// Declare variables -- just as strings
String header;
String data;
// Instantiate classes
Haar myTPRH;
Margay Logger; // Margay v2.2; UPDATE CODE TO INDICATE THIS
// Empty header to start; will include sensor labels and information
String Header = "";
// I2CVals for Haar
uint8_t I2CVals[] = {0x42}; // DEFAULT
//Number of seconds between readings
uint32_t updateRate = 60;
void setup(){
Header = Header + myTPRH.getHeader();
Logger.begin(I2CVals, sizeof(I2CVals), Header);
initialize();
}
void loop(){
initialize();
Logger.run(update, updateRate);
}
String update() {
initialize();
return myTPRH.getString();
}
void initialize(){
myTPRH.begin();
}
Currently nearly identical to Margay code, by design. Add telemetry with Particle Boron.
// Include the libraries
#include "Okapi.h"
#include "Haar.h"
// Declare variables -- just as strings
String header;
String data;
// Instantiate classes
Haar myTPRH;
Okapi Logger;
// Empty header to start; will include sensor labels and information
String Header = "";
// I2CVals for Haar
uint8_t I2CVals[] = {0x42}; // DEFAULT
//Number of seconds between readings
uint32_t updateRate = 60;
void setup(){
Header = Header + myTPRH.getHeader();
Logger.begin(I2CVals, sizeof(I2CVals), Header);
initialize();
}
void loop(){
initialize();
Logger.run(update, updateRate);
}
String update() {
initialize();
return myTPRH.getString();
}
void initialize(){
myTPRH.begin();
}
This sensor was tested for using an impulse for each variable (temperature, pressure, humidity) and for each housing type (closed, open). The details of each of these evaluations can be found in the testing documentation: Temperature, Pressure, Humidity. A summary of these results, along with visuals of the step response, is presented here.
Approximate time to equilibrium for each variable and sensor type
Sensor | Temperature | Pressure | Humidity |
---|---|---|---|
Control | 105s | <1s | 18 min |
Haar, Closed | 75s | <1s | 31.75 min |
Haar, Open | 12.5 min | <1s | 10.25 min |
This response time information should serve as a guide to the choice of housing. In situations where very fast response time is required and the sensor will not be subjected to environmental extremes (e.g. in a radiation shield on a meteorological station) an open housing can be used. However, in cases where the hazards of the environment are a priority (e.g. a sensor in the flood plane of a river to calibrate a depth sensor) a closed housing should be used.
Support for this project provided by:
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.