Arduino Data Acquisition

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

Arduino Data Acquisition

Postby Ali_Challenger » Fri Dec 12, 2014 2:26 am

Good evening,

Anyone know what is the maximum Analog data rate per second(Samples per second)?!, If I wanna read Analog data from Arduino via MATLAB software.

Thanks.
Ali Challenger
Master Student @ FKEKK-MENC-UTEM
Mob.0187895080
https://www.facebook.com/pages/Challeng ... 8039157929
User avatar
Ali_Challenger
Apprentice
 
Posts: 37
Joined: Tue Oct 28, 2014 8:07 pm
Location: Melaka

Re: Arduino Data Acquisition

Postby yonghui » Fri Dec 12, 2014 2:51 am

Mentioned by arduino site 10ksps. But since ur are going to transfer from.arduino to matlab it will need some time to transfer and also depending on ur communication speed
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Arduino Data Acquisition

Postby Ali_Challenger » Fri Dec 12, 2014 10:53 am

yonghui WROTE:Mentioned by arduino site 10ksps. But since ur are going to transfer from.arduino to matlab it will need some time to transfer and also depending on ur communication speed



Thank you for your reply,
Am using serial communication "COM" via "USB", and I get maximum reading in MATLAB only "150sps". Is it normal ???
How can I get more samples ?!
Thanks
Ali Challenger
Master Student @ FKEKK-MENC-UTEM
Mob.0187895080
https://www.facebook.com/pages/Challeng ... 8039157929
User avatar
Ali_Challenger
Apprentice
 
Posts: 37
Joined: Tue Oct 28, 2014 8:07 pm
Location: Melaka

Re: Arduino Data Acquisition

Postby yonghui » Fri Dec 12, 2014 10:55 am

How much is your com baudrate?
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Arduino Data Acquisition

Postby yonghui » Fri Dec 12, 2014 11:02 am

If your are going to do display of analog signal on MATLAB maybe u can do it this way. Read the signal on analog pin continuously for the number of samples that u want to display for example 50 samples store into variable array. Then one go send to MATLAB and display that 50samples. The rate will be how fast in arduino reading the analog. Or else if u sample once and send it,will delay by communication.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Arduino Data Acquisition

Postby Ali_Challenger » Fri Dec 12, 2014 11:03 am

I set the BaudRate to "115200"

Thanks.
Ali Challenger
Master Student @ FKEKK-MENC-UTEM
Mob.0187895080
https://www.facebook.com/pages/Challeng ... 8039157929
User avatar
Ali_Challenger
Apprentice
 
Posts: 37
Joined: Tue Oct 28, 2014 8:07 pm
Location: Melaka

Re: Arduino Data Acquisition

Postby Ali_Challenger » Fri Dec 12, 2014 11:09 am

Thank pretty much for your idea,

But, the problem is I am doing realtime analog signal processing by MATLAB, So I need to communicate in realtime with ARDUINO, and the samples I got are not enough for that.
Ali Challenger
Master Student @ FKEKK-MENC-UTEM
Mob.0187895080
https://www.facebook.com/pages/Challeng ... 8039157929
User avatar
Ali_Challenger
Apprentice
 
Posts: 37
Joined: Tue Oct 28, 2014 8:07 pm
Location: Melaka

Re: Arduino Data Acquisition

Postby yonghui » Fri Dec 12, 2014 11:30 pm

if you really need real time transfer of data between arduino and matlab at very very high rate then mayb arduino is not so suitable because of the speed.
for your COM speed of 115200bps which this will mean that the COM speed is 11520 byte per seconds. but u will need to consider the time taken by arduino to write to transmit buffer of serial COM. so the actual rate of transfer will need to take consider of copying data for the converted samples sending out to computer, computer buffers and matlab retrieve it. if your taking the 10bits resolution for the analog signals, means u will need 2 bytes transfer per sample. this will again slower down your data rate.

i still recommendes that you buffer up enough data in arduino, then transfer the whole data packets to computer for processing. and this can make the data rate stable, and not so much fluctuating because of COM communication.
i guess most oscilloscope is doing this way too.

for example: if you are doing FFT of a signal and the signal is 100HZ. so if my requirements is the signal need to be sample at 10 times of the signal frequency, i will sample it at 1Ksps, with the help of timer interrupt set to 1Khz, i will jump to interrupt and read adc every interrupt and save to buffer. if my requirement is 100 samples. i will stop timer interrupt and sampling after 100 samples complete, and by this time i will send whole 100 samples to matlab for processing. then after that i will repeat the process again and again by turning on timer interrupt and sending to matlab after 100samples. with this my sampling rate is fixed with timer interrupt and wont be affected by lagging of COM communication at computer side.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Arduino Data Acquisition

Postby Ali_Challenger » Sat Dec 13, 2014 11:43 am

Thank you pretty much Eng. yonghui, for your useful Idea.

So, I realized from your reply that there is no other options to speed up the data rate except buffering the data before send it to MATLAB.
Ali Challenger
Master Student @ FKEKK-MENC-UTEM
Mob.0187895080
https://www.facebook.com/pages/Challeng ... 8039157929
User avatar
Ali_Challenger
Apprentice
 
Posts: 37
Joined: Tue Oct 28, 2014 8:07 pm
Location: Melaka


Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 13 guests

cron