I wasn't aware of that but, the way the input values are processed, offsets should have no effect.The Pico ADC value could have an offset around 30mV (Check pico datasheet).
I wasn't aware that digital outputs, high sources or low sinks, were particularly noisy. They haven't been whenever I have had occasion to hook scopes up to them. But I will admit I never used ARM-based components.The worst part is that you are using the GPIO to change the gnd and 3.3V signal. You know that digital power is very noisy and it will screw up even more the readings.
It is still very baffling that things are behaving differently when current flows through the resistors one way but not the other.
But noise does seem to be an issue, and that will be worse if Vh and Vl go in one direction while V goes in the other. I suspect the inconsistencies are in what's noisy and what isn't is changing over time.
Now I have proved the theory and maths is sound, even if the results are not that accurate, I might move to having equal Rh and RS and see what that reveals.
I am willing to accept an RP2040 may be utterly useless for this task but I would like to get a better understanding of exactly why that is. It may indeed come down to the low ENOB which was pretty poor even without the in-built cock-up.
Or use a micro which doesn't have all the analogue issues which the RP2040 appears to have.I.M.O. you should ...
I built a resistor value checker and sorter using the exact same techniques as here using a low-cost PICmicro device and that had none of the problems to the degree we are seeing here. Perhaps I was incorrect in thinking the RP2040 would be as good as I expected it to be.
The main goal here however was in trying to help the OP, determine if what they were seeing was some kind of hardware defect, systemic issue, or coding error.
I think we can conclude it's no-go using the RP2040 but the Pi 4B-based approach with external ADC should perform better.
Statistics: Posted by hippy — Fri May 10, 2024 4:26 pm