@ron
I'm glad you found the "bug" in your circuit and managed to get better readings, I will answer to your questions now:
- your assumption are right, with the 100 ohm branch max reading is around 6 ohm (R = U/I) = 0.300/0.05 = 6 ohm (0.300 is max voltage allowed by schottky diode 1N5822), if you need more range there is R4 branch with the 1k ohm 1% resistor (on D8), (you can implement this in the code and can have upper range that will give you the range of the 100 ohm resistor X 10, I think the same way a lower range could be implemented with a proper transistor that can source 500mA of current through resistor of 10 ohm 1%).
- you mentioned in your first post that did not use the diodes, I just want to explain now the role of the two groups of diodes, the first group of antiparalel 1N5822 diodes is to allow in circuit measurements, this diodes assure that we will get max 0.3 V on the probes and will not damage components on the board, the second group of diodes 1N4004 are there to protect the input of the Atmega from charged capacitors, good practice is to discharge caps before measurements.
- 65536 comes from 2^16(using oversampling in code we can have a mapped value between 0 and 65535), if we would take a simple measurement on a AIN pin we would get a 10 bit result which is 1024, but as we are enhancing our reading we get a 16 bit result that needs the proper scaling, thus dividing it by 65535, see
http://arduino.cc/en/Reference/AnalogRead.
I wonder where I am wrong with the voltage divider formula, I currently don't have the hardware assembled and no possibility to test it, if you have spare time and in mood please try the following (would be nice to get better results from this simple hardware):
I think
the problem comes from mixing Volts with mVolts in the formula I gave you, probably the reason for negative numbers too, display on your LCD the value of
miliVolt
and see the representation for a known resistor, say 1 ohm, this should be around 0.05 V or 50 mV:
if milivolt (not good)
esrVal = (miliVolt*100)/(4.9-miliVolt) = (50 * 100) / (4.9 - 50) = 5000 / -45.1 = -110
if volt
esrVal = (miliVolt*100)/(4.9-miliVolt) = (0.05 * 100) / (4.9 - 0.05) = 5 / 4.85 = 1.03 ohm
I have to say it's great to have someone to help testing and give feedback, otherwise it gets boring and can lose interest.
Thanks and glad if I could help
