Stream data using Photon at each 10milisecond and upload to cloud

I am trying to capture motion sensing data using Photon. As I want minor details of this motion since it happen so fast I would like to capture data at each 10miliseconds.

As I understand there is a head-loss in uploading data onto cloud system. So I want to work around this and capture data and stream them without missing action points. One way I thought; capture and store data in an array and then stream them after each second. Even thought it’s not realtime at least I won’t miss any points. If I could make this a realtime streaming that is the end goal.

Also how fast can Photon processor can capture accelerometer sensor value. Is it cloud put me impossible to make this realtime or is there another inherent issue that I am not aware of. Just curious ?

I highly appreciate your support on this. Seeing forward to your valuable insights.

Have you seen this?

I’d think the bottle neck for capturing motion via consumer accelerometers are the sensors and not necessarily the Photon.
What sensor are you looking at?
Also what interface will you be using?
If you get an analog output you could read the sensor in an timed interrupt making the data acquisition relatively independent of your other code.

In this project, I was able to stream 200 12-bit XYZ samples per second from an ADXL362 accelerometer attached to a Photon with no difficulties. Like ScruffR said, you have to be careful with the accelerometer and driver. I wrote a custom SPI DMA driver that uses the ADXL362 queuing feature so it puts almost no load on the Photon and the samples are precisely timed, regardless of what the Photon is doing.

2 Likes

I’m using ADXL337 accelerometer. What I have done so far; used “build.particle.io” online IDE host to program. In my program I basically capture (analog read) and use publish it in the logger. In that logger it only shows data at each second. Can I reduce this interval to 10mili seconds.

Is that ‘logger’ by any chance ‘console.particle.io’?
If so, then 1p/s is the rate limit as described in the docs. If you need to go faster, you’ll need to make a direct connection, as is described in the linked topics above.

1 Like

In this case you could use the SparkIntervalTimer library to give you interrupts every x milliseconds (actually half milliseconds or microseconds) to do your readings and just push the data out from time to time without any (noticable) impact on your readings.

But we’d need to know how you are pushing the data where to.

2 Likes