Automatic Home Humidistat and HVAC Logger

Hemi345

Senior Member
#1
About five or so years ago I built a Humidistat based on a PICAXE 18M2 on perf board. You can find that project HERE. A couple years ago I decided I wanted to start on version 2 so I've been taking my time thinking about everything I wanted to do with it. About a year ago I noticed the operating voltage it was reporting/logging was slowly creeping up. After power outages, I noticed the voltage would be back to 4.9-5V but about six months ago it said running at 8.9VDC. I just figured there must be something wrong with the voltage reference and dismissed it until a massive hail storm took out the little DS18B20 on the side of the house. While repairing that, I measured the voltage with my multimeter and sure enough, it was nearly 9V! Amazingly everything was still running but I knew I was on borrowed time so I've been putting more effort into version 2 that will have move functionality and features.

Requirements for the new project:
1) Control the whole house humidifier based on outdoor temperature and home humidity level - like version 1 did
2) Log when the HVAC turns on/off - be interesting to see how many times it runs per day and for how long
3) Log the indoor humidity level, outdoor, return air, supply air temperatures - really curious what the supply air temp is while the furnace/AC is running
4) Transmit/upload all details wirelessly to my IoT website - because graphs are fun
5) Incorporate a cute little OLED display and buttons on the device for local changes - switchin' things up from the two digit seven segment display
6) Bonus points if I automate operating the Summer/Winter damper on the humidifier - a standard size servo and stepper motor are sitting in a box doing nothing, might as well use one of them

Even thought this project isn't finished, I'm going to post here as a build log since the blogs are no more.

Next up, details about the "return air sensor" module.
 

Hemi345

Senior Member
#2
So I begin designing a remote return air sensor module almost three years ago so I could use the I2C-based Si7006 temperature and humidity sensor. Since I2C comms shouldn't really go "off-board", I put an PICAXE 08M2 on this module to communicate the return ducting air temperature and humidity with the main humidistat (still thinking I'd continue using Humidistat v1). Then I could move the main humidstat out of the duct to somewhere more convenient. I designed the PCB with an RJ45 jack on the board so I could use ethernet cabling for easy connections. When it arrived, I soldered up everything and programmed the 08M2 to check the Si7006 sensor. Then threw it in a drawer where it sat unused for a few years. Below is the schematic and PCB pictures of it mounted in the old manual humidistat face plate and temporarily installed in the return air ductwork.
1541800841688.png 1541800937273.png return air sensor 3.jpg

I had put headers on the board for reconnecting the outdoor DS18B20 1-Wire temp sensor and another DS18B20 that I would put in the supply air ducting. I don't know why I did this, but I wired those two sensors to the ethernet jack to utilize the PICAXE on the main humidistat board to read them rather than just using the 08M2... probably because I was sorta out of ports on the 08M2 (when you factor in serial comms) and I probably had surface mount 08M2s on hand. I really should have just used a 14M2 and used it to read all the sensors.... calling it the "Remote sensor module". But I digress.

I designed the HumidiStat v2 based on utilizing this return air sensor BUT with the option of replacing this with something more simple down the road. More on that next.
 

Hemi345

Senior Member
#3
So here's the final schematic for HumidiStat v2:
1541802059193.png

What it's packing:
- NCP1117DT33 voltage regulator - provide 1A @ 3.3V
- PICAXE 20X2 called uC "A" - main brains of it all
- PICAXE 14M2 called uC "B" - will report all sensor readings to the 20X2
- DS3232M - real time clock w/ a little SRAM and temp sensor
- 24FC512 EEPROM - used to store all sorts of stuff; LCD/OLED screen text, etc.
- VOM617A optocoupler - used to determine when the HVAC is running or off.
- ASSR-1611 solid state relay - great little 6pin DIP IC popular with model train controls.
- ESP8266 - to wireless upload/log all HumidiStats (<-- see what I did there) to my IoT web site.
- enough headers and jacks to change the world

The PICAXE 20X2 will be the main processor for the system. It's connected to the VOM617A optocoupler which is used to 'sense' when the HVAC system (24VAC) turns on /off. It talks to the solid state relay to turn on/off the water solenoid on the humidifier. It will communicate over I2C to the EEPROM, RTC, OLED display, talk to the ESP8266, and drive a few status LEDs.

The PICAXE 14M2 is second in command to the 20X2. The 20X2 will issue a request to receive the latest sensor readings to the 14M2 by pulling the dedicated "RTR" pin high. The 14M2 will then transmit the readings to the 20X2 using RS232 serial comms at which point the 20X2 pulls the RTR pin back low. The 14M2 immediately reads its temp sensors and sends a request to receive the return air temp and humidity % from the 08M2 on the return air sensor module. Who then, after sending the data, also checks the Si7006 so it's ready for the next request to send. The temp and humidity readings are 10-15 seconds old when they are communicated to the 20X2, but totally adequate for this environment where things change pretty slowly. The 14M2 has a few additional pins broken out for future use, like the I2C pins. I'll probably run the stepper motor or servo off of this uC.

The DS3232M real time clock (RTC) is used to time stamp when the HVAC turns on and off, and I'll also make use of the battery backed SRAM for saving things that I want to write often and need available after a power outage but would normally wear out a normal EEPROM. Instead of using a battery to keep the time/SRAM contents during power outage, I'm using a 5.5V .33F super capacitor that is kept charged up to the VDD voltage of 3.3V. Maxim's super capacitor calculator indicates this should keep the time and SRAM contents for at least 24 hours. The DS3232M, although expensive, is nice because it utilizes MEMS instead of needing an external crystal. The time keeping is temperature compensated so it doesn't have these wild time fluctuations like the DS1307 or DS1337 I used to use. Sitting next to a HVAC system that will be very hot (when furnace is running), or very cold (when A/C is running), the DS3232M seemed like a wise idea.

The 24FC512 EEPROM will be used for storing the various labels and text for the OLED display that would easily fill up the 20X2's EEPROM or precious program memory. I've been reading about using an EEPROM for additional program slots... maybe this will be an option? At any rate, having spare nonvolatile memory available is never a bad idea.

The ESP8266 (ESP-01) is plugged into a 2x4 header and will communicate with the 20X2 over serial comms. I'll build a web interface to read the current stats and change humidity levels without having to go into the basement.

An RJ45 jack is used to connect this board to the return air sensor module. I created the footprint for the Amphenol jacks years ago for a datacenter project and I try to use these when possible because their super easy to solder and offer a robust connection with 8 pins/conductors.

Next up, a picture of the PCB and soldered in components. %101011 continued...
 
Last edited:

Hemi345

Senior Member
#4
PCBs fresh from OSHPark:
20181017_173949.jpg
I put a few headers on the back of the board to give the project a clean appearance when connecting the OLED display, buttons, etc.

Solder paste applied, parts positioned and warming up in my skillet:
20181024_222313.jpg
Out of the pan and cooling on the counter:
20181024_222854.jpg
After soldering in all the through hole parts, I started work on the enclosure. I'm using one of those water tight boxes (although no longer water tight after cutting some holes for port access). These boxes are great because they're 1) cheap, 2) very durable and 3) you can get them with a clear lid to see/show off what's inside. Only downside with them is I have been unable to find any drawings to indicate standoff spacing/placement so as with other projects I've used these on, I use a thin piece of clear acrylic screwed down to the box which allows me to place the PCB virtually anywhere I want on stand-offs.
20181030_202606.jpg
More to come...
 

Hemi345

Senior Member
#6
When the HVAC's blower fan is running, 24VAC is provided to power the humidifier. I took one wire from the 24VAC and twisted it together with one of the wires on the humidifier's water solenoid using a wire nut, then ran it to one of the "IN" terminals on the PCB (the red wire). The other wire from the 24VAC is run directly to the other "IN" terminal on the PCB (blue). Then I connected the other wire from the water solenoid to the "OUT" terminal on the PCB (the yellow wire):

testing solenoid ctrl.jpg
In the old Humidistat v1, I didn't have a way to sense when the HVAC blower was running. Now with both sides of the 24VAC coming on board, I use a diode, capacitor and high value resistor to rectify the voltage to DC. The DC voltage lights up the "HVAC ON" LED and the LED inside the optocoupler when the HVAC is running. The transistor output side of the optocoupler is pulled high using the 20X2's built-in pullups while the HVAC is off, but driven low when the HVAC is running. The blue and yellow wire screw terminals are also connected to the SSR so I can switch the solenoid on/off.

In the picture above, I toggled the SSR on without the HVAC running and realized the blue LED is ridiculously bright even with a 680ohm resistor (@3.3V)... ug. I'll have to tone that down with a black Sharpie as I don't want to muck up the board trying to resolder by hand that 0805 resistor with a higher value.

You can see the multicolored ribbon cables snaking out from underneath the board. Those are connected to headers on the backside of the board for the buttons and OLED display...

Speaking of which, the plan was to use a 0.91" 128x32 OLED display but evidently it just wasn't meant to be. I had put a header on the PCB to easily connect it (just below the screw terminal block), but after a shipping snafu on the first one, then the second arrived DOA, I picked up a little bit bigger 0.96" yellow and blue OLED display from one of my favorite Ebay sellers. Thanks to work from a few forum members here on configuration code, I had this gem up and running in no time. I think having the additional lines was the right call anyway:

oled 1.jpg
After playing around with the exposure settings on the camera, I was able to get a decent picture of it in action. You can see the date and time are pulled in from the RTC. The outside and supply air DS18B20s and the Si7006 humidity and temp sensor on return air are working well. "Z: 4" is the zone the humidity target is in (an old carryover from the Humidistat v1, doesn't mean much to anyone other than me, so I might remove it). "T: 30%" is the target humidity for the zone. I'm using calibadc to get the voltage the PICAXE 08M2 is running at... this is at the end of about 5ft of CAT5E ethernet cable. The yellow block in the upper left is a count down timer of sorts that slowly shrinks to indicate how much time is left till the screen shuts off. I've heard burn in is an issue with these displays so I have it automatically clear after ~20 seconds of inactivity by the user.

Back to working on the enclosure. I decided to mount the three buttons and the OLED in the clear plastic lid and mask about half of it using black paint (sprayed on the inside). This will allow me to still see the LEDs on the PCB but hide the wires and frame around the OLED for a cleaner look. I'll get some good pics of it and upload them next time.
 
Top