Jump to content


ebuild is sad to announce its closure - it has become too time and resource intensive to develop, manage and maintain.

However, ebuild will remain on-line in archive mode (ie no posting facilties) for several weeks so that users can use it as an information resource.

Using Relative Humidity To Sense Occupancy


  • Please log in to reply
11 replies to this topic

#1 DamonHD

DamonHD

    Advanced Member

  • Members
  • PipPipPipPip
  • 1,046 posts
  • LocationLondon, UK

Posted 01 November 2015 - 10:41 AM

We've had this discussion before, but yesterday I crunched some numbers from some of my data, sampling in particular the entire months of January, August (with a holiday in it) and October albeit only for the one room where I have had an RH% sensor until now.

http://www.earth.org...151031DHDNotes/

I have a couple of motivators, one of which is to improve occupancy sensing for the in-building element of our IoT Launchpad project, as well as OpenTRV.

In any case, the simple heuristic that seemed to give the best fit, eg no false positives in holiday time, and mainly plausible times for other occupancy detection, eg as cross-checked with time of day and my diary, was that quickly rising RH% (>2%/h) suggest occupancy.

I have added a few lines of code to that unit to add that heuristic to the existing ones, to see how things improve or otherwise.

ST: thanks in particular to your observations of the correlation of RH% with CO2 with occupancy.

Rgds

Damon

PS. The all-in-one valve units that we are finally tooling up for include RH% sensors, as do the simple in-building sensor units that we are just kicking off.

Edited by DamonHD, 01 November 2015 - 10:42 AM.


#2 SteamyTea

SteamyTea

    Advanced Member

  • Members
  • PipPipPipPip
  • 4,322 posts
  • LocationCornwall

Posted 01 November 2015 - 10:47 AM

Does it take into account any tipping points.

Something along the lines that in an old house, which may be cold during the day, there is a possibility that condensation forms, changing the overall RH, and when the heating comes on again, it may pass the dewpoint but be quite a delay before the RH changes (may in fact seem to drop).

I shall try and look at my bedroom data that has had a sensor in if most of the year and see what I can filter out (as I know what my usual bedtime is).
Trouble is I have a fairly good house, in a fairly mild climate and I leave the door open.

#3 DamonHD

DamonHD

    Advanced Member

  • Members
  • PipPipPipPip
  • 1,046 posts
  • LocationLondon, UK

Posted 01 November 2015 - 11:01 AM

At the moment my results are fragile based on one room's worth of data. Support or counterclaims welcome.

I may in any case want to eliminate apparent occupancy when temperatures are falling too.

This does not need to be perfect, but it's not entirely clear to me how good "good enough" has to be for the various possible deployments.

I'm trying to bake in as few magic numbers as possible.

Rgds

Damon

Edited by DamonHD, 01 November 2015 - 11:04 AM.


#4 SteamyTea

SteamyTea

    Advanced Member

  • Members
  • PipPipPipPip
  • 4,322 posts
  • LocationCornwall

Posted 01 November 2015 - 11:11 AM

Can you build in Bell's Inequality Test, I am told it is simple to implement, but know little about it as it is usually used in the quantum world.
The usual test for this sort of thing would be a Chi Square. That just compares what you expect to happen (the guess that RH goes up when people are in the room) and what actually happens, the test results when either, you know someone goes in the room, or, you don't know if someone is in the room or not (much harder that one).

#5 DamonHD

DamonHD

    Advanced Member

  • Members
  • PipPipPipPip
  • 1,046 posts
  • LocationLondon, UK

Posted 01 November 2015 - 11:16 AM

If I knew any stats, then maybe I could!

I have looked out for false positives and false negatives in the month-long samples that I used.

Whatever the actual implementation is, it has to be fairly simple-minded for the 8-bit microcontroller and limited stats infrastructure ie gathered already.

Rgds

Damon

#6 SteamyTea

SteamyTea

    Advanced Member

  • Members
  • PipPipPipPip
  • 4,322 posts
  • LocationCornwall

Posted 01 November 2015 - 11:33 AM

Really a simple one
Part 1:
E = (N++ + N--N+-N-+)/(N++ + N-- + N+- + N-+)
Part 2:
S = E(a, b) − E(a, b′) + E(a′ , b ) + E(a′, b′)

Really just looks for simultaneous results, so should automatically filter out stuff that is wrong.
It is really just to do with the sampling rate and the standard errors, which take up a fair bit of processing power normally.
Seems to be a faster method that using Bayesian and look up tables.

They use it to test if entangled photons really are entangled and not been tampered with.

Edited by SteamyTea, 01 November 2015 - 11:38 AM.


#7 SteamyTea

SteamyTea

    Advanced Member

  • Members
  • PipPipPipPip
  • 4,322 posts
  • LocationCornwall

Posted 01 November 2015 - 12:36 PM

Seems that it is my shower that swamps everything.
Can't find a signal for the front bedroom between 10PM and 6AM (generally when I am there), but a large one when I shower generally about 9AM and 9 to 10PM. There is also a small bump in the bathroom RH in the afternoon. This is almost certainly from the summer. I often have a shower before I go to work (no one wants a dirty chef cooking, though many are :o ).
I included the living room, which is hardly used at all (more of a hall way) as a base.

Attached Files

  • Attached File  RH.jpg   26.24K   0 downloads


#8 DamonHD

DamonHD

    Advanced Member

  • Members
  • PipPipPipPip
  • 1,046 posts
  • LocationLondon, UK

Posted 01 November 2015 - 12:57 PM

View PostSteamyTea, on 01 November 2015 - 11:33 AM, said:

Really a simple one
Part 1:
E = (N++ + N--N+-N-+)/(N++ + N-- + N+- + N-+)
Part 2:
S = E(a, b) − E(a, b′) + E(a′ , b ) + E(a′, b′)

They use it to test if entangled photons really are entangled and not been tampered with.

One issue is that I have no external objective proven highly-reliable measure of occupancy in the stats, only the imperfect existing heuristics, which I am trying to improve by adding the new measures. If they were fully in agreements there'd be no value in the new code, for example.

By eye, and with my diary beside me, I attempted to look for 'simultaneous' events, ie correct +ve/-ve vs incorrect +ve/-ve.

At the moment I am relatively content that for my current limited case I have an overall positive change, and will look for changes in the accuracy of occupancy prediction when it matters.

I have also made it very easy to off this extra heuristic if I get nervous!

Rgds

Damon

Edited by DamonHD, 01 November 2015 - 12:58 PM.


#9 SteamyTea

SteamyTea

    Advanced Member

  • Members
  • PipPipPipPip
  • 4,322 posts
  • LocationCornwall

Posted 01 November 2015 - 01:07 PM

Well you could say from my data, that one person does not affect the levels.
As there is not much chance this weekend of getting another in the bedroom, I could try heavy breathing!

Was that New Scientist article any help, the one that uses wi-fi for sensing:
https://www.newscien...-and-heartbeat/

#10 DamonHD

DamonHD

    Advanced Member

  • Members
  • PipPipPipPip
  • 1,046 posts
  • LocationLondon, UK

Posted 01 November 2015 - 04:07 PM

I hadn't seen that NS item, but yes the tech is potentially of interest!

Rgds

Damon

#11 ferdinand

ferdinand

    Advanced Member

  • Member Blogger
  • PipPipPipPip
  • 1,031 posts

Posted 01 November 2015 - 04:47 PM

Hmmm.

A level of 80% and a sweet, slightly sickly smell, is indicative of occupancy by Sea Devils or Vogons.

If you are subsequently taken down in a hail of bullets, it was amphibious spetsnaz who mistook you for a journalist.

Ferdinand

Edited by ferdinand, 01 November 2015 - 05:47 PM.


#12 DamonHD

DamonHD

    Advanced Member

  • Members
  • PipPipPipPip
  • 1,046 posts
  • LocationLondon, UK

Posted 07 November 2015 - 07:45 PM

Continuing this thought, here's a graph that I've jammed a lot into, but it's tricky getting an overview when there are many sensors!

Basically it shows external temperature, boiler run-time and a scatter of all the relative humidity, computed occupancy, and valve positions over the last week.

Rgds

Damon

Attached File  occBV.png   121.83K   6 downloads

Edited by DamonHD, 07 November 2015 - 07:45 PM.