Can we get 600 Hz sampling rate in Arduino uno?

Dear friends, for my project purposes, I'm using accelerometer and I need a sampling rate of 600Hz using Arduino UNO. Is there any possibility for getting 600Hz sampling rate? I'd very thankful for the answer.

Which communication protocol are you using?

Hello
Just try it with a home brewed timer.

The data is transmitted over UART. we tried using the micro and millis() to set delays but we are not able to achieve 600Hz sampling rate. Is there any other way I can achieve? Thank you.

Hello,
post your sketch to see how we can help.

I am planning to use some dedicated ADC if i am not able to achieve using the Arduino. Can home brewed time be called and implemented in Arduino? Please help.

Can you tell the name of your accelerometer?

We are using ADXL345 accelerometer and FSR too if it works for accelerometer

Did you look at the datasheet? I didn't see any UART section.
Ekran Alıntısı
I saw only SPI and I²C.
Also I didn't see TX and RX for UART.

The ADXL345 supports upto 3200 samples/second.

You haven't posted your code yet so we have no clue what you are doing.

Code + circuit please if you want help rather than a to-and-fro interogation session please :slight_smile:

int pinToWhichFsrIsConnected = A0;
int TheValueRecordedFromTheSensor;

void setup() {

Serial.begin(115200);
}

void loop() {

TheValueRecordedFromTheSensor = analogRead(pinToWhichFsrIsConnected);

Serial.println(TheValueRecordedFromTheSensor);

delay(1.666);
}

Below is the python code

import time
import serial as sr
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal

s = sr.Serial("COM5",115200);

data = np.array([]);

time.sleep(3)

t_end = time.time() + 10

while time.time() < t_end:
#print("Hello")
a = s.readline()
a = a.decode()
#b = float(a)
data = np.append(data, a)

#resampledData = signal.resample(data,600)

s.close()

We are trying to communicate via serial port and we are running the code for 10 seconds in python to check how many values have been appended for data variable in the code. We are unable to achieve 600 Hz .

Be carefull:
afbeelding
The UNO bus I2C runs on 5V and you are connecting components that might be not compatible.
Or are you using a signal converter?
If you really want to go 600hz, you might consider a DUE that runs default 3.3V and use its native usb that goes up to 1Mbit or use an ethernet shield.

This is the code we are using for FSR.

Did you read the how the the delay() functions works, didn´t you?

Yes paulpaulson we read how delay works. We get to know that delay works with milliseconds and for 600Hz it takes 1.666 milliseconds between each sample. So tried with that delay. Pls correct me if I'm wrong

Hello
I guess you didn´t.

Well, thanks for that. Can you pls guide us on getting 600 samples per second if delay is the only issue.

If only delay is problem, use delayMicroseconds instead.

Like 'delayMicroseconds (1666)' and substract from 1666 time to read data from the sensor for accurate 600Hz sampling.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.