Author Topic: HX711-based milliohm meter  (Read 44388 times)

0 Members and 1 Guest are viewing this topic.

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: HX711-based milliohm meter
« Reply #50 on: November 05, 2015, 03:12:37 pm »
Kalvin, I see.

The difficulty may be with adc'ng a voltage very close to gnd.

The approach I have now is a series of resistors , rail to 1k to sit to 1k to gnd. The voltage across the dut is measured differentially, and at a gain of 20x. The use of the two resistors is to limit current. The use of the lower resistors is to pad the common voltage towards the middle so I get better performance.

If I had replaced the lower resistors with a low value reference resistor, the common voltage would be quite close to gnd (about 200mv if a 10ohm resistor is used).

I can give it a try when I get more time. Maybe a 100ohm reference can be used instead.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: HX711-based milliohm meter
« Reply #51 on: November 07, 2015, 09:19:33 pm »
Quote
I can give it a try when I get more time. Maybe a 100ohm reference can be used instead.

Good news and bad news.

First, the approach works - see the simulation below, with a 10ohm reference resistor, measuring a 0.123ohm DUT. The measurement is generally independent of the supply voltage used, aside from some fluctuation in the last digit.

However, on real hardware, the measurement fluctuates about 50-60mOhm, for a 1ohm DUT. Vs. 10mOHM fluctuations under the prior approach with exponential smoothing.

I will play with it a little bit more to see if I can improve it - in all of its glories: https://dannyelectronics.wordpress.com/2015/11/08/a-mcu-based-milliohm-meter-version-2/

The adc linearity of those attiny devices at near ground levels are amazing.
« Last Edit: November 08, 2015, 12:39:51 am by dannyf »
================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #52 on: November 08, 2015, 08:43:22 pm »
Hi dannyf,

Thanks for feedback and nice to see that it basically works.

I guess that you could improve its accuracy by selecting the reference resistor as follows:

- Reference resistor R2 should be 20 times the maximum DUT to be measured, because the 20x gain used when measuring voltage across DUT.

  For example, if the maximum DUT is 5 ohms, the reference resistor will be 100 ohms.

- Reference resistor R2's current should be set by R1 so that the voltage over the R2 is close to VREF when DUT is short-circuited.

  Short-circuit the DUT and adjust R1 so that the voltage across the R2 is almost VREF.

This will maximize the dynamic range of the measurement.

Now, when you set DUT = 1 ohm resistor, the voltage across the reference resistor will be a bit less than the maximum voltage. And the voltage across the 1 ohm DUT will be measured differentially and amplified by 20, so the dynamic range will be as good as possible.

Using the filtering will make reading stable.

Br,
Kalvin
« Last Edit: November 08, 2015, 08:50:50 pm by Kalvin »
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: HX711-based milliohm meter
« Reply #53 on: November 09, 2015, 12:00:02 am »
Quote
- Reference resistor R2 should be 20 times the maximum DUT to be measured, because the 20x gain used when measuring voltage across DUT.

No need to be 20x. The key to maximizing the resolution: to make sure that the voltage drop over the reference resistor is as close to the Vref selected for the ADC as possible - maybe 80 - 90% of the Vref. This approach produces the largest digit.

In my case, the current is about 10ma so something close to 100R would be ideal.

A sub-optimal approach, which I utilized, is to oversample. Fairly effective as well.
================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #54 on: November 09, 2015, 07:36:32 am »
Quote
- Reference resistor R2 should be 20 times the maximum DUT to be measured, because the 20x gain used when measuring voltage across DUT.

No need to be 20x. The key to maximizing the resolution: to make sure that the voltage drop over the reference resistor is as close to the Vref selected for the ADC as possible - maybe 80 - 90% of the Vref. This approach produces the largest digit.

In my case, the current is about 10ma so something close to 100R would be ideal.

A sub-optimal approach, which I utilized, is to oversample. Fairly effective as well.

Hi dannyf,

You may want to get the voltage drop across the DUT also as large as possible in order to maximize the numeric value from the ADC when measuring DUT, too.

For example, if you choose the reference resistor R2 to be 100 ohms, short-circuit the DUT and adjust the R1 so that the voltage across R2 is 80% - 90% of VREF, you have maximized the measuring range for the reference resistor R2. The numerical values you are getting from the 10-bit ADC is in range 800 - 900.

But you may also want to obtain as high measuring values for the DUT too in order to maximize the dynamic range of the DUT as well. You are taking advantage of the 20x gain of the ADC when measuring the differential voltage across the DUT, so the maximum voltage across the DUT can be 1/20 of the VREF. That means also that the maximum voltage across the DUT can be 1/20 of the reference resistor R2. Thus, the maximum value for the DUT is approximately 1/20 of the reference resistor R2.

With the 100 ohm reference resistor the maximum DUT is approximately 5 ohms, and you should get almost 5 milliohm resolution using 10-bit ADC. Oversampling by factor of 100, you should gain one extra digit ie. you should obtain resolution of 0.5 milliohms which is pretty impressive.

I haven't tested this though, so I may have missed or overlooked something.

Br,
Kalvin
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: HX711-based milliohm meter
« Reply #55 on: November 15, 2015, 05:27:50 pm »
Quote
you should obtain resolution of 0.5 milliohms which is pretty impressive.

Not quite there but I can get to about 5milliohm resolution easily. The update rate is faster than my eyes can process, :)

Quote
I haven't tested this though, so I may have missed or overlooked something.

you are spot on.

I built a current generator out of it, if you are interested: https://dannyelectronics.wordpress.com/2015/11/12/a-digitally-controlled-current-generator/

Those tiny AVRs are simply amazing.
================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #56 on: November 15, 2015, 05:48:30 pm »
I built a current generator out of it, if you are interested: https://dannyelectronics.wordpress.com/2015/11/12/a-digitally-controlled-current-generator/

Those tiny AVRs are simply amazing.

Nice gadget! I haven't been using those small AVRs yet. The Atmega328 seems to be a bit limited in the ADC compared to the Attiny85. I did something similar as built a battery capacity tester a while ago, but used op amp in the control loop and the Atmega328 producing the current controlling voltage with the PWM DAC. I have a few STM32F103 boards and PSOC 5 boards, so hopefully I don't have to struggle with the Arduino and/or Atmega328 any more :)
 

Offline dannyfTopic starter

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: HX711-based milliohm meter
« Reply #57 on: November 21, 2015, 06:51:46 pm »
Quote
The Atmega328 seems to be a bit limited in the ADC compared to the Attiny85.

Very much so.

I worked on a milliohm meter using icl7107 (or the likes), down to 1mohm.

I'm working on another  utilizing mcp3550/3551: 22bit adc and quite inexpensive. Good down to uohm range.

The same strategy works for LTC2400 as well.
================================
https://dannyelectronics.wordpress.com/
 

Offline necessaryevil

  • Regular Contributor
  • *
  • Posts: 133
  • Country: nl
Re: HX711-based milliohm meter
« Reply #58 on: November 21, 2015, 07:07:01 pm »
The Jan 1983 elektor contains two miliohmmeter circuits. The first is just a 100 mA current source, but the second one is a pulsed current source and a sample and hold circuit. Maybe an idea?
 

Offline darksky

  • Contributor
  • Posts: 12
  • Country: gb
Re: HX711-based milliohm meter
« Reply #59 on: October 30, 2016, 05:55:05 pm »
Hi Guys,

I have played with the HX711 and can now read a resistor to an accuracy of better that 50 uohms or 0.0004% of readings.

circuit is 1500ohm resistors with reference as 10 ohms but it is important to place a 0.1 capacitor accross the reference resistor and DUT.

DUT range 0- 22 ohms

Thie capacitor greatly elimiates noise and increases accuracy.

I have also been able to write code for the arduino that allows measurement of a 10k resistor to an accuracy better that 0.5%.

The idea is to place a 10 ohm resistor as the DUT measure its value then place a an unknown resistor accross that, then calculate the effect of the unnown value.

I can now measure accuately from less than 2 milliohms directly and upto 10k with the parallel method. Accuracy at 10K is better than 2%.

Happy to share the code and circuit with any one interested.

Thees chips have a lot of potential.

 

Offline apang99

  • Newbie
  • Posts: 1
  • Country: my
Re: HX711-based milliohm meter
« Reply #60 on: April 27, 2019, 09:33:56 pm »
Hi Darksky:

I came in late in this forum for HX711, can you please share your code and circuit with me? many thanks!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf