The circuit i am working on read two voltage values, the first one comes from 12volt battery thru 5k and 10k voltage divider (analogue input 1), the second is read off a sense resistor (analogue input 2).
The voltage through voltage divider is read fine until the voltage across sense resistor appears then the voltage on the voltage divider analogue input appears to drop 1 Volt from 12.80 to 11.80 with no change shown in the meter which i used to measure externally !! I have been struggling with this and still cant find a solution.
This comes up fairly often. Here's a response from a prior thread:
There is only one ADC, shared between the analog pins. The result is that one reading can be impacted by the last. A common workaround is to read twice, ignoring the first reading. When I posted something like this recently, Grumpy Mike added this:
That is only true if the input impedance to the ADC is significantly higher than 10K.
Keep it at 10K and you can sample at the maximum rate.
On that link -- no it is a diffrent situation, look at the input impedance of the two inputs, there should be no problem.
On the face of it there should be no reason why this is happening. You need to look at the signalson a scope rather than a meter. You could have oscillation on them that is not being picked up by the meter. It also would not do any harm to have some extra supply decoupling capacitors.
i think i found a solution, i was drawing heavy currents from battery upto 4amps, due to high current the voltage was dropping across wire resistance. the voltage was even droping across the fuse,
0.40volts dropped accross the wire connected from battery to board, 0.20v is dropping across fuse and some more across the pcb tracks...
so the voltage read was 12.80 volts as soon as i draw current and show it on 2nd analog input it drops to 11.80......
This is why you must not share ground-returns between high current loads and sensors - the current through the wiring will create IR voltages that add to the sensor input.
A star-ground wired system is normally adopted - all the various sensors and loads have their grounds commoned at a single point. The currents in the loads then cannot influence the sensors.
High current wiring needs to be thicker and either soldered or connected by screw terminals if possible (not breadboarded)
That's fine but it does not explain this line from the original post:-
the voltage on the voltage divider analogue input appears to drop 1 Volt from 12.80 to 11.80 with no change shown in the meter which i used to measure externally
that was correct, what i was doing was that i was measuring the voltage from battery terminals so there was no voltage drop there, voltage seemed to drop after when checked across on the other end of connected wires !!