Home » Male Students » MG7 » Design Testing and Validation_MG7 » Data Sampling Rate Testing_MG7

Data Sampling Rate Testing_MG7

Data Sampling Rate in the Peripheral side (with FSR and Temperature Sensor only) was found to be 1000+ Hz. A small snippet was included in the peripheral code to print the loop frequency, which is the Sampling Rate Per Sensor (not all sensors together since each time the loop runs, it takes readings from all sensors. It was a misconception among the team members in the beginning as they were dividing the loop frequency by the number of sensors to calculate the Sampling Frequency).

Each Print function in Arduino or any other IDE consumes loop time and deteriorates the sampling rate (i.e., provided with false, reduced sampling rate). As more print functions are added, the sampling frequency drops drastically. By using only one printf function, the sampling frequency in the peripheral side was found to be around 1000 Hz. So, the original sampling frequency must be higher.

But on the client-side, the Sampling Frequency (i.e., the loop frequency) cannot exceed 33Hz (Approx.). It is probably a limitation from the hardware itself. Esp32 has a clock frequency of 200MHz, as a microcontroller, it is not top-notch, but not bad either. The loop frequency gets limited in the client-side due to continuous scanning and callback services performed by the device. But 33Hz per sensor is not a very bad result, even though the team expected to go up to 100Hz. A faster microcontroller like Teensy (with 600 Mhz clock) or Raspberry Pi might solve this issue if they could be used directly as a client.