sampling rate 40kHZ with Arduino uno r3 Please!!!!

I'm want sinewave signal from a function generator which is about 40 kHz with arduino.

I'm conecting the ground of the function generator to the arduino ground and the output to the A0 pin

And?
With a normal maximum analogue sample rate of around 9kHz, what does Mr Nyquist say about your scheme?

I want to know that the board can be sample 40 khz
i'm test just 50h by code
int data[100];

void setup() {

Serial.begin(9600);
int data1[100]; // 100 point on serial monitor
for(int i=0;i<100;i++)
{
data = analogRead(A0);

  • delay(1000);*

  • }*

  • for(int i=0;i<100;i++)*

  • {*
    _ Serial.println(data*); _
    _
    }_
    _
    }_
    void loop() {
    _
    }*_
    ****I want sample 40 khz

I want to know that the board can be sample 40 khz

but you said:-

I'm want sinewave signal from a function generator which is about 40 kHz

So you need a sample rate of at least 80KHz.

What sort of Arduino? It would be possible with a Due but not a Uno.

i'm test just 50h by code

delay(1000);

If you say so.

Please use code tags - it avoids italics

You may be interested in this link http://www.instructables.com/id/Girino-Fast-Arduino-Oscilloscope/#step0

...R

i want frequency 20khz
sampling 40khz

I think the ADC will sample up to about 78k samples / second, but at fewer bits per sample.
You need to check the processor data sheet.

Still waiting for those code tags.

Sorry!!
i'm test just 50h by code
int data[60];
void setup() {
Serial.begin(9600);
int data1[60]; // 60 point on serial monitor
for(int i=0;i<60;i++)
{
data = analogRead(A0);
delay(10);
}

for(int i=0;i<60;i++)
{
Serial.println(data);
}
}
void loop() {
}

See
http://forum.arduino.cc/index.php/topic,65192.0.html

Why will you not post your code correctly?

Using delay will slow down your code
delay(10) means stop for 10 milliseconds => that implies you can make max 100 samples per second.
So remove the delay of your code,

data = analogRead(A0);

this will not do what you want, please read the tutorial how to use arrays for the correct syntax.

Serial.println(data);

this will not do what you want, please read the tutorial how to use arrays for the correct syntax.

int data1[60]; // 60 point on serial monitor

this is not used, remove it from the code as it obfuscates problems

Hi someone to help, or enough to introduce me 40khz sampling signal by using the Arduino George do it. Made and inquiries made ??various moves that the board do not have the answer to it. But the advisers said, to read from the datasheet it done

by using the Arduino George do it.

The what?

The on chip ADC can be made to run a lot faster, but with less accuracy - the ADC clock
prescaler bits are in one of the control registers and are documented in the chip's datasheet.

The default setting is for a prescale of 1/128, giving an ADC clock of 125kHz on a 16MHz
board, conversions take about 13 ADC clocks.

The faster you run the ADC clock the lower the source impedance of you signal should be,
so 10k is recommended for 125kHz clock, but 1k for a 1MHz clock (which allows for a

50kHz sampling frequecy which you'll need to capture 20kHz signals).

You might want to consider an external ADC chip, such as an MCP3204 or MCP3208
which both sample a lot faster and with 12 bit accuracy.

Sorry I'm not good at English. , I help google
MCP3204 or MCP3208?
What is it, with this example

What is your native language? Maybe you would be better using one of the other language forums?

Your posts on this thread suggest that you are not understanding what people are trying to tell you.

...R

I 'm Thailand.
I'm doing a project about the sound of broken glass. Now I want to know the Arduino board get 20khz ? by sampling rate .
I seek advice from wherever you are.

???????????????
??????????????????????????????????? ??????????????????????? ????? arduino ??????????????? 20khz ???????? ????? sampling rate ????????? function gen ????????????????????????????????????? ??? 40khz ???????????????????????????????????????????????????????????????????????????? ???? excell, matllab

?????????????????????????????

I want this image

suchawinee:
Now I want to know the Arduino board get 20khz ? by sampling rate .

You have already been given guidance about this in Replies 5, 7, 9 and 13. You don't seem to be reading them. I can't see what more I can do to help.

...R