Hey,
I wanted to know, at what rate is it possible to read analog sensor values and the display it on the serial command window of the Arduino IDE.
My project requires me to get value from analog sensors at around 500 - 1000 Hz (ie: 500 - 1000 times in a second).
I might be using either an Potentiometer or an Infrared sensor or maybe an LDR etc.
Can anyone plz tell me if it is possible to do this with arduino board & and if it is, can you please guide to any page which describes the coding required for doing such high speed calculations or any other information with reference to this matter.
mehtaatur:
Hey,
I wanted to know, at what rate is it possible to read analog sensor values and the display it on the serial command window of the Arduino IDE.
My project requires me to get value from analog sensors at around 500 - 1000 Hz (ie: 500 - 1000 times in a second).
I might be using either an Potentiometer or an Infrared sensor or maybe an LDR etc.
Can anyone plz tell me if it is possible to do this with arduino board & and if it is, can you please guide to any page which describes the coding required for doing such high speed calculations or any other information with reference to this matter.
For something that slow you can just use analogRead().
The limiting factor for speed will most likely be the serial communications to the PC. So pay attention to the baud rate you use and the formated length of your serial messages to the PC and you should have no problem meeting your speed requirements.
-So what would be the maximum rate at which I can read the values (ie: 1k Hz, 2k Hz and so....)
-Also, at high rates of 1k Hz and more, will it be possible to get values from 2 or more sensors simultaneously.
-Lastly, can i get this data saved in a text file on the PC? If yes then how?
AWOL:
The maximum normal ADC rate is around 9500 conversions a second.
Remember, there is only one ADC.
So if I have 3 different sensors, can I get them to read values at 1k each simultaneously? (this would total up to 3000 conversions/sec)
and does this have anything to do with the baud rate??
-So what would be the maximum rate at which I can read the values (ie: 1k Hz, 2k Hz and so....)
-Also, at high rates of 1k Hz and more, will it be possible to get values from 2 or more sensors simultaneously.
-Lastly, can i get this data saved in a text file on the PC? If yes then how?
Thankx a lot for your quick replies
Normal rate is just under 10kHz bet the chip is capable of 1mHz sample rate. You can have as many sensors as analog pins but there's only one ADC so it's shared among them. ie. Two sensors at normal rate will give you about 5kHz on each.
Lots of PC programs can capture serial data. Google for one.
AWOL:
The maximum normal ADC rate is around 9500 conversions a second.
Remember, there is only one ADC.
So if I have 3 different sensors, can I get them to read values at 1k each simultaneously? (this would total up to 3000 conversions/sec)
and does this have anything to do with the baud rate??
Well your sketch has to do things beside just reading the analog input pins as it has to format the returned values in to message lines and then send them to the PC. As the arduino has little SRAM space you will not be able to store up analogRead values (buffering them) so you can only read new data as fast as you can send out the data to the PC before reading new values once again. So baud rate has an effect on the whole sketch 'cycle time' of reading new analog values and sending them off.