hello,
i am trying to interface an external high precision low noise 24 bit delta sigma ADC (AD7193) with arduino to capture real time voltages (AC) from a geophone?
can anyone help me and guide me regarding working out with AC signals and ADC with acquiring correct samples for analysis on the digital output data?
thanks
There is at least one library out there for that purpose, and there's even a tutorial on Analog's website (first hit).
and you think that i have not searched enough about it and directly coming to this forum asking the question?
i have definitely looked all those libraries and tutorials but in my case the input signal is time varying and require greater samples at the output which i am unable to receive. so my question was in regard to that if anyone else has worked with similar kind of adc to capture ac signals , that can be a help to me.
btw thanks for letting me know how to use google and type on it!
and you think that i have not searched enough about it and directly coming to this forum asking the question?
Well most people posting questions here would have not, and you didn’t mention you had. We are not mind readers.
in my case the input signal is time varying
Well any application reading an analogue signal has to deal with a time varying signal, that is the whole point of doing the measurement.
and require greater samples at the output which i am unable to receive.
So you think it is helpful to say that but not say what sample rate you need?
The sample speed for that chip has a maximum value, you should be able to find it in the data sheet. Software could slow this down if badly written, but might be coming up against the chips limit, in which case you need another type of A/D conversion.
btw thanks for letting me know how to use google and type on it!
It is one of the services we offer here, along with the experience of what it feels like to be on the receiving end of a sarcastic pedantic post.
Seems like we have another member who prefers a grievance to a solution.
How about posting a link to the datasheet for the device you want help with with.
Also, I assume from the tone of your responses that you are not a newbie and that you will already have written some code to try to work with the device. Post the program that represents your best attempt and tell us exactly what it does and what you want it to do that is different.
...R
Robin2:
Seems like we have another member who prefers a grievance to a solution.How about posting a link to the datasheet for the device you want help with with.
Also, I assume from the tone of your responses that you are not a newbie and that you will already have written some code to try to work with the device. Post the program that represents your best attempt and tell us exactly what it does and what you want it to do that is different.
...R
hi!
i am sorry if it seemed liked i prefer grievance to a solution!
so i attach the code , library and the datasheet of the device i have been trying to work with.
i have problem when i have been trying to give a signal of frequencies greater than 3-4 hz , i have not been able to get enough samples even after setting the sampling rate to the max!
AD7193.cpp (10.1 KB)
AD7193.h (2.68 KB)
AD7193.pdf (614 KB)
AD7193_Voltage_measure_modified.ino (1.05 KB)
If your only problem is with the speed at which you can read the data from the ADC then it seems to me that is the fault of the library which seems to be littered with calls to delay().
I can't think of any solution other than creating your own functions to communicate with the device drawing on the ideas in the code in that library.
...R
thanks for your suggestions!
i have removed all the unnecessary delays from the library and those which still remains there are the requirement of the hardware in order to get working!
i have no experience of writing my own functions and get them working so that's why i am having problems !
virk_ps:
I have removed all the unnecessary delays from the library and those which still remains there are the requirement of the hardware in order to get working!
Has that improved things?
...R
unfortunately not and i am not able to understand why?
is there any limit of the arduino uno in sending the data to serial monitor (max how many samples or data can be sent at the serial monitor in one sec!?)
i am still getting 8-10 samples/sec of my high frequency (comparable 40 hz) and that gives rise to aliasing as my output data when plotted doesn't suggest that input signal was 40 HZ.
can you please take a closer look at the code and datasheet (i have attached them in my earlier reply) once and tell me if i am missing out on something
thanks
The data sheet says:-
Output data rate: 4.7 Hz to 4.8 kHz
So the only thing slowing you down is the software.
i have removed all the unnecessary delays from the library and those which still remains there are the requirement of the hardware in order to get working!
I don't see any of those in the code.
Sorry something has just come up, I will have a closer look later.
thanks!
please take a look at it whenever you get time and tell me if i am missing out on something and what kind of an error the software might be causing? and what can be the possible solutions for that. do i need to change my arduino uno and use a faster and better microcontroller?
virk_ps:
unfortunately not and i am not able to understand why?
Please post the latest version of all of your code so we can see exactly what you have done and how it works together.
Serial.print() is quite slow - you should certainly not be expecting to print anything hundreds of times per second. And what would be the point - you can't read that fast.
...R
#include <SPI.h> // Call of libraries
#include <AD7193.h>
AD7193 AD7193; // Creation of the object AD7193
unsigned long valeur;
float tension;
void setup()
{
Serial.begin(9600); // initialization of serial communication
Init_AD7193();
}
void loop()
{
valeur = AD7193.ReadADCChannel(1); // conversion A/N on input 1
valeur = valeur >> 8; // Extraction of value , raw data
tension = AD7193.DataToVoltage(valeur); // Recovery of tension
//Serial.println("");
//Serial.print("Digital Value = ");
//Serial.print(valeur,BIN);
Serial.print('\t'); // tabulation
//Serial.print(" ");
Serial.println(tension,5);
//delay(1);
}
// Initialisation of module Pmod AD5
void Init_AD7193(void)
{
AD7193.begin(); // initialization of P mod AD5 module
AD7193.AppendStatusValuetoData(); // configuration of P mod AD5 module
AD7193.SetPGAGain(1);
AD7193.SetAveraging(1);
AD7193.Calibrate();
AD7193.SetRegisterValue(AD7193_REG_MODE,0x80001,4,1); // set the throughput to 4.7KHz
//AD7193.GetRegisterValue(AD7193_REG_MODE,4,1);
AD7193.ReadRegisterMap(); //Debugging
}
this is the my latest version of code
i am printing the data on serial monitor in order to log in using another software called CoolTerm ,
i will try to use any other method to log data if this is slowing down the things, please let me know how can i log data using any other method than this!
thanks
AD7193.cpp (10.1 KB)
AD7193.h (2.68 KB)
virk_ps:
this is the my latest version of code
The library code still seems to have lots of delay()s. I thought you said you had removed them.
...R
the library delays which remain there are the requirement of the hardware in order to get to work
virk_ps:
the library delays which remain there are the requirement of the hardware in order to get to work
I don't see how that can be true if the device is supposed to be able to do a few thousand samples per second. Even a single delay(1) will prevent that being achieved.
...R
virk_ps:
hello,
i am trying to interface an external high precision low noise 24 bit delta sigma ADC (AD7193) with arduino to capture real time voltages (AC) from a geophone?
can anyone help me and guide me regarding working out with AC signals and ADC with acquiring correct samples for analysis on the digital output data?
thanks
What variety of arduino? Getting 24 bit words into arduino?
Doesn't sound promising...... what time period between consecutive samples are you aiming for?
arduino uno
well if i use a 300 hz (max) signal then sampling rate must be greater than 600 lets say it is 1000hz so sampling period would be .1 milli sec
virk_ps:
lets say it is 1000hz so sampling period would be .1 milli sec
1000Hz is 1.0 millisec not 0.1 millisecs.
The device is capable of sampling at 4.8kSps
The default SPI clock rate on a 16MHz Arduino is 4000khz which implies a transfer rate of about 400,000 bytes per second so if there are 3 bytes per sample that would allow for about 130,000 Sps - far more than the ADC can do. (Hope my deliberately conservative maths is about right).
And if the data needs to be sent onwards using Serial then, at 500,000 baud (about 50,000 characters per second) if each message has (say) 5 bytes the max throughput would be about 10,000 Sp - still adequate.
None of that is achievable even using a single delay(1).
...R