Low frequency amplitude and phase measurement - ID sensors - Page 1
Forum section: electronics / projects

author: JackM
author_rank: Regular Contributor
timestamp: January 20, 2016, 03:46:32 pm
content: I am working on a project that makes use of what are sometimes called ID (inter-digital) sensors. TI refers to them as "comb sensors". These are basically a capacitive (and sometimes conductive) sensor with interleaving fingers that are placed in a fluid and can measure changes in the relative permittivity. The idea is that you apply an excitation AC waveform (ie. sine wave) on one side of the interleaving fingers, and then measure the resultant waveform produced on the other side. The generated electric field should penetrate into the fluid surrounding the sensor and also be affected by the fluid's changing properties. These changes should show up on the sensing side in the form of amplitude and phase variations.What I'd like to know is if there are any specially made ICs out there that can be used to measure amplitude (and hopefully phase too) differences between two AC signals at low frequency (I am trying to use a 15kHz sine wave at the moment). I found some ICs from Analog Devices that are meant for RF and microwave frequencies that can measure phase difference, but this is obviously way more that what I need, and they cost too much in low quantity.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 20, 2016, 04:08:20 pm
content: There are a few chips made for this. One is a version from analog - though rather expensive.The frequency is likely to high to work with chips made for energy meters - one might be lucky and find some that work up to the kHz range.One can do essentially the same the special AD chip does in software on a µC: use DDS to create a sine sine signal and and use the ADC to measure the signal. The rest is than just some math - not very simple, but still makable and nothing secret.At 15 kHz even a 8 Bit µC like an AVR could do this- though with limited resolution. I would suggest something like an ARM µC, possibly with an external 12 bit DAC, as the internal ones are often not that good.

author: JackM
author_rank: Regular Contributor
timestamp: January 20, 2016, 04:46:05 pm
content: I was attempting to generate my 15kHz sine wave using some opamps in various configurations such as generating a square wave and then filtering out all but the fundamental frequency, but so far my results are not that great looking and I can't get a very smooth looking sine wave, likely because my filters are not good enough. I may just go with the DAC route for the sine wave generation instead. Would it be recommended to have the same bit resolution on the ADC measurement side as the DAC signal generation side (ie. 12bit DAC, 12bit ADC)?I am also wondering if using a DAC IC to generate a ~15kHz sine wave is really feasible with a 8-bit µC running at say 8MHz CPU clock. Would I even be able to send commands fast enough to the DAC to get a smooth output sine wave?The way my system is setup right now, I have multiple of these ID sensors that are being controlled by an ATtiny85 which is only there to do the actual measurements and then send data back to the main system controller (a Beaglebone Black) for further analysis. I was considering moving up from the ATtiny85 to something more powerful, if necessary (a µC with a hardware UART would be helpful).

author: Vgkid
author_rank: Super Contributor
timestamp: January 20, 2016, 07:09:29 pm
content: What about using an analog phase detector(only if you can have/manage multiple adc channels.)

author: Kleinstein
author_rank: Super Contributor
timestamp: January 20, 2016, 08:30:09 pm
content: DDS frequency generation does not need that many points per period - something like 10 Points is enough, if the required reconstruction filter is used. This way a 8 bit AVR can send 8 Bit sine wave data at up to about 700 kHz rate (at a 8 MHz clock speed) - enough for up to about 200 kHz sine wave. So yes a 8 Bit µC can be fast enough, but this needs optimized ASM programming to do the timing - so not that simple. Also Handling the ADC and doing most of the computations can be done, though the programm might get tricky if it needs to be that fast. A faster µC, like an ARM would make things likely easier - and they have a better ADC inside.It is possible to use an analog solution too. This would more likely start with a clock of 4 times the frequency and than use deivders to get two clocks with 90 degree phase shift to control two phase sensitive detectors. The sine signal is than generated with filters. However the µC based solution is likely better if a digital result in needed, as the ADC is much better in working with a sine signal than with a quasi DC signal from the analog circuit.

author: JackM
author_rank: Regular Contributor
timestamp: January 20, 2016, 09:35:49 pm
content: Having a software selective sine wave frequency generator is not something that is overly important for my project, it's just a nice thing to have for testing purposes. I took a look at some DACs and if I were to interface them with an 8-bit µC via SPI I don't think I could send it commands fast enough to get a nice smooth sine wave in the tens of kilohertz range based on a 8MHz CPU clock. This µC also has to do other things and I'd rather not have it spamming commands constantly to the DAC while it's also listening on a UART plus other things.I've done a quick and dirty breadboard circuit using a 555 timer to generate a square wave, followed by a voltage follower and then a 3rd order Sallen-key butterworth LPF which does give me a pretty nice sine wave, although it is DC biased by 2.5V (is this because of the Sallen-key?).I also have an idea about how to do the phase measurement. Pass the excitation and sensing waveforms through a comparator, then XOR both comparator outputs. A low logic level means both waveforms are perfectly in phase, a high logic level means both waveforms are completely out of phase. Anything in between gives you a PWM signal. This PWM signal is then passed through a LPF (at say ~10Hz cutoff), giving you a DC voltage level that you can directly sample with the ADC in the µC. Does this idea make any sense?As for the amplitude measurement, I was thinking I could just AC couple both waveforms, then implement a peak detector. The peak-to-peak voltage of the waveform is then just double the peak value, right?