Adc0831 questions current conversion and leakage .
vaclav_sal
Posts: 451
I am using ADC0831 to make a digital display from an analog source which has a full scale range from 0 to 1 mA. I got the software working converting voltage drop on 1kOhm resistor.
I was curious if there is a way to read the current instead of the voltage drop using this converter.
I did not find any app notes on that.
My second question is more practical. I need to change the reference voltage to get full 256 bits scale.
I am going to use PWM to generate the required reference value.
It is recommended to use low leakage capacitor to keep it from discharging too fast.. Since there is a leakage inside the processor itself do I really need low leakage capacitor?
I have polystyrene caps somewhere in my junk box and I am planing to use them.
But they may be too small of a value.
What would be the most suitable make of the capacitor (technology) to use?
As always, any constructive help is appreciated.
Thanks for reading.
Cheers
Vaclav
I was curious if there is a way to read the current instead of the voltage drop using this converter.
I did not find any app notes on that.
My second question is more practical. I need to change the reference voltage to get full 256 bits scale.
I am going to use PWM to generate the required reference value.
It is recommended to use low leakage capacitor to keep it from discharging too fast.. Since there is a leakage inside the processor itself do I really need low leakage capacitor?
I have polystyrene caps somewhere in my junk box and I am planing to use them.
But they may be too small of a value.
What would be the most suitable make of the capacitor (technology) to use?
As always, any constructive help is appreciated.
Thanks for reading.
Cheers
Vaclav
Comments
For your second question I would advise against using PWM to generate a reference voltage for an adc. It will inject noise into the system without good filtering. Simpler to use a voltage divider or voltage reference chip.You could also use an op amp to kill 2 birds with one chip. It could convert the current signal to a voltage and amplify it to the desired level.
I was afraid that I cannot convert current using this ADC.
As far as using PWM to generate reference voltage I'll experiment with it.I am not looking for great accuracy but I need to calibrate to full scale each unit. I started with Vref tied to +5V but got only to about 80 instead of 256. But it just followed the spec. Right now I have a variable resistor on the input. I have not calculated the reference voltage and it may be easier to use simple resistor divider as you suggested plus the input resistor.
Vaclav .
edit: sorry, they call it Vin- on the data sheet, not Vref-
OK, the input is from source (external device) connected to 1 kOhm potentiometer -'hot” side.
The other side goes thru 330 Ohms “safety” resistor to ground.
The source supplies 1mA current at full scale.
The viper goes to Vin+.
At full scale Vin+ is 1V.
The Vin- is grounded.
Vref was directly connected to +5V Then my max digital output was 80.
Now I am attempting to adjust Vref using PWM – “standard” RC output via 10kOhm resistor and 1uF capacitor directly to Vref..
The voltage never gets pass about .7V, no matter how I adjust the PWM .
I can see nice charge curve ( max 5 V) at the capacitor when there is no ADC loading down the RC circuit.
It looks like the ADC Vref load is too much for the BS2e and using PWM via RC circuit only is out.
Reason I want to use PWM is that I could calibrate the ADC – full scale = 1 V instead of using the input potentiometer.
I am not sure how to calculate the required Vref to get full scale with my input being 1V.
Somehow I missed it in the spec.
When I figure it out I shall try a fixed Vref – either simple voltage divider from +5V or Zener if it is close to some standard value.
Maybe I 'll try insert a "driver transistor" from RC to Vref.
Thanks for your help, I appreciate it.
Cheers
Vaclav
just where did you find this "magic formula"?
In my case it should be Vin- GND and Vref around 1V.
I still would like to do this in software, using PWM.
( Just looking for most complicated selfpunishing way!)
I am Googling for solution right now.
Vaclav
Its in the data sheet but its not real obvious. They call it "ratiometric". There's also a circuit on page 22 called "Digitizing a Current Flow", which might offer you some more help.
http://www.national.com/ds/DC/ADC0831.pdf
I have been thru this ADC0931 spec several times and never found clear answer. This is typical of what I affectionately call voodoo electronics.
They never clearly define “radiometric “ either.
But I found a little tidbit in Parallax documentation basically saying you cannot directly drive a device from the PWM RC circuit. And they suggested OP amp buffer ( App note 15 in BS1 of all places!).
National spec says something about the source of Vref must be capable to drive “3,5 kOhm”.
So the question is – how do you calculate all this instead just guessing?
But it is beginning to make sense. To bad it took this long to figure it out.
I guess some of us are slow , but I finally found use for dozens on 741 I collected over the years past.
Cheers
Vaclav
The ADC083x is an 8 bit adc. It compares the input voltage Vin to the reference voltage Vref and outputs an 8 bit binary number between 00000000 and 11111111 (0 – 255 decimal). This is where the term ratiometric comes from. The reading is a number representing the ratio of the Vin/Vref.
Lets assume a Vref of 2.56V is used. That will make each bit represent 10mV (2.56/256).
If you put 0V on the input then the output reading will be 0.
If the input voltage is 1V the output reading will be 01100100 binary or 100 decimal. Multiply that by 10 (10mV per bit) and you have 1000mV or 1.00V
Put 2V in and the reading is 1100100 binary, 200 decimal, which is multiplied by 10 to give 2000mV or 2.00V
Vref can be any voltage up to the maximum voltage the chip is rated for. Typically it is either a convenient available voltage such as +5V, a voltage that makes the calculations simple such as the 2.56V above, or one that is very close to the maximum Vin to obtain the best possible resolution (1V in your case).