View previous topic :: View next topic |
Author |
Message |
filjoa
Joined: 04 May 2008 Posts: 260
|
multimeter for positive and negative |
Posted: Sat Sep 20, 2008 1:49 pm |
|
|
Hi
I made a power supply for my lab and now I like to add a display 2x16 for viewing but I don't know how I can meter negative voltage with a PIC18F452.
Now I have positive voltage working but I don't know how to make this for negative.
This is the ADC part of my circuit so I can meter 0V-25V:
Someone can help me? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun Sep 21, 2008 12:38 am |
|
|
A straigthforward solution is by using an operational amplifier in an inverting circuit. A single supply or rail-to-rail type can do without needing additional supply voltages. The non-inverting input is connected to ground,
the inverting input is at the midpoint of two resistors to the negative voltage input and the OP output. The resistor ratio defines the input scaling.
As another remark, you should not use a variable resistor divider feeding high voltages directly to the PIC without a current limiting resistor. You easily damage the chip by turning the adjustment too far. You can better calculate a fixed divider according to the input range and do the adjustment in the software - or use a fixed divider with a small variable part. |
|
|
filjoa
Joined: 04 May 2008 Posts: 260
|
|
Posted: Sun Sep 21, 2008 5:01 am |
|
|
Hi
I know the problem with regulators but I adjust before put the PIC for max value of power supply.
I continue understand how I can obtain with PIC negative part. you have same example?
regards |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Sun Sep 21, 2008 6:20 pm |
|
|
To measure a negative voltage with a PIC A/D I would use a pull-up resistor from the A/D to your +A/D reference voltage, and a resistor from the A/D to the negative voltage. Find values so that the A/D pin sees near 0V with full negative input voltage, and a positive voltage as the input approaches zero. Also make sure the negative resistor is high enough that the clamp diodes can handle the current if the + reference voltage fails.
To use the full span of the A/D requires something more sophisticated. But I think this will serve you well. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Tue Sep 23, 2008 11:24 pm |
|
|
SherpaDoug, thats an interesting way to measure negative voltages :-) Never really though of that.
Its not VERY accurate, but its a super-cheap way to do something that you'd normally use an opamp based level shifter or inv amp to do.
Cheers! :-)
Rohit |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Sep 24, 2008 7:33 am |
|
|
If for example you are measuring 0V to -5V and have an A/D with a range of 0V to +5V, you can use equal up and down resistors to get 0V to 2.5V at the A/D. The accuracy is only limited by the accuracy of the resistors and the fact that you lose 1 bit of resolution due to using only half the A/D range. Also this method does not require a negative power supply.
Using the usual inverting opamp requires a negative supply and also introduces all the possible errors from the opamp. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
|