See '20231110-pc-arduino-read-ac' for the code used in this experiment.

Common baud rates are: 9600, 19200, 38400, 57600, 115200

Test 1: 1 Hz sine wave, 9600 baud serial communicarion, 1000 values on X-axis

image-20231122112255411

Test 2: 10 Hz sine wave, 9600 baud serial communicarion, 1000 values on X-axis

image-20231122112335989

Test 3: 10 Hz sine wave, 19200 baud serial communicarion, 1000 values on X-axis

image-20231122112936884

Test 4: 10 Hz sine wave, 38400 baud serial communicarion, 2000 values on X-axis

image-20231122113151679

Test 5: 10 Hz sine wave, 115200 baud serial communicarion, 2000 values on X-axisimage-20231122114101547

Test 6: 10 Hz sine wave, 921600 baud serial communicarion, 2000 values on X-axis

image-20231122114334229

Can I achieve higher baud rates if I do not convert to float on the Arduino? Yes!

Test 7: 40 Hz sine wave, 921600 baud serial communicarion, 2000 values on X-axis

(I disabled the Y-axis since it now shows values between 0 and 1023)

image-20231122114749550

For this last one this was the Arduino code:

void setup() {
  Serial.begin(921600);
}

void loop() {
  Serial.println(analogRead(A0));
}

Idea: maybe it can go even faster when I cast to short?