Hi every one:
Does any one have any ideas as to how I can measure negative voltages accurately using the pic's internal ADC or an external ADC. The voltage would be between -2 to 12 V.
thanx
sam
Hi every one:
Does any one have any ideas as to how I can measure negative voltages accurately using the pic's internal ADC or an external ADC. The voltage would be between -2 to 12 V.
thanx
sam
One idea might be to use an op-amp, like LMC662, and raise the negative voltage with the offset fed into the op-amp. But since the span is |-2-12|=14 volts you will need a divider too. So I would use a divide first to down scale the voltage range with a 2 resistor divider and obtain maximum 3 volts when the input will reach 12. That is because the op-amp would have an offset of 2 volts,so the output would be raise to 5Volts.
The divider should be a divide by 4, like 3K from input to common node and 1K down to earth.
The common node is going to feed the +input of the op-amp and the - input of the op-amp would get -2 offset voltage (with a low Z source). The output should be connected to the -input (follower). Now the power supply should be +/- 5 volt at least (sorry...).
Ioannis
thanx for the idea but is there any way you can give me a diagram.
thanx
sam
What part you don't understand?
I do not ussually draw schematics on screen...
Ioannis
Hi Sam,
Attached is a schematic of an inputstage I've designed and used succesfully with the internal ADC. It's an OP-based rectifier with adjustable gain.
Apply your -12V signal to the input and adjust P1 untill you get your desired output (+5V or +4.096 or whatever). (Do this before you connect the output to the ADC)
The sign output will be high or low dependig on if the input voltage is positive or negative and you can use a digital input to read the sign and 'add' one bit of resoultion to the ADC resulting in +/- 10bit. Since your voltage is always negative you can leave that part out if you don't need it.
There's one drawback though. You need to feed the OP-amp with +/-15V.
Hope it helps.
/Henrik Olsson.
On the schetch of Henrik please consider the voltage drop on the output resistor of 1K that is going to be in series with the ADC input resistor of your PIC (about 10K). That will give a ratio of about 1/10th.
Ioannis
Bookmarks