Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

adc & volts

Status
Not open for further replies.

aristos

Member
How does the adc value can be turned into a voltage value?I think there is a type but i am not sure if it is correct....
 
V = ADCresult * Vref / 1023

Mike.

Not entirely correct, depending on the pic or code used....

V = ADC result * VREF / ADC resolution...

So for 8 bit ADC res = 255, 10 bit = 1023, 12 bit = 4095, 16 bit = 65535

I am using an 18F2431 with 10 bit ADC in a barometric altimeter, but with a bit of extra code, I get 16 bit resolution..
 
How?

Mike.

here is an extract of the "oversampling" code I use, it's done in proton PicBasic:

get_ad:
AD_temp = 0
AD16 = 0
voltage_ref = 0
For ADloop = 0 To 63 'software tweak to increase AD resolution
AD_temp = ADIn 0
AD16 = AD16 + AD_temp
Next ADloop
voltage_ref = ADIn 1
V_step = V_ref_2 / 1024
V_ref = voltage_ref * V_step
Sensor_1 = AD16 *( V_ref / 65535)
pressure_1 = ((Sensor_1 / V_ref) + 0.095)
pressure_local = (pressure_1 / 0.0009) / 1.00463


Ignoring all the variables and stuff, basically you just sample the 10 bit ADC 64 times, adding all the sample values into a variable, and voila, 16bit result!!

Using 10 bit accuracy, I am limited to 5 foot resolution, but with 16 bits, I get 9 inch resolution!!!
 
There are some very fancy noise shaping techniques that will get you 18-bit results out of 16-bit data, but those are very advanced DSP algorithms that I don't think could realistically be done on a PIC. I vaguely recall them from my senior-level DSP lab. I think one of the new Tektronix scopes uses this to get ~10 bit data on an 8 bit scope if you run it in a special mode (which is slow).
 
Last edited:
Ignoring all the variables and stuff, basically you just sample the 10 bit ADC 64 times, adding all the sample values into a variable, and voila, 16bit result!!

Using 10 bit accuracy, I am limited to 5 foot resolution, but with 16 bits, I get 9 inch resolution!!!

hi shax,
I cant see any point in increasing the resolution to 16 bit when the accuracy remains at 10bit.
It is possible to sqeeze an extra bit from 10bit by oversampling.

My suggestion would be to use a £1GBP, ADS1100 16bit ADC piggy backed on the top of the PIC and connect using I2C.:)
 
hi shax,
I cant see any point in increasing the resolution to 16 bit when the accuracy remains at 10bit.
It is possible to sqeeze an extra bit from 10bit by oversampling.

My suggestion would be to use a £1GBP, ADS1100 16bit ADC piggy backed on the top of the PIC and connect using I2C.:)


It's good enough for me, keeps the schematic simple, and I get the required repeatable results...

Maybe it is only 10 bit accuracy, but I get a decent average, with the required resolution...
Re using a seperate ADC, using I2C... Nope, not even gonna go there with this project..
Might use the SCP1000 (17 bit res) in the next incarnation.. Good to 9cm!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top