Close
0%
0%

Home environment monitor

Yet another wireless network of environmental sensors in a home

Similar projects worth following
Wirelss network of sensors for monitoring my home

Overall this is a collection of environmental sensors to monitor and control my house.

The following locations will be monitored:

  • Garage (temp, humidity, pressure tVOC) [possible expansion to monitor household current use as well as furnace oil tank level]
  • Yard (temp, humidity, pressure, solar panel output, supercapacitor bank voltage)
  • Back shed (temp, humidity, pressure)
  • Main thermostat location (temp, humidity, pressure, tVOC, battery backup voltage level, ambient light level, output demand output to furnace)
  • Master bedroom (temp, humidity)
  • Attic (ambient temp, domestic cold water pipe temp, domestic hot water pipe temp, baseboard heating return temp)
  • Office (temp, LoRa gateway)

Logging will be to Prometheus database with Grafana front end.

Control/update protocol yet to be determined

Nodes inside the house will use WiFi

Nodes outside and in back shed will use LoRa

Temp control of furnace will be a combination of inputs: user requested temp, average of interior measured temps, lower threshold for domestic water pipes. 

  • 2 × Raspberry Pi Zero W
  • 1 × Adafruit BME680 breakout
  • 1 × Rotary encoder
  • 1 × Phototransitor
  • 1 × SSD1327 OLED 1.5" display

View all 15 components

  • Temperature node initial setup - firmware/config side

    Tundra03/10/2019 at 15:43 0 comments

    After assembling the hardware, it's time to get the firmware and configuration in place. 

    Initial install of sketch is via USB upload from Arduino IDE:

    1. Plug the USB cable in, look on Arduino IDE for which port has been assigned (under Tools -> Port) and select that port
    2. Open serial monitor window
    3. Upload in Arduino IDE
    4. Hold down "Flash" button and tap "Reset" - keep "Flash" button held down until blue LED flashes and progress display in Arduino IDE shows the upload is in progress - can release "Flash" button then during upload. 
    5. After upload finishes, node will reboot itself. Do "tail -f /var/log/nginx/error.log". When the firmware checks for new sketch and spiffs, it will generate an error as the MAC address hasn't been associated with anything in the server side scripts. The error includes the MAC address - copy that to clipboard
    6. emacs /var/www/html/tempnode/sketch.php and add new entry in the initialization of the $db array for this MAC address pointing it to a specific sketch (for now I've got one sketch for temp nodes and one for the thermostat)
    7. emacs /var/www/html/tempnode/spiffs.php and add new entry in the initialization of the $db array for this MAC address pointing it to a specific configuration spiffs file. This file doesn't exist yet, next steps will define it.
    8. emacs /var/www/html/tempnode/spiffs/Makefile and a new macro for the base directory for this new node, add a new file section, add it to the all and version dependencies
    9. Copy ~/esp/home-env/tempnodes/data/office to ~/esp/home-env/tempnodes/data/newnode
    10. Within ~/esp/home-env/tempnodes/data/newnode edit the version.dat, node.txt, mquser.txt, mqpass.txt, mqhumtop.txt, mqpsitop.txt, mqtmptop.txt
    11. Now that the source directory for spiffs is configured, go to /var/www/html/tempnode/spiffs/ and do make
    12. Reboot new node to get it to load spiffs (the sketch will be the same version that was already uploaded) and confirm on OLED that the node name is picked up from spiffs configuration

  • Temperature node assembly steps

    Tundra03/10/2019 at 13:46 0 comments

    First I take a blank PCB and put 1x4 header in the BME position and two 1x8 headers in the outer ESP8266 mounting positions

    Next I place another blank PCB over to make a sandwich, keeping the loose headers in alignment, then flip the combination over to solder the bottom side.

    Inspection after soldering

    Then the top blank PCB is removed and I put the ESP8266 module in place and solder it down and trim the header leads with flush cutters

    Next the BME280 breakout is soldered down

    A round milled 1x4 header is soldered in place as a mounting point for the OLED module but this is left as a mating pair not soldered in place.

    Two 6x6x6 momentary buttons are soldered down and the completed PCB assembly is screwed down to the Hammond 1551V2WH base plate

    I put the cover on and use flush cutters to cut out two pieces so there is an opening for the micro USB cable end


  • ESP8266 OTA updates working TLS

    Tundra03/06/2019 at 12:00 0 comments

    All I have to say is that it's amazing how much better things work when you actually follow the provided working examples instead of just loosely following them. 

    Even got the local timezone being set right. 

  • Temperature node cost

    Tundra03/04/2019 at 02:52 0 comments

    I think the temperature node hardware is close to finalized so I'm curious to look at the cost to me ($25.39 ea - without tooling) and was curious to see the cost of the equivalent from another source - I found the ecobee room sensors are $75 for a two pack at Amazon (https://www.amazon.com/ecobee-Room-Sensor-Pack-Stands/dp/B00NXRYOIQ

    ItemURLPrice
    Enclosure Hammond 1551V2WH1551V2 at Arrow$1.86
    Custom PCB from JLCPCB$0.44
    Temp sensor - BME280 from Amazonhttps://www.amazon.com/gp/product/B0118XCKTG$9.49
    ESP8266https://www.amazon.com/gp/product/B01MU4XDNX$8.50
    2 pcs 6x6 microswitchhttps://www.amazon.com/gp/product/B071KX71SV$0.1
    USB wall wartNot sure where I got it$5
    Total permanently installed (not including tooling, prototypes, etc)$25.39
    OLED module as needed (not permanently installed)https://www.amazon.com/gp/product/B0761LV1SD$5.49

  • ESP8266 OTA updates update

    Tundra03/03/2019 at 23:17 0 comments

    I've had a lot of difficulty getting OTA updates to work over HTTPS, so I'm falling back to HTTP for now. I've got it updating the sketch efficiently (meaning, using stock code to check md5sum of file and not bothering to update if the md5sum is the same) using the example code - however I'm not yet getting the spiffs to use the same logic - it's loading every time the ESP8266 boots. 

  • Workaround for ordered boards

    Tundra03/02/2019 at 22:56 0 comments

    It's a bit of a kludge, but here is a board (top in this pic) assembled to work around the mistake with orientation of the header for OLED - reverse the stack up and flip the board (thanks David for pointing out the way to do this). I think most of the time I'll operate without the OLED plugged in so this won't really matter much.

  • First mistake found on the ordered circuit board

    Tundra03/01/2019 at 02:04 2 comments

    This won't stop me from using these circuit boards either without OLED or in other projects outside of the 1551V2 enclosure; but I found a stupid mistake while soldering the first one up. I got the orientation of the OLED i2c header rotated by 180 degrees. The i2c header for the BME280 breakout board is wrong too but that turns out to be a good mistake as I didn't allow enough vertical room for it to be mounted with a 90° header like I planned, so mounting it the "wrong orientation" works fine. The OLED however is upside down and would stick out of the enclosure. Oops. The good news is that I can just leave it off normally and take the cover off and plug it in when needed.

    Soldered up board with OLED installed

  • Circuit Boards are in

    Tundra03/01/2019 at 00:26 0 comments

    Order arrived, rough mechanical fit looks good so far. It also fits in the 1551V size 2 enclosure nicely.

  • Circuit Boards are in

    Tundra02/28/2019 at 23:23 0 comments

    Order arrived, rough mechanical fit looks good so far. It also fits in the 1551V size 2 enclosure nicely.

  • Sensor Node PCB ordered

    Tundra02/21/2019 at 12:50 0 comments

    I used EasyEDA to design and order through JLCPCB a PCB for the sensor nodes to fit into the Hammond 1551V size 2 enclosure. I could have done the minimum order of 5 boards for $2 (and probably will go that route when it comes time to order a board for Dwalin), but since I can easily see using 5 of these, I wanted to have plenty - so I ordered 30 for a total cost of $13.05 shipped w/ DHL. 

    I set it up for I2C to two different headers, one with the pinout for the OLED modules I have and one with the pinout for the BME280 breakout board module I have - between them they don't have the same pinout for Vcc and GND. I set up for either two pushbuttons or for an encoder. I set up a serial port (GND, Vcc, TX, RX). I also set up a second set of headers inboard of the headers for the ESP8266 module (it's roughly Wemos D1 mini sized, but slightly smaller), and finally a 2x3 header to bring out a second set of pads for the pins I'm not making any use of. 

    Since this board has at least two pads for every pin, I think I'll be able to use this for prototyping other projects in the future. 

View all 32 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

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