WeatherBox


WeatherBox Datafeed

I added a thermometer to my outdoor solar shower, and a bit more. Table below shows the the most up-to-date data coming out if it:

Parameter
Value
Unit
Last update14/02/2017 09:07:08
Air temperature24C
Air humidity31%
Water in showerYes
Water temperature23C
Light illuminance135900lux
Radiant flux 1070W/m2

Sensors

Box stowed in relative dry, under deck. Alu angles (and mounting angle) shed any incident water. Blacks leads are from the various sensors mounted on shower.

The WeatherBox is just a mash-up of relatively simple arduino (Uno)-based circuits/ sensors:

Water Sensor and Water Temperature

The water sensors (water presence and temp) required some modification of the solar shower storage with this contraption:

Contains the water sensor and water temp sensor. LDR lux meter to the right.

Water Presence Sensor

Uses circuit similar to a soil moisture sensor I cribbed from here, similar to that used on the leak-o-meter.

Water Temperature with a Thermistor

Used this Adafruit tutorial to work out how to use a thermistor with arduino.

I learnt about the Steinhart- Hart Equation, which was the interesting and provides a way to estimate temperature from thermistor resistance. Weird how both authors of the equation have ‘hart’ in their names. Stein means rock in German. Hart just means hard: Mr Stonehard (maybe Hardstone?) & Mr Hard. Prof. Steinhart, died in 1991 and Hart is still around. Steinhart, seemed like a nice guy. His memorial states he was the University of Wisconsin-Madison’s most colorful and well-liked faculty members and that [it was] impossible for him to be dull. Oddly both Steinhart and Hart were/are involved primarily with geophysics, rather than electronics. Their 1968 paper,  Calibration Curves for Thermistors, was published in Deep-sea Research and Oceanographic Abstracts.

Water sensor mount

Air Temperature and Humidity

This uses a DHT11 chip which converts analog temperature and humidity readings to a digital reading for Arduino digital pin input. Unfortunately this chip only gives you temp and humidity to nearest degree/ percent. Also, for some reason its accuracy seems to be questionable – I need to look into that, might have wired or coded something wrong.

Illuminance (Light)

LDR-based lux meter. The LDR is at tip, wire runs down inside brass pipe. All gunked up with silicone.

I am measuring incident light as illuminance, using two calibrated light dependent resistors at each end of my solar heater and averaging the values. It is a simple circuit, but understanding the physics, photometry (as opposed to radiometry, which is kind of what I wanted) and calibrating it took me a while. I found this website pretty good as a summary. I ’empirically’ calibrated the two LDRs I had, against a Project Tango device (which seemed the most convincing of the ones I had which all max-ed out at 33k LUX). I think I need to do this again though since number appears to be erratic now.


Data Transmission

The weather data is sent wirelessly using a 433MHz RF transmitter to a receiver indoors which is hooked up to my (arduino-USB-android) Doggy Door Opener system. The range is pretty good – up to 20m through the house (walls).

I used the virtualwire library for this. Below is an excerpt of the Arduino c++ code. I convert numeric data into an array of longs (4 bytes with Arduino) and then convert this to byte array. Max message length for virtualwire library is thirty-something bytes.

void loop()
...
	const unsigned int N = 6;
	long dataArray[N];
	dataArray[0] = (long)(100.*waterTemp);
	dataArray[1] = (long)(100.*dhtData[1]);
	dataArray[2] = (long)(100.*dhtData[0]);
	dataArray[3] = (long)(100.*dhtData[2]);
	dataArray[4] = (long)ldr1Lux;
	dataArray[5] = (long)ldr2Lux;

	// message length is:
	// water present: 1 byte
	// data: 4x6 = 24 bytes. long is 4 bytes.
	// TOTAL: 25 bytes.
	// convert dataarray into a char array.
	const unsigned int MSG_BYTES = N * 4 + 1;
	uint8_t dataToSend[MSG_BYTES];
	dataToSend[0] = waterPresent;
	for (int i = 0; i < N; i++) { 
              longToBytes(dataArray[i], dataToSend,1+ i*4); 
        } 
        // send down (virtual) wire 
        vw_send((uint8_t*)dataToSend,MSG_BYTES); 
} 

void longToBytes(long num, uint8_t arr[], uint16_t start_index) { 
	arr[start_index] = (uint8_t)((num >> 24) & 0xFF);
	arr[start_index+1] = (uint8_t)((num >> 16) & 0xFF);
	arr[start_index+2] = (uint8_t)((num >> 8) & 0xFF);
	arr[start_index+3] = (uint8_t)(num & 0xFF);
}

The data, received by the Doggy Door Opener unit, is displayed on a Hitachi 16×2 character LCD screen, because I can (and I had one lying around). The custom characters on the ‘water info’ screen indicate whether there is water in the shower or not.

WeatherBox data on remote (indoor) Doggy Door Opener unit

The data is also sent via USB to Doggy Door Opener Control (android) app. The app uploads time-averaged data to a Google Sheets spreadsheet every 5 minutes using principles described here and in this android library; a hack of Google Forms – this facilitates keeping a record of the information and present ‘live’ information in the table and graphs at the top of the page. I used the Inline Google Spreadsheet Viewer WordPress plugin to show the table data, and just an iframe from Google Sheets for the chart.


Todos

  1. Either mount the solar shower heating array on the roof (with the LDRs), mount another separate LED on roof so I get an unshadowed illuminance reading…or cut down trees that cast shadows
  2. Add anemometer (wind)
  3. Add barometer (pressure)
  4. Sort out erratic Lux values – we had had terrible wet weather and water has perhaps got into the LDR sensor wires affecting resistances.
  5. Investigate DHR11 chip – seems to say RH=30% whatever the weather.
  6. (2017-01-24) Water present sensor on the blink – moisture wicking I think, see below, except in my system water is pushed through encapsulated wire by water pressure in shower system. And yes, this could be a bit of a problem for my ‘Inside of Assembly‘.

Moisture wicking (image from http://www.dsmt.com/products-and-services/moistureblock/)