Shop OBEX P1 Docs P2 Docs Learn Events
Help - I've fallen and I can't get up! — Parallax Forums

Help - I've fallen and I can't get up!

Ron CzapalaRon Czapala Posts: 2,418
edited 2016-02-24 23:31 in General Discussion
I recently found out that a neighbor died in her home and was not found for two weeks - she lived alone.
Since I also live alone (except for my dog), and sometimes go days without talking to relatives or friends,
I thought it might be nice to create a device that would monitor my movements in the house and notify someone
if no movement was detected for a certain period of time.

I know there are various devices/services like "Life Alert", etc but they require paying a monitoring company
a monthly fee.

I have a SECO-LARM Twin Photobeam Detector installed in my hallway for my burglar alarm system. It detects when
I move down the hallway but it doesn't pickup my small dog (like most PIR sensors). I figured I could also
use this sensor to monitor my movements even when the alarm system is not armed.
http://www.seco-larm.com/E960LRb.htm

I also have a PINK Netburner module that connects to my router with an ethernet cable. It is a web sever and
is capable of sending emails. I also have several ChronoDot DS3231 real-time clock modules that could
be used to as an accurate time source. While the DS3231 handles leap year, it doesn't adjust for daylight savings time.

Since the netburner is a web server, I thought it would really be helpful if the DS3231 RTC could be set using a web page hosted
on the netburner.

So I took a Propeller board, PINK Netburner and ChronoDot RTC and started developing a program and web page to accomplish my goal.
I have a modified version of Kwabena W. Agyeman's DS1307_RTCEngine object which allows the DS3231 to be set in 12 or 24 hour mode.
I prefer the DS3231 12 hour mode, so my web page provides for AP/PM times.
The web page uses a lot of javascript since it determines if the year is a leap year to handle Feb 29. The web page can not
determine what the day of the week should be but it does dynamically populate the Day dropdown (Select HTML tag) based on the
Month and leap year.

The web page strings the parameters together and uses XMLHttpRequest to post it to a PINK variable.
After the variable is saved, the propeller needs to be rebooted (without dropping power for the PINK module).
The Propeller gets that variable at power-up and uses my DS3231 routines to set the date and time.

I have not implemented the logic to monitor the beam sensor and check for elapsed time since the previous timestamp,
but that part should be fairly simple. Sending emails is easy but the content is limited to 64 bytes (size of PINK variables).

Web page:
clockset%20web%20page.JPG

Propeller, PINK, ChronoDot hardware:
RTC%20PINK%20project.jpg

Comments

  • What about an app for your phone? You could program an alarm that would require you to shut it off, say every couple of days. If for some reason you couldn't it would call 911.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2016-02-25 01:44
    lardom wrote: »
    What about an app for your phone? You could program an alarm that would require you to shut it off, say every couple of days. If for some reason you couldn't it would call 911.
    Sounds like a reasonable approach but I'm really not into cell phones and big monthly bills.

    I bought a smartphone a few months ago and it is impressive but I seldom use it. I got it mainly for emergencies and sometimes I leave it powered down or in airplane mode to keep from charging it all the time.

  • I'm with you Ron. I as well live alone except for my four cats. And typically go for days without contacting family and a few friends. I bought one of the dratted things because the work I do, outside of Parallax, expects the typical Linux worker to use one. (I already obtained a basic phone.)

    And this sounds like a worthy cause. But which Prop board is that wearing a ChronoDot gizmo, and Mr. Pink?
    ----
    Strange. Erco your robot was last seen traveling aboard a Google sponsored autodrive vehicle (which is making money by Uber), and on yet another trip. He's off to the airport.
  • But which Prop board is that wearing a ChronoDot gizmo, and Mr. Pink?

    That's the Propeller Demo Board, which is no longer available as a product.

  • Seairth wrote: »
    But which Prop board is that wearing a ChronoDot gizmo, and Mr. Pink?

    That's the Propeller Demo Board, which is no longer available as a product.

    Hello!
    Oh okay. That's why. I didn't recognize it as such.
    ---
    Okay Erco your robot got his flight, he's flying first class aboard a ANA flight.

  • I had this same thought a few years ago. I dubbed it "behavioural monitoring system".

    My idea was not to be tied to the internet nor require a cell-phone because many of the elderly don't have/want those things. There would be sensors to indicate doors opening, appliances being used, etc. and some form of P2P wireless network between neighbours that agree to watch out for each other.

    I also thought of using the Kinect sensor.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2016-02-25 17:58
    Glad I'm not the only one concerned about such things. I know of two people who had bad strokes and were not able to get to a phone for help.

    Even if my contraption doesn't save me, perhaps it will keep my dog from starving...

    I uploaded my PINK web page for updating the RTC - of course it doesn't really do anything running on this host.
    You can view the source if interested...

    http://ronczap.home.insightbb.com/privclock.htm

    The dropdown for Year has 1900 and 2000 for testing the leap year javascript function
  • Mickster wrote: »
    I had this same thought a few years ago. I dubbed it "behavioural monitoring system".

    My idea was not to be tied to the internet nor require a cell-phone because many of the elderly don't have/want those things. There would be sensors to indicate doors opening, appliances being used, etc. and some form of P2P wireless network between neighbours that agree to watch out for each other.

    I also thought of using the Kinect sensor.
    I was born in the 50's. My neighbors did watch out for each other. That seems like a relic of history nowadays. :depressed:
  • Heater.Heater. Posts: 21,230
    My 80 something year old grandmother-in-law lives in the Finnish forest in a little lake side cottage. Neighbours are barely visible. Mostly forest and farms all around. And the lake of course. She probably has more visitors popping in per week than a lot of elderly, or even not so elderly, living in modern cities.

    It's strange world we have built for ourselves.



  • Heater. wrote: »
    My 80 something year old grandmother-in-law lives in the Finnish forest in a little lake side cottage. Neighbours are barely visible. Mostly forest and farms all around. And the lake of course. She probably has more visitors popping in per week than a lot of elderly, or even not so elderly, living in modern cities.

    It's strange world we have built for ourselves.

    There's an actual psychological phenomena involved here, I think.
  • kwinnkwinn Posts: 8,697
    Seairth wrote: »
    Heater. wrote: »
    My 80 something year old grandmother-in-law lives in the Finnish forest in a little lake side cottage. Neighbours are barely visible. Mostly forest and farms all around. And the lake of course. She probably has more visitors popping in per week than a lot of elderly, or even not so elderly, living in modern cities.

    It's strange world we have built for ourselves.

    There's an actual psychological phenomena involved here, I think.

    The same phenomena makes it far more likely that someone will stop to help you on a dark lightly traveled road than on a busy one.
  • I discovered that javascript has a neat function that returns the day-of-the-week called getDay() where 0=Sun ... 6=Sat.

    I need to add 1 for the DS3231 but now my web page automatically shows the correct day of the week...

    http://ronczap.home.insightbb.com/privclock.htm
  • Cluso99Cluso99 Posts: 18,069
    An excellent project Ron. Well done!

    I wonder if these cheapie smart watches could perform some function to relay a message via wifi to an ESP8266 wifi & propeller. These smart watches have all kinds of inbuilt sensors.

    Just recently a fitbit is credited with saving a mans life because it noticed huge variations in his heartbeat causing him to seek medical help before he had a heart attack. Saved his life!
  • Cluso99Cluso99 Posts: 18,069
    BTW I noticed you are covering 1900.
    If you restrict years to 1901 to 2099 then leap years are all divisible by 4. 1900 & 2100 are not leap years because the centuries need to be also divisible by 100 which is why 2000 is/was a leap year.
  • Heater.Heater. Posts: 21,230
    I don't know about the "actual psychological phenomena". Seems to me that in the city you are surrounded by millions of people. You don't know any of them. There are too many for a simple human mind to keep up with. You probably live in some apartment building where you never see of get to know your neighbours. Your friends and family are probably far away.

    End result: If someone is collapsing of a heart attack whilst you are rushing to work, then "Meh".

    Contrast to a small village, where you get to chat to your neighbours over the garden fence. You see them in the local store and pub and church and school. Your family and friends are near by. You have an investment in them and they have an investment in you. They will look out for you as you look out for them.

    I don't know. Except that I have this urge to move further north where there are even less people.

  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2016-02-25 23:06
    Cluso99 wrote: »
    BTW I noticed you are covering 1900.
    If you restrict years to 1901 to 2099 then leap years are all divisible by 4. 1900 & 2100 are not leap years because the centuries need to be also divisible by 100 which is why 2000 is/was a leap year.
    I just put 1900 and 2000 in there to check the leap year function.
    For any year not ending in 00, it is a leap year if divisible by 4 -
    years that end in 00 are leap years only if they are divisible by 400.

    This is the code:
    function IsLeapYr(year) {
      return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
    }
    

    Did you know 11 days were skipped in 1752 to make up for lack of leap year adjustments?

    https://en.wikipedia.org/wiki/Calendar_(New_Style)_Act_1750
    the calendar was advanced by 11 days: Wednesday 2 September 1752 was followed by Thursday 14 September 1752
Sign In or Register to comment.