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

0 Members and 1 Guest are viewing this topic.

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
HX711-based milliohm meter
« on: December 26, 2014, 10:44:37 pm »
I just found a HX711 in my box of junk parts. It is a 24bit adc, primarily designed for weight scales.

The module I have seems to have two imports wired out, but not symmetrical for some reason. The plan is to configure the two channels in serial, with the appropriate padding. One channel would be a precision resistor and another would be the dut.

The adc chip has fairly low spec, so I wouldn't expect miracles but it would be interesting to see if it works out.

More to come.
================================
https://dannyelectronics.wordpress.com/
 

Offline jaxbird

  • Frequent Contributor
  • **
  • Posts: 778
  • Country: 00
Re: HX711-based milliohm meter
« Reply #1 on: December 26, 2014, 11:05:35 pm »
I just found a HX711 in my box of junk parts. It is a 24bit adc, primarily designed for weight scales.

The module I have seems to have two imports wired out, but not symmetrical for some reason. The plan is to configure the two channels in serial, with the appropriate padding. One channel would be a precision resistor and another would be the dut.

The adc chip has fairly low spec, so I wouldn't expect miracles but it would be interesting to see if it works out.

More to come.

Usually I throw out these obscure Chinese chips because of lack of documentation. But if you got sufficient docs then I guess it could make a nice ratio based meter  :-+

Otherwise I have at least 5 8051f350 in my uC box, I'll send you one if you want it.

« Last Edit: December 26, 2014, 11:18:43 pm by jaxbird »
Analog Discovery Projects: http://www.thestuffmade.com
Youtube random project videos: https://www.youtube.com/user/TheStuffMade
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #2 on: December 26, 2014, 11:41:01 pm »
I have used F350s before, very nice chips, particularly with both Vrefs out.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #3 on: December 27, 2014, 10:09:03 pm »
Here is a quick schematic.

The module I used was sourced from ebay, and was poorly designed and poorly documented. It has six pins to interact with your circuit,

1) E+/E- are the positive / negative engerizing terminals.
2) A+/A- are for channel A (128x and 64x gain). the pins are unbalanced in that only A+ has a 1.2k resistor.
3) B+/B- are for channel B (32x fixed). The pins are unbalanced in that only B= has a 1.2k resistor.

The original module was meant for weight scales, so it is designed to work with a bridge, and with only 1 channel (typically Channel A).

I want mine to be ratiometric so I have to use both channel A and channel B.

So here is my wiring:
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #4 on: December 27, 2014, 10:17:58 pm »
The chip has some interesting spec:

1) padding: it requires minimum and maximum common mode on the adc pins. I think it is from GND+1.2 to AVDD-1.3. As the module can only be run from a 5v source (due to a poorly designed Vfb circuitry where a 20k/8.2k divider ratio was used -> AVdd=4.3v). So I have to 'pad" the circuit and to keep the adc pins to be reasonably close to the middle (about 2.1v).

2) channel selection: the full scale voltage is very low. For Ch A, it is either 4.3v/128=33mv or 4.3v/64=67mv (or half of that for bipolar readout). For Ch B, it is about 4.3/32=134mv.

So it makes sense, in order to maximize resolution, to put the precision resistor on Ch B, and the dut on Ch A.

3) precision resistor selection: The current going through the resistor string is about 4.3v/20k=0.2ma. The maximum bipolar reading on Channel B is 134mv / 2 = 70mv. So the maximum value of Ch B resistor is 70mv/0.2ma=350ohm. I happen to have a 82ohm resistor so that's what I am going to use.

================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #5 on: December 27, 2014, 10:30:07 pm »
Here is the data sample, about 2500 of them (the sampling rate is very low, about 0.5sps).

The numbers are the adc readings, at a gain of 1 (Ch A was 64x and Ch B was 32x).

82ohm readings: average - 67789, std dev - 1.874, or 27.6ppm;
1ohm readings: average - 777.6, std dev - 0.795, or 1021ppm.

as the design is ratiometric, we expect the adc readings to be proportional to their expected resistive readings. 67789/777.6=87.17x, vs. 82/1=82x. Close but not exactly the same.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #6 on: December 27, 2014, 10:33:28 pm »
you will notice that about 2/3 into the test, the numbers start to go haywire - i moved the testing fixture and it may contributed to that.

As a matter of fact, if I had used just the first 1500 samples, the performnace would have been much better.

Also, I didn't use a kevin clip so that may have contributed to the worse performance on the 1ohm dut.

================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #7 on: December 27, 2014, 10:38:11 pm »
Here is the actual wiring.

The mcu is a LM4F120 launchpad, running at 1Mhz and 3.3v.

The HX711 module runs at 5v. The level translation was done by two 1k resistors on the SCK and DOUT pins.

The resistor pair can be seen on the left.

================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #8 on: December 27, 2014, 10:44:06 pm »
Potential Modifications:

1) to increase the lower-end of the measurement range, you can run the resistor string hotter. For example, two 1k resistors can be used and you would be running at 4.3v/2k=2.2ma. Correspondingly, you have to lower the precision resistor on CH B so that it remains within the full scale of that channel.

2) resolution: 1 ohm translates into adc readings of 777 - 779, at gain of 1x. So at a gain of 64x, each lsb would be 1ohm / 778 / 64 = 0.02 milliohm; or 0.01 milliohm at 128x gain. More than sufficient for most applications.

3) oversampling: I didn't do this, but you can keep the raw adc data in the calculation so to effectively oversample the adc.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #9 on: December 27, 2014, 10:47:47 pm »
The raw adc data is actually quite noisy. I suspect that this is a 16bit adc with pga.

Once you take out the last few digits, it is fairly stable.

Overall, it was fairly easy to get it up and running. The code is fairly straight forward in C and compiled under Keil. Not much trouble getting it to run.

I got mine a while back and forgot how much I paid for it. I just checked ebay and those things go for a couple dollars shipped. It is pretty good value in my view.

================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #10 on: December 27, 2014, 10:49:14 pm »
As this is a weight scale adc, I suspect that you can buy a weight scale, with its lcd display and everything, and hack it to be a milliohm or millivolt meter - same principle.

That would be interesting to attempt.
================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1834
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #11 on: December 27, 2014, 10:58:17 pm »
Averaging ie. oversampling is a method to reduce the random noise in measurements in order to gain back those lost bits.

In principle, if you take four measurements and compute the average, you will gain one extra bit. If you take 16 measurements and compute the average, you will gain two extra bits etc.

Atmel has a nice application note "AVR121: Enhancing ADC resolution by oversampling" which discusses this in more detail
http://www.atmel.com/images/doc8003.pdf

Br,
Kalvin
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #12 on: December 28, 2014, 09:02:50 pm »
Here is the data sample, straight out of the chip (the only processing is 2's complement, not applicable here).

The blue lines are for 64x gain, and the pink lines are for 32x gain.

The ratio is 43x (43.3x) over about 500 samples.

Deviation is fairly small, looks to be 50 lsbs short term. Reasonably respectable.

However, the killer is the chip's long-term drift. The blue lines drifted 400 lbs, about 0.15%. Not acceptable for a 24bit adc in my view.

================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1834
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #13 on: December 29, 2014, 09:27:01 am »
This is just guessing: Could the bridge and its components cause this drifting. I mean that resistors temperature and resistance might change as you pass current through the components. One other thing that came to my mind is possibility of thermocouple ie. Seebeck-effect due to different metals affecting each other causing voltage difference due to temperature change. Of course, the ADC itself might cause the drifting, too. 
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #14 on: December 29, 2014, 12:11:59 pm »
The current is less than 1ma (0.2ma to be exact). It would be hard that self-heating is the issue here.

I think the adc is the problem.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #15 on: December 29, 2014, 12:12:55 pm »
Don't get me wrong - the millimeter will still work. The drifting we are talking about are quite low and once you have "degained" the adc readings, it is practically gone.
================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1834
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #16 on: December 29, 2014, 03:56:27 pm »
Quote
However, the killer is the chip's long-term drift. The blue lines drifted 400 lbs, about 0.15%. Not acceptable for a 24bit adc in my view.

This small drift 0.15% just made me wonder if there could be some other reason other than ADC itself behind the drift. Anyway, finding out whether it is the ADC or the resistor bridge causing the drift can be found out by carefully heating/cooling the ADC chip or bridge components a little. Yet, the 0.15% error is quite low anyhow :)
 

Online wraper

  • Supporter
  • ****
  • Posts: 12137
  • Country: lv
Re: HX711-based milliohm meter
« Reply #17 on: December 29, 2014, 04:19:55 pm »
Likely internal bandgap reference is not very stable. As I understand, when using internal voltage regulator (+external transistor), that should cancel out measurement drift as bridge supply voltage should drift by the same ratio as reference. You could check how much reference voltage drifts on pin 6 and if bridge supply voltage drifts by the same ratio.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #18 on: December 29, 2014, 04:20:23 pm »
I will experiment more when I get more time.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #19 on: January 03, 2015, 02:30:38 am »
Quote
I will experiment more when I get more time.

As promised, I did.

Set-up: HX711 module controlled by a LM4F120, data out via serial to the PC, reading CH_A and CH_B alternately.

The experiment started at room temperature. At about count 300, I put a hot iron on the chip, separated by four layers of paper towl. The iron is at least 275c and through the paper towl, it is too hot to hold onto the tip with my finger.

Put the tip on the chip  - the rest of the circuit not impacted by the hot iron.

At about count 400, the paper towl had a burned mark on it and started to smoke. I took the tip off the hx711 - at that point, the hx711 was hot to the touch - 85C at least.

Throughout the whole process, the reading is uninterrupted.

The experiment stop'd at count 750.

The adc readings are then charted below.

You can calculate the ppm for both channels.

Two things surprised me:

1) the two channels are negative correlated - I kind of observed that in earlier charts but this is the most obvious. This would make using one of them as a reference to measure the other difficult.

2) the two channels have quite different tempco.

Interesting, in a bad way.
================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1834
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #20 on: January 03, 2015, 12:52:08 pm »
What happens if you heat only the bridge components instead of the ADC? Does it make the results drift?

If the ADC has a built-in temperature sensor, you could possibly measure ADC's temperature and apply precomputed temperature compensation coefficients for the measurement values, after which you should get pretty good results.

Br,
Kalvin
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1834
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #21 on: January 03, 2015, 12:55:20 pm »
Of course, you could provide a constant temperature to the ADC which would solve temperature related drifting problem. Similar technique is used in high precision, temperature stabilized oscillators TCXO.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #22 on: January 03, 2015, 01:09:20 pm »
That would be  purely a test of the resistors' tempco.

What troubles me is the negative correlation - which kills any ratiometric approach.
================================
https://dannyelectronics.wordpress.com/
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 1834
  • Country: fi
  • Embedded SW/HW.
Re: HX711-based milliohm meter
« Reply #23 on: January 03, 2015, 01:24:32 pm »
Heating the ADC from room temperature to finger-burning temperature is quite a big change. As I recall, the original problem was the drifting in room temperature when a resistor was applied. That's why I was also interested in seeing the temperature effect on the bridge components and whether there might be any galvanic voltage sources which could explain the drifting. However, this galvanic voltage source is just my pure speculation, but as we are dealing with a high precision measurements, even small thermal/galvanic voltage sources may ruin the day.

Br,
Kalvin
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: HX711-based milliohm meter
« Reply #24 on: January 03, 2015, 01:56:40 pm »
There is no bridge to speak of: the set-up is ratiometric. As such, it requires positive correlation, preferred 100% correlation - aka the same tempco.

Anyway, here is the iron applied to the resistors, starting at count 300 and off at count 400.

I have to say that I cannot see a difference here, vs. the prior chart.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf