Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Analog Voltage measurement using PIC ADC

Status
Not open for further replies.

nikhilsigma

Full Member level 2
Joined
Jun 19, 2010
Messages
142
Helped
17
Reputation
34
Reaction score
16
Trophy points
1,298
Location
Delhi, India
Activity points
2,584
Hello everyone,
I am having a problem with ADC of PIC18f4520 microcontroller.
I am trying to measure the [Vout] shown in the figure below.

prob.png

The whole circuit is working fine and the measured values are accurate, when the values of R1 & R2 are large like(200 each etc.)

But the problem comes when I decrease the values of R1 & R2, i.e. while lowering the overall resistance and increasing the current in the branch. The readings measured by ADC becomes in accurate !!! Even the CRO shows the correct readings (in accordance with ohms law), but the ADC reading is deviating alot. (Instead of 1.65V it is showing 1.43V, although CRO is showing around 1.64V)


I don't know what problem is coming with ADC when the current flowing in branch is high !!! And since CRO is giving the desired voltage, thus I think the problem is with ADC only....

Note:
1. I have cross checked the ADC ref voltage of PIC.
2. I have places an CA3140 Opamp as a buffer, before ADC and the reading have improved a bit, but the error is still huge...

PLEASE HELP...
 

Upto what value of resistor you have reduced?
check "Electrical characteristics" of your micro-controller. That may help you.
You can sink or source current upto 25mA. Anything above will have the possibility of damaging or causing some malfunctions in the architecture. That may be the problem in your case to shows large error.

Best wishes :)
 
It may be a layout issue. Higher currents are leading to higher volt drops in your ground wires. The micro ground
may no longer be 0V , leading to a lower ADC count. Can we see your layout?
 
1. only an ohm of resistance will make PIC taking larger bias current which can damage PIC ADC i/ps, as pointed by hemnath. Use resistance of 100k. Check google for reference circuits.
2. How r u providing +12V from PIC to MOSFET? The MCU can provide 5.5V max. R u using any driver? Plz specify. Also, the i/p is 12V but drain supply is just 3.3V. That's very odd.
3. As neddie said, the layout plays big role in ADC conversion, so u need to show layout here to find any errors. But only come for this step if u r sure of above 2 are fine.

Hope that helps.
 
Thanks everyone for the response....

Neddie was correct, large currents were making alot of voltage drop across the contact resistances(as i was making this circuit on breadboard)..... :(
I reduced the ground loop and the results were improved considerably....

Lesson : Breadboard isn't good for high current applications....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top