If I have a range of voltage, .968V to 2.273V, and I have an A/D conversion (1023) done by 12f675 , how do I get returned value as angles 0-359.9, and what accuracy can I expect? I've been on this project for a while, and I am disappointed at my math skills.
For maximum accuracy you need to spread the range over the entire input range of the A2D, and use an external reference for the A2D as well. So use a precision reference for the A2D, giving an input range of 0-2.5V. Then use an opamp to scale the sensor input from the range above to 0-2.5V. This will give you just over 0.1% resolution - absolute accuracy depends on the quality of the reference, and the opamp scaling cicuit.
If I have a range of voltage, .968V to 2.273V, and I have an A/D conversion (1023) done by 12f675 , how do I get returned value as angles 0-359.9, and what accuracy can I expect? I've been on this project for a while, and I am disappointed at my math skills.
hi,
You show a resolution of 3600 points, the ADC has 1023 points
So actual resolution is 1023/3600 = 0.28Deg.
Rounded up say 0.3Deg.
The Vin range is 1.305Volts.
As the minimum voltage inp is 0.968V it would require this to be offset to 0V
and the Vrange * Gain = +5V input to the ADC.
Ok Nigel Thankx. I know about augmenting the total signal voltage so Pic A/D can occur accurately, I think minimum is 2V? for 12F675. How do you take 1023 resolution and get 360 deg? What will my accuracy be, 0.1 deg? Again thanks for all the help.
Ok Nigel Thankx. I know about augmenting the total signal voltage so Pic A/D can occur accurately, I think minimum is 2V? for 12F675. How do you take 1023 resolution and get 360 deg? What will my accuracy be, 0.1 deg? Again thanks for all the help.
No, it will be 0.1% as I said, which would be 0.36 degrees.
To convert to degrees simply multiply by 0.352 (to three decimal places) - which is 360/1023. Better to scale it up and multiply by 352, than use slow and inaccurate floating point routines. EPE has 32 bit interger maths routines which would be fine.
To offset the input to the opamp you just use a simple opamp adder - and add a negative voltage to the input.