Within the PhD level course Sensing, Semantics and Learning at LNU we have been working with the Arduino platform to explore the ability to formalise aspects of the real world context gathered from sensors. The main part of the course involved the sensing aspect of the title; semantics was explored to some extent through looking closer at Semantic Web technologies, while learning defined the application area in which the sensor kits have been developed. The progression from the initial workshop sessions to the final ones have resulted in two “productifications”, or sensor kits, and the idea behind this blog post is to introduce one of these along with photographs of the construction work.
This particular productification has been named Portable Modest Weather Station (PMWS). It is modest in the sense that it does not claim to be a full-fledged weather station as such; the purpose of it is to measure the relative humidity (in percentage) and temperature (in Celcius) and display the results on a small LCD screen. While the program running on the Arduino has been tailored for a particular purpose, the sensor kit has been designed with modularity in mind; sensors can easily be switched via an RJ11 socked attached on the sensor kit without opening the case. The PMWS sensor kit has been built on an Arduino Duemilanove along with the following sensors:
- SHT15 ; Relative humidity and temperature sensor.
- A potentiometer.
The SHT15 is used to collect readings from the physical environment while the potentiometer controls the contrast of the LCD display. Readings are updated once every second and presented on the LCD display. The LCD used in the PMWS is Hitachi HD44780 driver compatible, which was a requirement for the LiquidCrystal library to work. The LiquidCrystal library made the data output an easy task to realise through simple function calls, which can be seen in the PMWS code dump at the bottom of this blog post. The programming part of the SHT15 proved to be a bit more complex, but fortunately we located in this excellent blog post with a code snippet and a circuit diagram for this particular sensor. The entire kit runs on a regular 9V battery.
The first working version of the PMWS system can be seen in the figure below. In the photograph the potentiometer is located in the upper right section, while the SHT15 is located to the left of the Arduino board. As we can see, the display shows the temperature and humidity collected in real time from the SHT15.

The wiring in the above photograph had clear potential to be simplified, which is why the following step was to group and solder connections. This step was followed by discussions regarding the design of the sensor kit casing. A rectangular hole fitting the LCD display was made to the case along with holes for the potentiometer and RJ11 socket. The end result can be seen in the two photographs below. The leftmost photograph the knob for the potentiometer residing on the top of the case and the power switch on the right side of the case, while the rightmost photograph show the RJ11 socket connected to the SHT15 sensor located on the bottom of the case. In both of the photograph you can tell what the relative humidity and temperature was in the lab at the time of photography.


The construction of the PMWS show that anyone with at least some skills in programming and electronics can create their own sensor kits for a quite reasonable amount of money. The code presented in the appendix is mostly based on code snippets and examples available on the web, and wiring schemas and examples for various sensors are common on the Web. While we were several people involved in the making of the PMWS, I am confident that albeit my novice skills in electronics I eventually would have been able to construct this and similar setups on my own.
And here comes the code as promised:
// include the LiquidCrystal library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// SHT15 variables
int gTempCmd = 0b00000011;
int gHumidCmd = 0b00000101;
int theDataPin = 8;
int theClockPin = 9;
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
}
void loop() {
int val; // Temporary storage of readings
int temp; // Temperature value
int humid; // Humidity value
/***
* Temperature measurement
*/
sendCommandSHT(gTempCmd, theDataPin, theClockPin);
waitForResultSHT(theDataPin);
val = getData16SHT(theDataPin, theClockPin);
skipCrcSHT(theDataPin, theClockPin);
lcd.setCursor(0, 0);
// Farenheit
temp = -40.0 + 0.018 * (float)val;
// Conversion to celcius
temp = (temp - 32) * 5/9;
/***
* Humidity measurement
*/
sendCommandSHT(gHumidCmd, theDataPin, theClockPin);
waitForResultSHT(theDataPin);
val = getData16SHT(theDataPin, theClockPin);
skipCrcSHT(theDataPin, theClockPin);
humid = -4.0 + 0.0405 * val + -0.0000028 * val * val;
/***
* Output
*/
if (humid > 0) {
lcd.print("Temperature: ");
lcd.print(temp);
lcd.print("C");
lcd.setCursor(0, 1);
lcd.print("Humidity: ");
lcd.print(humid);
lcd.print("%");
} else {
lcd.clear();
lcd.print("Please connect");
lcd.setCursor(0,1);
lcd.print("sensor!");
}
delay(1000);
}
/***
* Code beyond this point is borrowed from
* http://www.glacialwanderer.com/hobbyrobotics/?p=5
*/
int shiftIn(int dataPin, int clockPin, int numBits)
{
int ret = 0;
int i;
for (i=0; i
