Measuring Temperature Measuring Humidity
Schematic:
Hardware
If only one AAA battery is used to power the device, its voltage should be be boosted to at least 2.7V to meet the needs of the temperature sensor and the LCD. Most of the time the μC remains in the deep sleep mode where its current consumption is about 0.7 μA. It exits this mode only when it is time to update the LCD waveform. This happens every 35 msec, which is sufficient for the LCD flickering to be not noticeable. During the sleep time the DC/DC converter is left floating and the circuit is powered from the charge accumulated on C3, which is DC/DC converter output capacitor. The voltage drop on C3 during the LCD updating period does not exceed 0.2V. Upon waking-up the DC/DC converter activates and compensates the charge drop of C3. The converter runs at 2.4 MHz frequency and starts from the battery voltage 0.9V or higher. The number of wake-ups is counted and as it reaches 60, a new measurement is performed. The measurements of temperature and humidity alternate with a 2 sec period.
The temperature is measured by Microchip TC1046 sensor, whose output voltage depends on the die temperature as follows: V(mV) = 6.25·T(°C) + 424. Since for the ADC code A with reference voltage 1.65V it holds V = A·1650 / 1024, we get the following formula: T = ((264·A / 256) - 271.36) / 4. The formula is implemented in the μC as follows:
T = (A + (A >> 5) - 269) >> 2
The temperature sensor is only powered up for the measurement and is off otherwise. This significantly reduces its power consumption.
Measuring the humidity is done by Honeywell HIH-1000 sensor which becomes my favorite one. The sensor is a part of a relaxation oscillator based on a comparator which is built into the μC. The feedback resistors are also present in the μC and turned on by software. The oscillator period is measured by using on-board 20 MHz system oscillator and Timer2 configured for the capture mode. The formula for computing the relative humidity is as follows. It also provides thermal compensation of the sensor capacitance according to the datasheet.
H(%) = (((N - NNOM)·65 + (T - TNOM)·34 + 256) >> 9) + HNOM
Here N and T(°C) are measured Timer2 value and air temperature, and NNOM is Timer2 value at humidity HNOM and temperature TNOM obtained at calibration as described below.
Similar to the previous devices, this one also turns off in darkness, thus decreasing the average power consumption down to 0.7 μA. This option can be disabled by uncommenting line #83 in the main code humi5.asm. In this case the photodiode VD1 and resistor R1 are not needed, however make sure to short cut the R1 pads on the PCB. The PCB is designed with system Eagle. The battery holder, humidity sensor and one wire jumper are mounted on its back side. The PCB is placed between the front and back panels which are cut of 2 mm plexiglass. C2 should be in 0603 package, all the other capacitors and R1 in 0402 one. Inductor L1 is TDK CPL2512TR68M.
The inductor and capacitor C3 are not needed by powering the device from a 3V battery. It could be 2xAAA or even better CR2032. This way the DC/DC converter is not used. The average power consumption is about 1.3 μA.
Back View Powering Option
Calibration:
One only needs to calibrate the humidity sensor. For this uncomment line #507 on the main code humi5.asm and let the device run for about 10 minutes. In this mode the LCD will show alternating values of the temperature, followed by the high-order byte of the oscillator period counted by Timer2, followed by its lower-order byte. This value should be put in line #5 of the code as N_NOM. Also, update line #4 with a humidity value measured by external reference hydrometer. Finally, update line #6 with the temperature value shown on the LCD. Finally, commend out line #507 and load the updated code into the μC.