How best to sample two sensors with different sample rates

Thread Starter

emoney123

Joined Jun 4, 2012
32
Hello,

I have two sensors, one a magnetometer that samples at a max rate of 160Hz (I need the max rate for my application) and an accelerometer that has multiple sample rates that can be set. I would like to sample the accelerometer at 500Hz. If the magnetometer amplitude reaches a specific threshold I need to analyze the accelerometer data at that moment. What would be the best way to go about doing this as to not corrupt data or loose samples.
Thanks
 

Alec_t

Joined Sep 17, 2013
14,313
If the magnetometer amplitude reaches a specific threshold I need to analyze the accelerometer data at that moment.
How long does the analysis take? Is there sufficient time to do it in between reading samples from the other magnetometer?
 

Thread Starter

emoney123

Joined Jun 4, 2012
32
Yes, there is sufficient time however I would like continuous data from the accelerometer not just after the magnetometer reaches threshold.
Thanks
 

Thread Starter

emoney123

Joined Jun 4, 2012
32
So you are asking what controller to use for processing this data?
Do you want it to go to a PC or a microprocessor?
No, I have a controller I just am a little confused at how to sample both sensors together without syncing them somehow. I can't just send up both sensors data at the 160Hz rate for the magnetometer becuase it is the below the nyquist of the accelerometer data rate. Maybe I'm looking at this the wrong way.
 

crutschow

Joined Mar 14, 2008
34,412
No, I have a controller I just am a little confused at how to sample both sensors together without syncing them somehow. I can't just send up both sensors data at the 160Hz rate for the magnetometer becuase it is the below the nyquist of the accelerometer data rate. Maybe I'm looking at this the wrong way.
I am confused. :confused:
You said the sensor data is already digital at each sensors' sample rate.
So why are you concerned about that?

Or are you trying to send both data streams through one set of wires?
If so there's nothing wrong with oversampling the magnetometer data if that's the easiest.
You will just get several samples with the same reading.
 
Top