Difference between revisions of "CrawlSpaceSensor"

From RevSpace
Jump to navigation Jump to search
m
m
Line 9: Line 9:
 
== Introduction ==
 
== Introduction ==
 
This is a project idea for monitoring the crawl space under a house for water ingress.
 
This is a project idea for monitoring the crawl space under a house for water ingress.
Basically looking for a nice use case to try out these nice miniature LIDAR sensors that are now available cheaply.
+
Basically looking for a nice use case to try out these miniature LIDAR sensors that are now available cheaply (about E8,-).
  
 
This things monitors the crawl space for the following properties:
 
This things monitors the crawl space for the following properties:
Line 29: Line 29:
 
* [http://www.st.com/en/imaging-and-photonics-solutions/vl53l0x.html VL53L0X] LIDAR module to accurately measure the water level
 
* [http://www.st.com/en/imaging-and-photonics-solutions/vl53l0x.html VL53L0X] LIDAR module to accurately measure the water level
 
* DHT11 or DHT22 to measure humidity and temperature
 
* DHT11 or DHT22 to measure humidity and temperature
 +
 +
==== VL53L0X LIDAR ====
 +
This module integrates a VCSEL laser, a photo diode, probably some analog circuitry and a small microcontroller to do digital processing.
 +
It has an I2C interface, but it seems you need a library from ST to get an actual meaningful distance out of it.
 +
 +
I'm not actually sure how it works exactly, it measures the time-of-flight between light sent out by the laser and received back through the photo diode.
  
 
=== Software ===
 
=== Software ===
Software tasks are: (estimated run-time)
+
 
 +
==== Measurement cycle ====
 +
Software tasks in one measurement cycle are: (estimated run-time)
 
* wake up from deep sleep (1.0s)
 
* wake up from deep sleep (1.0s)
 
* connect and authenticate to the WiFi (3.0s)
 
* connect and authenticate to the WiFi (3.0s)
Line 43: Line 51:
  
 
Initially, when no WiFi network is known, the sensor starts its own access point presenting a captive portal allowing a WiFi network to be selected.
 
Initially, when no WiFi network is known, the sensor starts its own access point presenting a captive portal allowing a WiFi network to be selected.
 
=== VL53L0X LIDAR ===
 
The module integrates a tiny VCSEL laser, a photo diode, probably some analog circuitry and a small microcontroller to do digital processing.
 
It has an I2C interface, but it seems you need a library from ST to get an actual meaningful distance out of it.
 
 
I'm not actually sure how it works exactly, it measures the time-of-flight between light sent out by the laser and receiving it back through the photo diode.
 
  
 
=== Battery Life ===
 
=== Battery Life ===
 
A typical LiFePO4 "AA" type battery has 700 mAh capacity.
 
A typical LiFePO4 "AA" type battery has 700 mAh capacity.
  
When awake, current consumption is assumed to take 100 mA on average for 10 seconds.
+
Sleep current is estimated to be about 0.10 mA total (about 80 uA for the ESP8266 in deep-sleep, about 5 uA for the VL53L0X in HW standby mode).
So each measurement takes about 0.28 mAh, allowing about 2500 measurements in total.
+
 
Doing one measurement per hour, one LiFePO4 battery charge should last for about 100 days.
+
When awake, current consumption is estimated to take 100 mA on average for 10 seconds.
 +
This means each measurement takes about 0.28 mAh.
  
Deep-sleep current is ignored in this calculation.
+
So, over one measurement cycle of one hour, we consume about 0.10 mAh in sleep-current and about 0.28 mAh in run-current, for a total of about 0.38 mAh.
 +
With a 700 mAh battery this would allow about 1800 measurements, making the battery last about 76 days.

Revision as of 10:53, 23 April 2017

Project CrawlSpaceSensor
350px
Sensor inside crawl space
Status Initializing
Contact bertrik
Last Update 2017-04-23

Introduction

This is a project idea for monitoring the crawl space under a house for water ingress. Basically looking for a nice use case to try out these miniature LIDAR sensors that are now available cheaply (about E8,-).

This things monitors the crawl space for the following properties:

  • water level (in case it is flooded), using a VL53L0X lidar sensor
  • humidity and temperature using a DHT11 or DHT22

Measurement data is uploaded once an hour over WiFi to an MQTT server.

Since there is likely no mains power easily available in a crawl space, it is battery operated.

Design

The plan is to use an ESP8266 to read the sensors, connect to the house WiFi and upload the measurement data once an hour. When not measuring, the ESP8266 is in deep-sleep mode (something like 80 uA current). Time-of-day is retrieved using (S)NTP.

Hardware

  • ESP8266 in a Wemos D1 mini board, because they're so easy to use
  • LiFePO4 battery, because they have about the right voltage for direct drive and are safe to use
  • VL53L0X LIDAR module to accurately measure the water level
  • DHT11 or DHT22 to measure humidity and temperature

VL53L0X LIDAR

This module integrates a VCSEL laser, a photo diode, probably some analog circuitry and a small microcontroller to do digital processing. It has an I2C interface, but it seems you need a library from ST to get an actual meaningful distance out of it.

I'm not actually sure how it works exactly, it measures the time-of-flight between light sent out by the laser and received back through the photo diode.

Software

Measurement cycle

Software tasks in one measurement cycle are: (estimated run-time)

  • wake up from deep sleep (1.0s)
  • connect and authenticate to the WiFi (3.0s)
  • perform an SNTP request to get the current date/time (1.0s)
  • perform a distance measurement using the LIDAR (3.0s)
  • perform temperature/humidity measurement (1.0s)
  • publish measurements to MQTT (1.0s)
  • calculate sleep time until next wakeup and enter deep-sleep (0.0s)

Total about 10 seconds per measurement cycle.

Initially, when no WiFi network is known, the sensor starts its own access point presenting a captive portal allowing a WiFi network to be selected.

Battery Life

A typical LiFePO4 "AA" type battery has 700 mAh capacity.

Sleep current is estimated to be about 0.10 mA total (about 80 uA for the ESP8266 in deep-sleep, about 5 uA for the VL53L0X in HW standby mode).

When awake, current consumption is estimated to take 100 mA on average for 10 seconds. This means each measurement takes about 0.28 mAh.

So, over one measurement cycle of one hour, we consume about 0.10 mAh in sleep-current and about 0.28 mAh in run-current, for a total of about 0.38 mAh. With a 700 mAh battery this would allow about 1800 measurements, making the battery last about 76 days.