Home    Resources    Monitoring    Equipment    Forums    Links    Pictures Gallery    Contact    

Links
Home
Resources
Monitoring
Equipment
Forums
Links
Pictures Gallery
Contact
Admin

    

Search

        

Your account





Lost Password?
No account yet? Register

            

            

Who is online ?
We have 1 guest online

            



Analog measuring with reference accuracy compensation
Written by Stephane   
jeudi, 21 février 2008

This schematic allows to sample an analog input as a sensor, but without taking care of the reference accuracy. By this way, you won't have to calibrate the sensor by software which means no end of line procedure for calibration.

Moreover, it could also avoid to have bad measures when several sensors are wired to a same reference and that the reference voltage decreases.

 

AnaInput.gif

 

 

 

 

 

 

 

 

 

 

 

 

.

 

formula1.gif

 

 

 formula2.gif

 

 

By computing the ratio between the two analog inputs, the result is independent from the accuracy of Vref because Vsig will always be a ratio of Vref. This means that whatever the value of Vref, the ratio won't change.

Let's take R1 = R3 and R2 = R4 to have the same gain on each input. Then, the sensor signal value becomes :

formula3.gif

 

 

So, to keep low resolution, you could write in C :

u16SensorValue = (u8Asip_AN2 * 100) / u8Asip_AN1;

The result will then be a integer between 0 and 100 (i.e. 0 to 100%)

If more resolution is needed, you could write :

u32SensorValue = (u8Asip_AN2 * 10000) / u8Asip_AN1;

The result will have be an integer between 0 and 10000 (i.e. 0.00 to 100.00%)

 

 

Last Updated ( vendredi, 22 février 2008 )
 





  © Copyright 2008. Hamradio Experiments is powered by F1TJJ - Stéphane Rey