Anniyan_x
Member
Hi im studying a circuit&coding which is detecting and measuring very small ac signals using an external 12bit ADC (AD7324) and a dspic microcontroller.
The Measured signal:-
it has a dc offset set to 2.5vdc and a very small variable ac signal rides on the dc offset if is it disturbed, this ac signal need to be measured, and compared with a threshold. if higher than threshold then turn on a led,if lower turn off the led. thats all.
The ac signal is "variable frequency/amplitude" but very small (maybe in milivolts only e.g 220mv) and depends on how the sensor is disturbed.
The circuit:-
the signal feed through op-amp (unity gain), then filters(lowpass & high pass), then another Op amp (unity gain) and then to the external ADC, analog input is set as single ended. in which the analog input range is set to -5 to 5v and using internal Vref set at 2.5v, the conversion is 12 bit. The adc datasheet says that :- 1 LSB = FSR/4096,
The coding:-
reading=getcSPI1();
reading=reading & 0x1FFF; //mask off channel number;
voltage=(float)reading * ADC_LSB; //convert reading count to voltage (ADC_LSB = 5v/4096)
voltage = voltage-HALF_ADC_FSR; // HALF_ADC_FSR is 5
return voltage;
Ok basically the the circuit and coding will detect a very small variable ac signal as explained but what i dont understand here is:-
The vref is set to = 2.5v, but the software calculates the voltage measurements by multiplying "ADC read value with 5/4096" and then the results is subtract again with 5. whats purpose of this?? how to explain the theory behind this?? what i can know is the step size will be 0.00061v
so from what i understand is , if vref is set to 2.5 volt, the maximum voltage the ADC it can convert is 2.5+- few volts, i just dont get how this formula is used to measure the small ac signal present in the dc offset.....any idea??
i just gv the simple explanation.......hopefully enough to triggers some pointers.... ....anyway after getting the voltage reading it will compared with a adjustable threshold value which calculated using another formula.
an example of a calculated threshold value is = 0.049989, so finally just the coding just check the measured ac signal is higher or lower than the threshold.
So The main question is i dont understand theory behind formula to measure the small the ac voltage reading. the circuit works and can detect any small ac noise presents within the filters range.
The Measured signal:-
it has a dc offset set to 2.5vdc and a very small variable ac signal rides on the dc offset if is it disturbed, this ac signal need to be measured, and compared with a threshold. if higher than threshold then turn on a led,if lower turn off the led. thats all.
The ac signal is "variable frequency/amplitude" but very small (maybe in milivolts only e.g 220mv) and depends on how the sensor is disturbed.
The circuit:-
the signal feed through op-amp (unity gain), then filters(lowpass & high pass), then another Op amp (unity gain) and then to the external ADC, analog input is set as single ended. in which the analog input range is set to -5 to 5v and using internal Vref set at 2.5v, the conversion is 12 bit. The adc datasheet says that :- 1 LSB = FSR/4096,
The coding:-
reading=getcSPI1();
reading=reading & 0x1FFF; //mask off channel number;
voltage=(float)reading * ADC_LSB; //convert reading count to voltage (ADC_LSB = 5v/4096)
voltage = voltage-HALF_ADC_FSR; // HALF_ADC_FSR is 5
return voltage;
Ok basically the the circuit and coding will detect a very small variable ac signal as explained but what i dont understand here is:-
The vref is set to = 2.5v, but the software calculates the voltage measurements by multiplying "ADC read value with 5/4096" and then the results is subtract again with 5. whats purpose of this?? how to explain the theory behind this?? what i can know is the step size will be 0.00061v
so from what i understand is , if vref is set to 2.5 volt, the maximum voltage the ADC it can convert is 2.5+- few volts, i just dont get how this formula is used to measure the small ac signal present in the dc offset.....any idea??
i just gv the simple explanation.......hopefully enough to triggers some pointers.... ....anyway after getting the voltage reading it will compared with a adjustable threshold value which calculated using another formula.
an example of a calculated threshold value is = 0.049989, so finally just the coding just check the measured ac signal is higher or lower than the threshold.
So The main question is i dont understand theory behind formula to measure the small the ac voltage reading. the circuit works and can detect any small ac noise presents within the filters range.
Last edited: