0

I would like to build a network consisting of 5 smartphones (preferably Android, if it makes any difference) that log synchronized accelerometer data into a computer (like a data-logger). How can I achieve this? Any help would be appreciated.

Some more details: - the preferred sampling frequency is 50Hz. Depending on the quality of the accelerometers, this high frequency might not make sense. However, a sampling frequency below 10 Hz would not be useful. - Data from all accelerometers needs to be synchronized. The logged data should preferably be in the following format: Time Acceleration11 Acceleration12...Acceleration53; Where Acceleration11 is acceleration in device 1, direction 1 (say, X-direction).

I am a newbie in electronics and IoT, so please consider this fact in your answer. For instance, please avoid using abbreviations without explaining them and please provide some guidance how to practically achieve what you are suggesting.

15
  • 1
    What is wrong with basic WiFi?
    – hardillb
    Nov 7, 2019 at 19:31
  • 1
    publish the data to an MQTT server or send the data to google sheets
    – jsotola
    Nov 7, 2019 at 20:06
  • @hardillb --> how do you use basic WiFi to do what I am trying to do?
    – BIal
    Nov 8, 2019 at 10:54
  • 2
    Just a reminder to all above: if you've got an answer, please post it below rather than as a comment. The comments above are for asking for clarification rather than for providing part-answers. Thanks.
    – Aurora0001
    Nov 8, 2019 at 22:26
  • 1
    @BIal, I will elaborate the answer when I have some time. With the details you provided, I think I can give you some good advice. I have some projects working like what you need. Nov 11, 2019 at 15:08

1 Answer 1

0

Synchronize data from different devices is always a hard task. In your favor, you are using smartphones. You can manage to have accurate microsecond precision on your timestamps in this scenario.

First of all, we need to think about the communication. The easier way I could think, that would require the least programming and hardware works like this:

  1. The phones are running an app which samples the accelerometer data, timestamp them with the best precision you can and then HTTP request them to a webserver.
  2. The webserver consists of a RPi running LAMP. A PHP script receives the request, and place the data in a table using mySQL.
  3. Your front end consists of a simple webpage on which javascript gets the data from the database and do the according processing on it.

Now let's talk about #1.

In my opinion, you have two ways of timestamping your data. The easy way and the hard way:

The simplest way is to use a external source, such as NIST. Another very simple way is to use your GPS timestamps, which are pretty acurate. The hard way is to go for clock sync. These are hard to achieve.

But,

there is a tool to help you with that.

The webserver is pretty straightforward. Get a RPi, go for LAMP, you are done. PHP simple server with mysqli and you are done. The internet is full of tutorials.

Once you have your data in the database and properly timestamped according to your precision, parse it and do whatever you need with that. If the timestamp matches, there is your synchronized data.

Please note that this is a very simple approach with some extensive drawbacks depending on how precise the synchronization should be, But this may give you a head start for the task.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.