Jeremy Harris
Senior Member
I'm currently finishing the design of a new house we're building and, because it's being designed as a near-zero mean energy input house, I wanted to fit an array of temperature and humidity sensors and log the data in a form that would be easy to read on a PC. I also wanted to display the last measured sample, for ease of checking some parameters, like the water temperature or relative humidity in the living area.
The core of the logger is a 14M2, with 6 measurement channels. Data is stored on a uSD card, using the cheap, open source, OpenLog as a simple card read/write and file handling module. The OpenLog is driven with serial commands in ASCII, making it extremely easy to interface with a Picaxe. The hardest part of the project was designing temperature and humidity sensing modules that were cheap to build, accurate enough for the job and compatible with a 5V system without faffing around doing level conversion. I ended up using the same cheap Humirel sensor that's used in the rather awkward to utilise HH10D module, their HS1101. These are around £2 or so in quantities of 6, direct from China. The sensor forms part of a CMOS 555 oscillator with the frequency being read by a 08M2. This also reads a DS18B20 temperature sensor. By using an 08M2 right at each sensor I was able to build in accurate calibration and do conversion to meaningful numbers that could be squirted out of the serial port and down a three wire connection to the logger.
The logger has four channels that are directly connected to DS18B20 temperature sensors and two channels that are connected to the temperature and humidity sensor modules, so can log and display 6 temperatures and 2 relative humidity readings. In the photo below only a single temperature and humidity sensor is connected, hence all the "0 deg" readings.
The logger can record up to 16 Gb of data on the uSD card, which at the fastest sampling rate of one reading per minute would give over 4,500 years of storage capacity. The logger can have the date and time on the real time clock on board (a DS1307 with battery back up) set by simply writing a datetime.txt file to the uSD card, inserting it and the logger then reads the data when powered on and sets the clock. Similarly, the sample interval can be set anywhere between 1 sample per minute (on all channels) to one sample every 23 hours and 59 minutes, just by writing a short text file (setsampl.txt) to the uSD card. Data is stored as a comma separated value (.csv) text file that can be directly opened by most spreadsheet software, allowing easy data manipulation for creating graphics etc.
Some of the code has been adapted from contributions here and from some of the Picaxe projects, like the AXE110 data logger, and I openly acknowledge the help this has been and would like to thank the code authors. I don't pretend that my code is optimised or particularly neatly written, there are probably many different ways to do this. As neither execution speed or code brevity were important for this project I haven't bothered to seek to make it any faster or slimmer.
Hopefully the photos and pdf description below (which was written for a friend, who also wants one of these, rather than for this forum's readership) may give others a few ideas. The temperature and humidity sensor modules, in particular, have the potential to be used in other projects, as the code could easily be adapted to send ASCII values directly to a serial display or some other device, like a PC.
The core of the logger is a 14M2, with 6 measurement channels. Data is stored on a uSD card, using the cheap, open source, OpenLog as a simple card read/write and file handling module. The OpenLog is driven with serial commands in ASCII, making it extremely easy to interface with a Picaxe. The hardest part of the project was designing temperature and humidity sensing modules that were cheap to build, accurate enough for the job and compatible with a 5V system without faffing around doing level conversion. I ended up using the same cheap Humirel sensor that's used in the rather awkward to utilise HH10D module, their HS1101. These are around £2 or so in quantities of 6, direct from China. The sensor forms part of a CMOS 555 oscillator with the frequency being read by a 08M2. This also reads a DS18B20 temperature sensor. By using an 08M2 right at each sensor I was able to build in accurate calibration and do conversion to meaningful numbers that could be squirted out of the serial port and down a three wire connection to the logger.
The logger has four channels that are directly connected to DS18B20 temperature sensors and two channels that are connected to the temperature and humidity sensor modules, so can log and display 6 temperatures and 2 relative humidity readings. In the photo below only a single temperature and humidity sensor is connected, hence all the "0 deg" readings.
The logger can record up to 16 Gb of data on the uSD card, which at the fastest sampling rate of one reading per minute would give over 4,500 years of storage capacity. The logger can have the date and time on the real time clock on board (a DS1307 with battery back up) set by simply writing a datetime.txt file to the uSD card, inserting it and the logger then reads the data when powered on and sets the clock. Similarly, the sample interval can be set anywhere between 1 sample per minute (on all channels) to one sample every 23 hours and 59 minutes, just by writing a short text file (setsampl.txt) to the uSD card. Data is stored as a comma separated value (.csv) text file that can be directly opened by most spreadsheet software, allowing easy data manipulation for creating graphics etc.
Some of the code has been adapted from contributions here and from some of the Picaxe projects, like the AXE110 data logger, and I openly acknowledge the help this has been and would like to thank the code authors. I don't pretend that my code is optimised or particularly neatly written, there are probably many different ways to do this. As neither execution speed or code brevity were important for this project I haven't bothered to seek to make it any faster or slimmer.
Hopefully the photos and pdf description below (which was written for a friend, who also wants one of these, rather than for this forum's readership) may give others a few ideas. The temperature and humidity sensor modules, in particular, have the potential to be used in other projects, as the code could easily be adapted to send ASCII values directly to a serial display or some other device, like a PC.
Attachments
-
102.5 KB Views: 1,015
-
148.8 KB Views: 1,718
Last edited: