Measuring the Temperature and Humidity with a SHT11 sensor
Posted by ego on August 09 2009 16:32:05
The idea behind this poject is that the humidity in the cellar is very high in summer. I thougt this is a good starting point for a new project. At first I decided to use the FOST02 sensor from Hope RF, later I used the sensirion SHT11 sensor. This sensor has a two wire interface to the microcontroller. A MC68HC908GP32 is used as controller. The GP32 has more than enough I/Os and the TBM module which can wake up the controller from stop mode every second.he circuit should be powered by batteries, so current consumption has to be reduced to a minimum. Other microcontrollers need less power than the 68HC908GP32 but I wanted to do it with parts that I already have. .So most of the hardware was selected, the controller, the SHT11 sensor and an LCD to display the values. A little more thoughts wre made on the power supply. I had no step up regulator, so I looked which kind of switching regulators I have. I had a few LM2936 regulators n the box. This regulator support 5V and only needs 15 ĩA quiescent current, this semed pretty good for my porject. The Sofware is always running the main loop and enters stp mode. After a second the controller is waked up by the TBM module and starts the loop again. Having a tic every second I decided to implement a clock too.

It looks ike this.

I broke up the schematic in two parts. At first the general GP32 circuit:

I chosed a 32,768 kHz quarz, so that I can se the TBM module. The CPU clock is generated by the PLL.

The rest of he shematic looks like this:

The thee switches are used to switch on the backlight of the LCD and to set the time. The backlight of the display is driven by a transistor because the port pin canīt sypply enough current. The display is used in 4 Bit mode.

The software bases on a library that I found here. The SHT11 sensor can bebought ati .

With a few modifications the software worked on the HC08. So the Software is running a loop every second and displays the clock, every 5 seconds temperature and humidity are measured and displayed. The controller needs a current of approx 0,1 mA in Stop mode and the hole circuit aprx. 0,6 mA. So the display needs most of the current and I didndīt optimized the rest of the circuit anymore. Current consumption could be further reduced by reducing the run time of the Controller. I use floating point calculations, usng integer math would be faster. After all the circuit is running two weeks with a 9,6V accu with 750 mAh and the result is ok for me, The software is here as a Codewarrior 6 Projekt
As an expansion the mesured values could be logged in unused FLASH memory and later transfered to a PC using the SCI.