Author Topic: Detecting If I Am In Bed  (Read 12892 times)

0 Members and 1 Guest are viewing this topic.

Offline CBPTopic starter

  • Contributor
  • Posts: 14
  • Country: gb
Detecting If I Am In Bed
« on: December 12, 2014, 09:58:07 pm »
Afternoon All

I have a Home Automation system and one of the things I have always been missing is the ability to detect whether or not I am in bed, detecting this can help with turning lights off in rooms/turning the temperature down/locking doors etc etc. I've never managed to do it and I am wondering if anyone has any ideas, these are things I have thought of;

1) Pressure Pads - tried and too unreliable (rapid on/offs as the pad is between the mattress and the top sheet), also feels like sleeping on rubber sheets (that is the main issue, I could get around the first one)

2) Ultrasonics - mounted in the roof directly above the bed, it is unlikely to be able to work out the difference between me and a pillow on the bed or me forgetting to make the bed in the morning. Don't really want a transducer in my face all night.

3) IR distance sensing - the same as 2)

4) Strain gauge - the bed does have slats across the middle (think this as an example http://www.bedslats.co.uk/media/catalog/product/cache/30/image/9df78eab33525d08d6e5fb8d27136e95/w/h/whinfell_solid_oak_bed_angle_4.jpg) that do flex with the load on the bed however this is across several tens of slats and a without building a network of gauges on different ones I am not sure it would be reliable. I also thought about one on the legs of the bed but it is resting on carpet so it will not be on a hard surface, again I don't know if you can measure strain against carpet really.

5) Some sort of passive detection like carrying a Tile presence sensor round with me etc, I can't always make sure that I will take it to bed and I am not implanting any RFID chips in my neck!

6) Thermal Non Contact Sensing - thinking mounted in the roof down onto the bed. Will it detect body heat through sheets? How would I work out the difference between warm sheets from getting out of the bed to what is really actually me.

Has anyone else any ideas about how I could do this? The most simplest solution is just to have a button and press it when I go to bed but I will always forget to do it.

Thanks
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
Re: Detecting If I Am In Bed
« Reply #1 on: December 12, 2014, 10:00:05 pm »
I am in bed

Does it have to be just you, or anybody your size/weight?    :-DD

Sorry....   O0

Offline mtdoc

  • Super Contributor
  • ***
  • Posts: 3575
  • Country: us
Re: Detecting If I Am In Bed
« Reply #2 on: December 12, 2014, 10:14:26 pm »
Do an online search for "hospital bed alarm". 

Hospitals use these routinely so I'm sure multiple companies make them. There should be info available on their design.
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6716
  • Country: nl
Re: Detecting If I Am In Bed
« Reply #3 on: December 12, 2014, 10:26:09 pm »
Load cells under the bed posts?
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: Detecting If I Am In Bed
« Reply #4 on: December 12, 2014, 10:28:31 pm »
Put a switch on the bedroom door that detects when it is closed? Then simply close the door when you go to sleep for the night and leave the door ajar at other times.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: my
  • reassessing directives...
Re: Detecting If I Am In Bed
« Reply #5 on: December 12, 2014, 11:09:14 pm »
under my car driver seat there is switch to detect and give seatbelt warning. its no ordinary switch but its like in the keyboard. its plastic laminate 2 layers and somesort of carbon contact in between.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline jlmoon

  • Supporter
  • ****
  • Posts: 609
  • Country: us
  • If you fail the first time, keep trying!
Re: Detecting If I Am In Bed
« Reply #6 on: December 12, 2014, 11:40:41 pm »
I am in bed

Does it have to be just you, or anybody your size/weight?    :-DD

Sorry....   O0

LOL..  :-DD that didn't take long!
Recharged Volt-Nut
 

Offline jlmoon

  • Supporter
  • ****
  • Posts: 609
  • Country: us
  • If you fail the first time, keep trying!
Re: Detecting If I Am In Bed
« Reply #7 on: December 12, 2014, 11:43:04 pm »
Load cells under the bed posts?

I can hear the line now.. c'mon in here honey.. let me show you how these load cells work.
Recharged Volt-Nut
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: my
  • reassessing directives...
Re: Detecting If I Am In Bed
« Reply #8 on: December 12, 2014, 11:59:25 pm »
I am in bed
Does it have to be just you, or anybody your size/weight?    :-DD
LOL..  :-DD that didn't take long!
and some people dont like light to be turned off that moment ;) so a manual button near the bed head is still golden. if you asleep and forgetting that button, i dont thing for that type of person, turning the light off will be necessary.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9930
  • Country: nz
Re: Detecting If I Am In Bed
« Reply #9 on: December 13, 2014, 12:39:49 am »
Place the load-cell under one leg of the entire bed structure, the carpet wont matter.
The loading is the same on any surface but you may want a small metal plate between the cell and carpet. It only has to be the width/length of the cell itself. Maybe a 40x40x5mm block of aluminium.
Assume it will sense ~1/4 of the weight of the bed + contents.
So make sure the load-cell is good enough to detect 1/4 of a persons weight, maybe 1kg resolution or better, and of course make sure it can handle the total weight ok with a good margin.

You can then code some simple logic to detect if someone is in bed using a threshold equal to halfway between an empty bed and a full bed.
« Last Edit: December 13, 2014, 12:56:42 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3178
  • Country: au
Re: Detecting If I Am In Bed
« Reply #10 on: December 13, 2014, 01:09:39 am »
If you had an inflatable mattress you could measure the difference in air pressure, similar to a hydraulic weighbridge. A system like that, being able to measure actual weight, could even log if Goldilocks is sneaking in.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Detecting If I Am In Bed
« Reply #11 on: December 13, 2014, 01:44:24 am »
Quote
Detecting If I Am In Bed

Put some sharp objects in your bed. When you lay down on it, the sharp objects will pinch you and you will know then that you are in your bed.

Side effect: you may have to clean the rest of your house of any sharp objects so you will never be confused when you get pinched.

Hope it helps.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Detecting If I Am In Bed
« Reply #12 on: December 13, 2014, 01:46:44 am »
Having solved the in-bed detection problem, can I suggest to you a harder problem to conquer?

How do you detect that you are really you?

:)
================================
https://dannyelectronics.wordpress.com/
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: Detecting If I Am In Bed
« Reply #13 on: December 13, 2014, 02:48:20 am »
The load on a bed is not magically equally distributed amongst the four legs. Even if the mass is perfectly centered, if diagonally opposite legs are slightly longer, or the floor is correspondingly uneven, they'll take almost all of the weight between them. In practice, there's some flex to the wood, so it will be more even than that, but still not totally even? But legit idea nevertheless, just abandon the idea of assuming that dividing by 4 is the right thing to do.

On the other hand, if you have a three-legged bed, then you're totally sorted  :P. /3, (iff your centre of gravity is located at the centroid of the three legs).

<partial thread derail>

From where does one source load cells / strain gauges? I can find some on eBay, but it's really hard to find ones well-suited to a particular requirement. Take the 100 kg per leg case here for example (you don't want to load cell to break if you sit on the corner of the bed and place your entire weight essentially on that one leg).
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Detecting If I Am In Bed
« Reply #14 on: December 13, 2014, 03:11:40 am »
Why not just detect capacitance variation? Of course you'll probably want to time how long the capacitance change stays so it doesn't trigger when you are making the bed.

just some wires attached to the mattress will do.

Or a PIR (like the motion detection domes) mounted on the ceiling pointing down.

On both methods you'll probably want to wait 10 minutes or so, maybe even only 5 minutes to determine that you are there to stay. Also you can combine it with an RTC so you can have windows of when the system will activate.

But if you have dogs that like to sleep in your bed when you are not there it will trigger it with both methods :)
 

Offline pickle9000

  • Super Contributor
  • ***
  • Posts: 2439
  • Country: ca
Re: Detecting If I Am In Bed
« Reply #15 on: December 13, 2014, 03:45:33 am »
Loop sensors like they use at a traffic stop. Pressure switch in a flat bag.

Angry hamster under the sheets and a whistle detector to catch the screams while you are in bed. No screams for 10 minutes indicates you are no longer there.
 

Offline mhwlng

  • Contributor
  • Posts: 19
  • Country: nl
Re: Detecting If I Am In Bed
« Reply #16 on: December 13, 2014, 08:29:11 am »
I have (zwave) motion detectors in every room.

If the last motion detected was in the bedroom and that room has been occupied for > 15 minutes, then I assume that I'm going to bed.
In that case, the central heating is switched off (until motion is detected in any other room, in the morning.) and the wake-up alarm will be enabled.

In this case, the lights will not be switched off automatically. (I read in bed.)

There is a Visonic MCT-201 WP button next to the bed to control the lights.

In the morning, the lights are automatically switched on gradually over a 30 minute period, before the wake-up alarm starts.

« Last Edit: December 13, 2014, 09:06:53 am by mhwlng »
 

Offline Retep

  • Regular Contributor
  • *
  • Posts: 96
Re: Detecting If I Am In Bed
« Reply #17 on: December 13, 2014, 02:29:41 pm »
If you go for something that reacts to the load on the bed you better implement some debouncing. Otherwise the whole neighborhood will know when you are having a good time with your wife/girlfriend/boyfriend or whatever ^-^
 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6190
  • Country: us
Re: Detecting If I Am In Bed
« Reply #18 on: December 13, 2014, 02:36:32 pm »
If you or your wife snore you can use a microphone as a sensor.
 

Offline casper.bang

  • Frequent Contributor
  • **
  • Posts: 311
  • Country: dk
  • Pro SE, amateur EE.
    • BangBits
Re: Detecting If I Am In Bed
« Reply #19 on: December 13, 2014, 06:22:53 pm »
For all the fun ways this could be done, I would probably just use an ATTiny with a thermistor. Let a tiny wire with the PTC resistor run to the center of the mattress (where your butt would be) and let your body temperature be the trigger. The MCU would allow you to use just about any sensor you want, tweak the trigger range and also add some hysteresis. If you just want to monitor your sleep, there are easier way to do it, i.e. with an Android app - which also takes "settling down" into account in its statistics (using the phones gyro to detect movement).
 

Offline magetoo

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: se
Re: Detecting If I Am In Bed
« Reply #20 on: December 14, 2014, 12:44:41 am »
The load on a bed is not magically equally distributed amongst the four legs. [...]

True.  Fortunately, humans aren't symmetrical; the head end will take most of the weight.  (OP, are you human?)  If you can have sensing on those two legs then things should work.  I guess just one would work too.

Plus, at least for me, sitting on a corner usually happens at the foot end.


How do you detect that you are really you?

Assume you are you, unless dreaming. (Anything can happen in dreams.)

If you are not you, then someone else will be you, and they would have the exact same problem of knowing whether they are you; therefore the two cases "you are you" and "someone else is you" are identical.

So it would seem that the solution to this problem is the same as the solution to the first!

Unless dreaming while sleepwalking, so that has to be detected too.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Detecting If I Am In Bed
« Reply #21 on: December 14, 2014, 12:55:42 am »
All the approaches proposed so far can only detect if something is in the bed. The weight approaches for example would not make a difference between a 300lb man or a 300lb pig or 300lb of rocks.

The OP's ask was "Detecting If *****I***** Am In Bed", emphasis mine.

So having detected the existence of "something" in the bed, you have to develop a mechanism that assures the OP that that something is him/her indeed.

I would say that a restart is needed.
================================
https://dannyelectronics.wordpress.com/
 

Offline magetoo

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: se
Re: Detecting If I Am In Bed
« Reply #22 on: December 14, 2014, 01:01:17 am »
OP, lock the bedroom door.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Detecting If I Am In Bed
« Reply #23 on: December 14, 2014, 02:08:54 am »
All of that, and then some, can be fairly easily defeated and seem to be overly and overtly complex and unnecessary.

I would propose a simpler approach: a (reasonably intelligent) human. it can be a maid, a (girl/boy) friend, an employee, a bartler, etc. who would take a look at the "thing/being" in bed and confirm if it is OK.

It would go like this:

OP: "Arthur, am I in my bed?"
Arthur/OP detector: "Yes, Sir. You are surely in  your bed and I can see that with my naked eyes."
================================
https://dannyelectronics.wordpress.com/
 

Offline pickle9000

  • Super Contributor
  • ***
  • Posts: 2439
  • Country: ca
Re: Detecting If I Am In Bed
« Reply #24 on: December 14, 2014, 02:10:10 am »
So I did mention a couple before (plus a joke). Both of the ones mentioned loop sensor a bag are real.

You can easily simulate a bag sensor with a pressure sensor mounted on the end of run of surgical tubing (cork the other end). Place between the mattress and box spring. You may have to pressurize the tube a bit get it to work. These can also sense a heart rate if rigged properly. These are very robust rigs and last well.
 

Offline Maxlor

  • Frequent Contributor
  • **
  • Posts: 565
  • Country: ch
Re: Detecting If I Am In Bed
« Reply #25 on: December 14, 2014, 02:16:13 am »
A light barrier directly under the slats of the bed might work. As soon as there is some weight on the bed, the slats will be pushed down and thus be breaking the barrier.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Detecting If I Am In Bed
« Reply #26 on: December 14, 2014, 09:45:10 am »
As the definition was that the op was in bed, and assuming he doesn't free-ball at night, slip some waterproof RFID tags in his underwear and have a loop antenna under the mattress to read it,

bonus point is he can then wear level his underwear  :-DD

e.g. http://www.ebay.com.au/itm/like/111079728923?limghlpsr=true&hlpv=2&ops=true&viphx=1&hlpht=true&lpid=107&chn=ps

you will be close to an RF source, but it should not be any more powerful than the wifi router you likely sleep next to :)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Detecting If I Am In Bed
« Reply #27 on: December 14, 2014, 11:08:51 am »
-Or for an inverted logic case just tie the OP to the bed,-

I think we are on the right track. However, that particular suggestion sound like a cruel and unusual punishment.
================================
https://dannyelectronics.wordpress.com/
 

Offline DVDRW

  • Newbie
  • Posts: 9
  • Country: ee
Re: Detecting If I Am In Bed
« Reply #28 on: December 14, 2014, 02:40:28 pm »
Scale sensor under foot bed maybe?
http://www.nerdkits.com/videos/weighscale/
I'm searching sensor that detects if human is in room then ceiling light is on. When not in room or bed then light off.
PIR wont work.

2014 and still we don't have arduino human sensor, really?
« Last Edit: December 14, 2014, 02:42:21 pm by DVDRW »
 

Offline HighVoltage

  • Super Contributor
  • ***
  • Posts: 5468
  • Country: de
Re: Detecting If I Am In Bed
« Reply #29 on: December 14, 2014, 02:50:08 pm »
Almost every new car has such a low cost sensor built in to the seats to detect, if the seat belt warning system has to be activated. A friend drives a small Volvo and that one is so sensitive, that a small book on the passenger seat will trip the warning. 
There are 3 kinds of people in this world, those who can count and those who can not.
 

Offline pickle9000

  • Super Contributor
  • ***
  • Posts: 2439
  • Country: ca
Re: Detecting If I Am In Bed
« Reply #30 on: December 14, 2014, 08:05:10 pm »
For a pir to work, use in pairs. Inside and outside door, on and next to bed last one on indicates location. Ideally in this situation 4, 2 at the door, 2 at bed. That way an out of sequence pair will indicate another person.
 

Offline jeroen79

  • Frequent Contributor
  • **
  • Posts: 529
Re: Detecting If I Am In Bed
« Reply #31 on: December 15, 2014, 12:01:01 am »
Some digital scales have four loadcells, one on each corner.
You could put those under the fet of the bed and then adjust the circuit to trigger at the weight of the bed plus half your weight.

You could thread thermocouples into the mattress to detect if there is something warm in them.

Or place a CO2 detector near the pillow to detect your breath.
 

Offline DVDRW

  • Newbie
  • Posts: 9
  • Country: ee
Re: Detecting If I Am In Bed
« Reply #32 on: December 15, 2014, 05:04:26 am »
evb149 good point. I' m there where last PIR detected me.
PIR-s cost like ~1.5$ piece and draws ~60uA current  :-+

But I have 2 cats ???
Maybe some kind of RF wrist device?
« Last Edit: December 15, 2014, 12:16:53 pm by DVDRW »
 

Offline babysitter

  • Frequent Contributor
  • **
  • Posts: 893
  • Country: de
  • pushing silicon at work
Re: Detecting If I Am In Bed
« Reply #33 on: December 15, 2014, 03:16:59 pm »
Zigzag wire woven under the bed (really, lots of Z stacked or sinusoidal). Use as L in a LC oscillator, say emitter coupled pair. Go for AM Frequency Range. Listen to Radio if you get a acceptable signal variation, if not, vary wire position/capacitor. Hack up something to measure frequency, e.g counter pin of a µC directly. Slow changes --> drift, fast changes --> movement on top of the bed!

Source of inspiration: http://en.wikipedia.org/wiki/Respiratory_inductance_plethysmography


I'm not a feature, I'm a bug! ARC DG3HDA
 

Offline sunnyhighway

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: nl
Re: Detecting If I Am In Bed
« Reply #34 on: December 15, 2014, 07:44:02 pm »
Get rid of the bed.

This simplifies the equation. Now the answer is always NO
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Detecting If I Am In Bed
« Reply #35 on: December 15, 2014, 08:56:40 pm »
Absolute PIR would be the cheapest option. You could also run image processing on an IR camera, but you didn't mention your budget.
Otherwise use your smartphone, if it is plugged in and horizontal between 21.00 and 6.00, you could assume with fair certainty that you are next to it.
Aren't you?
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Detecting If I Am In Bed
« Reply #36 on: December 15, 2014, 08:59:44 pm »
similar approach to  skieers in an avalanche trying to find up or down :

pee. if the sheets get wet you are in bed.
if your pants get wet chances are you are up and about.
if the water in the toilet colors yellow : you are clearly not in bed...
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Detecting If I Am In Bed
« Reply #37 on: December 15, 2014, 09:45:05 pm »
How about a little needle? When you want to confirm if you are in bed, pinch that thing in bed with the needle. If you are the one screaming, you are in bed. If somebody else is screaming, you are not in bed.

How's that for a simple solution?
================================
https://dannyelectronics.wordpress.com/
 

Offline BillyD

  • Regular Contributor
  • *
  • Posts: 218
  • Country: ie
Re: Detecting If I Am In Bed
« Reply #38 on: December 15, 2014, 10:10:45 pm »
Have you considered a hammock? If so you could easily sense weight/tension at the suspension points.

Or a waterbed? (Apologies if somebody already mentioned this earlier in the thread.) If so, you could relatively easily sense an occupant by the change in pressure.

Problem with some beds is that they have a lot of legs or castors, mine consists of 2 platforms, each on 4 wheels so unfortunately it would be difficult to sense pressure on these.

Nice idea though, quite clever to use your presence in bed as an input to those systems.

 

Offline os40la

  • Regular Contributor
  • *
  • Posts: 122
  • Country: us
Re: Detecting If I Am In Bed
« Reply #39 on: December 15, 2014, 10:15:41 pm »
How about one of these sensors.  :-DD
"No, but I did stay at a Holiday Inn Express"
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16276
  • Country: za
Re: Detecting If I Am In Bed
« Reply #40 on: December 16, 2014, 07:38:12 am »
How about one of these sensors.  :-DD

Then you need to have a 3 bean salad every night for dinner. Or some of Kara Nicha's nice beans curry. Nice food, all vegetarian, and ranges from mild to tasty, though some people tend to catch on fire. You can ask for the hot stuff as extra if it is too mild.
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Detecting If I Am In Bed
« Reply #41 on: December 16, 2014, 09:27:50 am »
When I was in the university, I worked on a project to detect oil products (like diesel) in a very harsh environment. The barrels were not metal - they were made of special composite, where even ultrasonic sensors were not so reliable. We've used capacitance sensors, which were really sensitive. It will really detect when you're in bed if you'd put two electrodes below the mattress. The other problem would be if the 5 pints of the beer you drank last night would be decided to be released when you're sleeping... Probably it would detect that you're still in bed. But that doesn't happening frequently, huh?
 

Offline Alex30

  • Regular Contributor
  • *
  • Posts: 197
  • Country: au
Re: Detecting If I Am In Bed
« Reply #42 on: December 16, 2014, 12:06:08 pm »
How about one of these sensors.  :-DD

Bahahahaha... I think that would be the drunk on homebrew sensor for me
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf