Home Automation with NodeMCU

Modify your gas furnace thermostat and electric hot water heater controls and save $750+/year

Similar projects worth following
This is the first of many NodeMCUs I am using to save $1,000+/year total. All programs uploaded wirelessly and web page HMIs used for monitoring and control. Adafruit MQTT used for recording data. Upgraded from Arduino Uno. NodeMCU records furnace operation every hour. Complete details are here: Furnace ON seconds per day is sent to a Google cloud spreadsheet and used to calculate furnace cubic metres of natural gas used per degree day furnace efficiency. That number greatly improved from 0.6 to 0.4 with longer furnace run times. Furnace is either OFF or ON for 1/2 hr+ now. I was thinking of switching to a gas water heater but it would cost $3,000. Only heating at the new ultra low 2.8 cent/kWh Time of Use overnight is cheaper than gas. More expensive gas water heaters would be obsolete here. Saves $150+/yr. Electric water heaters are quiet, don't need holes in the wall, are far less expensive and much easier to install

My projects are all documented here

For two reasons.

1. Many people assisted in helping me to get all the microcontroller functions working. I put links to all their help in one location for others to use. Pay it forward.

2. To assist myself in the future when I forget how I got one of the functions working.

The gas furnace and water heater mods are set up with normally closed relays. The new functions open the relays. If you unplug the microcontroller the relays close and it goes back to the original thermostat and hot water control. The gas furnace thermostat mod only prevents furnace operation for up to an hour in any case so it will not prevent the furnace from operating for any great length of time.

  • 1 × LoLin V3 NodeMCU12E - I prefer this 3.3V board since it includes 5V VU output from the USB charger to power relays.
  • 3 × 17X10 protoboard. I mount the NodeMCU board across two of them. This makes it easy to wire and creates two isolated areas .
  • 1 × 4 channel relay
  • 1 × photoresistor to detect furnace ON LED so no electrical connection between furnace and NodeMCU
  • 1 × telephone jacks and cords for remote sensors

View all 15 components

  • Switching from DHT22s to BME280s

    nodemcu12ecanada12/07/2023 at 16:59 0 comments

    I was having issues with my DHT22 humidity sensors which also include a temp sensor. Random very high values. Apparently the sensors don't last forever. The humidity sensors are used to determine when to open the windows in the basement in the summer to greatly reduce the humidity. Without a noisy, kWh guzzling dehumidifier. It's not obvious when it's a good time to open or close the windows.

    I have two of them on one controller for upstairs and downstairs. There is a separate one of a different type, SHTC3, outside on a separate microcontroller. I only use DS18B20s for critical temp sensing used for control.

    The sensors each take up one input with some dedicated DHT22 protocol.
    With the new I2C sensors I free up those two inputs. It's better to use the limited NodeMCU I/O for a bus to talk to various devices instead of each device taking up dedicated I/O.  Two inputs with I2C talk to many devices. 

    One input using the OneWire protocol talks to many DS18B20 temperature sensors. With multiple temp sensors it's much more reliable to use the unique 64 bit sensor address method. Otherwise I found temps can be mixed up occasionally.

    I looked around for some I2C humidity sensors. There are quite a few different ones.
    If you use I2C sensors they don't take up any new I/O if you put the data lines in parallel with the ones used for the clock. Many different sensors as well as digital and analog I/O expanders can go on the same two I2C inputs.

    Different types of sensors have different I2C addresses so there is no conflict.
    The issue I had was I want to use two of the same I2C sensors on the same I2C inputs.
    One way is to get an I2C multiplexer chip that selects which device to talk to if they have the same address.
    Another way is to get a sensor where you can change the I2C address. This is what I did.
    Putting 3V or Gnd on one of the pins changes the address.
    This sensor not only does humidity but also temp, pressure and altitude which is interesting. 

    It can tell if you lift it up a couple of feet based on the slight change in air pressure. 

    Altitude, instead of pressure, is used to determine if the trend is high pressure (lower than actual altitude reading) or low pressure (higher than actual altitude reading). High pressure can indicate good weather and low not so good.

    I got 3 of them for $12. I always buy more than I need for stuff worth next to nothing in case I smoke a few. Or there is a defect. 

    I followed this website to work with multiple BME280s. Not waterproof like DS18B20s.
    Tiny little board. The actual sensor is a teeny tiny 2.5mm cube.
    New sensors usually need you to load a new library if it isn't already included with Arduino IDE.

View project log

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates