1

I am currently trying to build a fall detection wristband with arduino. I'm trying to grab the real time accelerometer data and store them in the database regularly (every 0.5 sec).

What I'm going to do next is to analyze the raw data and detect for a fall, and if there's a fall, it should send a push notification to the android apps.

My main problem is, how should I analyze the data? Do i analyze them whenever there's a new set of data enters the database via php? Or do i have to set a cronjob to run another separate php script? Please provide me with some insights. Thank you.

  • _Do i analyze them whenever there's a new set of data enters the database via php?_ Why not? Be aware that 0.5s is a rather crude schedule for fall detection (maybe 0.1s?) and that cron provides resolution only down to a minute. There is not much calculation to do, you only have to check whether there is a continous downward motion over some distance. – syck Oct 06 '16 at 16:00
  • @timmyRS my current approach is to analyze the data every time a new data come in. Note: the way I'm using is , whenever there's one set of data being stored into the database through the php script. The same script will retrieve the latest 100 set of data and analyze them. – Jun Keat Tan Oct 06 '16 at 16:16
  • @syck the script that is used to analyze the data should be a separate script from the insert into database script? I'm not really sure how should a server works to handle such problem. – Jun Keat Tan Oct 06 '16 at 16:19
  • Why PHP? PHP is not designed for and very seldom used for real time data analysis as a single main task. (Of course a website can also be seen that way, but behaves fundamentally different.) I do not see the point in a client-server architecture here. As said, the workload should not be high, so why not trigger the analysis with an incoming next data set? – syck Oct 06 '16 at 16:33
  • @syck I'm not very experienced handling such problems. Currently I'm using PHP to insert the data into the database. It will be great if you could provide some insights to me. Thanks for the explanation on concepts too. :) – Jun Keat Tan Oct 06 '16 at 16:39

0 Answers0