Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
benq said:I want to read +/-12VDC signal by using PIC, but the ADC input range of most microcontrollers is 0-5V.
How can I make 1 circuit to map +/-12V to 0/5V?
-12V -> 0V
0V -> 2.5V
+12V -> 5V
Please help!!!
eblc1388 said:First stage voltage follower will not function with single positive supply. Its pin7 cannot go negative.
One needs a -VE power supply also for LM358 to make the circuit works.
benq said:Thanks so much.
I don't know why the voltage at the pin3 of OPA2 is 1.25V. I think it should be adjusted to 2.5V. Is it right?
Diver300 said:I don't know why everyone is going for the difficult solutions, when there is an easy one.
TrueNigel Goodwin said:There are many good reasons to use the opamp method:
1) The resistor values required are obscure.
Also trueNigel Goodwin said:2) It only has a low input impedance.
I beg to differ here. Yes, the resistor network presents a voltage, but that is what you want, and it shouldn't cause damage.Nigel Goodwin said:3) It actually outputs a voltage to the target, which isn't really what you want! - and could cause damage.
The divider network will present about 3V through 10k ohms (up to 300 microamps) at the +/-12V input. If the +/-12V input can't tolerate this, then it's a problem.3) It actually outputs a voltage to the target, which isn't really what you want! - and could cause damage.
Diver300 said:More precise values are 4166.714611hm: and 7142.857143
hm:
eblc1388 said:It would be an handy alternative if one want to reads the AC voltage from say a transformer secondary.
Can you also provide a way/formula to calculate those resistance values so that others will benefit from using this method?
Diver300 said:Connect a 10khm: resistor in series with the point to be measured.
Connect the other end to the PIC A/D input
Connect a 4200hm: from the PIC A/D input to +5V
Connect a 7200hm: from the PIC A/D input to Ground.
More precise values are 4166.714611hm: and 7142.857143
hm:
Diver300 said:I beg to differ here. Yes, the resistor network presents a voltage, but that is what you want, and it shouldn't cause damage.
There needs to be a voltage in the range 0 - 5V presented to the PIC analog input, to be measured. It is just a voltage, no matter where it comes from.
The impedance should be low enough that the PIC can does not affect it. The PIC data sheets talks about sampling times and source impedance. It shouldn't be possible to have too low an impedance.
If the input voltage strays outside -12 to +12, the output will stray outside 0 - 5V, but that will be clamped by the input diodes on the PIC so it won't cause damage, unless the voltages are huge, as the 10khm: will limit the current.
Nigel Goodwin said:Funny?, I don't remember my multimeter puts out a voltage to the circuit on a volts range? - I hardly thin it's "what you want", and certainly not what I want.
The low part isn't for the PIC, but for the sorce, too low an impedance will affect the voltage reading.