This monitor senses activity and stores it on the web on a periodic basis where you can access it with any browser. Any sensor can be used such as PIR, light, sound, temperature, water, etc. It was originally designed to sense whether an  elderly parent  is awake and active in an apartment remote from the observer. This system requires an internet Wi-Fi connection.

The monitor consists of three parts:

  • An ESP8266-based Wemos D1 Mini controller
    • interrogates a sensor at  a set interval .
    • reports results to the web at a set interval only if activity level changes.
  • A PHP program (SensiMonGet) to receive data from the Wemos,  format and write a status file.
  • A PHP program (SensiMonShow) to display the status and results via a browser.
WEMOS D1 Mini + PIR Sensor Activity Monitor – 2017 Prototype

 

Program logic

Because there is no need for instantaneous reporting, the sensor is interrogated once a  second,  data accumulated and reported every 10 minutes if a change is detected.

  • Wemos interrogates the sensor status. If there is no change in status it increments the timer counter, delays 1 second and repeats.
  • If there is a change:
    • it saves the status and increments the activity counter.
    • If the timer counter exceeds 10 minutes, it formats the URL with the monitor name, status and activity counter and sends it to the web. It zeros out the activity and timer counters,  delays 1 second and repeats.
  • PHP program SensiMonGet receives parameters from Wemos (monitor name, status, activity counter).
    • It reads the status file using the monitor name and writes it to the last-status file.
    • it writes the current status information to the current- status file adding the current date ,time and IP address..
  • PHP program SensiMonShow upon query displays the last-status and current-file contents.

An example. The PIR sensor was set up in Dad’s living room. At 8 am you checked the PHP program SensiMonShow  and it showed:

===== Example of Monitor Status Lookup =====

2017/12/28 21:06:35 141.239.221.208 dad 1 24
2017/12/29 07:33:41 141.239.221.208 dad 0 3

Dec 28, 2017 09:06 pm
Dec 29, 2017 07:33 am

dad’s monitor

3 events logged in the last 10 hours 27 minutes before Dec 12, 2017 07:33 am
No events logged in the last 27 minutes 

======================================

What it means:

At 9:06 pm  last night it showed Dad triggered the PIR 24 times since the last report.

At 07:33 am the next day it showed Dad was active in the living room 3 times.

It looks like Dad went to bed after 9:06 pm and didn’t go into the living room until 7:33 am the next morning. He walked in and out of the room 3 times, likely to go to the bathroom or kitchen. It shows Dad was active in an expected pattern. No worries, he’s awake and moving around.

 

 

 

 

 

Loading