Electronics > Projects, Designs, and Technical Stuff
HX711-based milliohm meter
<< < (9/13) > >>
Vgkid:
Thanks for the update.
Kalvin:

--- Quote from: dannyf on October 28, 2015, 12:34:10 am ---I have done more work recently on this that you may find interesting: https://dannyelectronics.wordpress.com/2015/10/25/a-hx711-based-milliohm-meter/

Running the circuit at 2ma and utilizing a 10R reference resistor, the resistance readings are stable to the 4th digit (after the chip has reached thermal stability).

I am starting to appreciate this little bugger now.

--- End quote ---

Thanks for your update. I read through you blog posting, and the results I have are in line with your measurements.

Here are my measurements from the last night at room temperature of 23C. I have removed the 1K series resistor and filter capacitors from the A and B inputs. The HX711 is used in "fast" mode, so there are approx. 8 readings/s. The "fast" results are filtered using a simple running average of length 128 samples.

The filtered data plot is shown below. The Y-axis range is 0.9995 ... 1.0005 ohms as the measured resistor is nominal 1.000 ohms. After the initial transition, the filtered results have variance of approx. +/- 0.05 milliohms (ie. +/- 0.00005 ohms), so the measurement resolution is within +/- 0.1 milliohms (ie. +/- 0.0001 ohms). Without averaging, the resolution is within +/- 1 milliohms (ie. +/- 0.001 ohms).

The resistors used in the current measurement arrangement are quite sensitive to temperature changes, as placing the finger on the 1/4W metal film reference resistor or the 1/4W metal film resistor to be measured will change the measurement result by approx. +5 milliohms.

Placing the finger on the HX711 has very little effect: the measurement reading changed less than 0.2 milliohms, so it seems that HX711 is not too sensitive to temperature changes in order to be used as a milliohm meter with the usable measurement resolution of +/- 1 milliohms and the update rate of 8 readings / s (see my previous post above).
dannyf:
Kalvin: great work.


--- Quote ---The "fast" results are filtered using a simple running average of length 128 samples.
--- End quote ---

That's a good way to filter out the noise. But on a small mcu, the space / time requirement can be excessive.

Another way to implement that is to utilize exponential smoothing:


--- Code: ---  uOHM_s+=(uOHM - uOHM_s) * alpha;

--- End code ---

where uOHM_s is the smoothed output (equivalent to your moving average), uOHM is the "instantaneous" measurement of the resistance, and "alpha" is the weight you give to the current measurement. The lower alpha is, the longer the "memory" of the algorithm is. using alpha of 1/128.0 for example would produce similar performance as your moving average (not quite the same but similar).

For example, the chart below shows the instantaneous measurements (uOHM, red trace), 16-sample smoothed measurements (uOHM_s), and 16-sample moving averaged (uOHM_avg).

Hope it helps.

Kalvin:

--- Quote from: dannyf on October 28, 2015, 11:08:26 am ---
--- Quote ---The "fast" results are filtered using a simple running average of length 128 samples.
--- End quote ---
That's a good way to filter out the noise. But on a small mcu, the space / time requirement can be excessive.

--- End quote ---

Typically I would use the exponential weighing for the filtering, but for this particular measurement setup I decided to use true running average as it has well defined window of N samples (N=128 this time). In the final version I will use the exponential filtering, though.

I am running the test code on Arduino Nano (atmega328p) with the 2.2" QVGA TFT SPI for displaying the measurement data and using the serial port for actual data logging. The TFT update using hardware SPI is still so damn slow that it affects the measurement rate a bit, but the update rate is still sufficient so that the Arduino is usable as an evaluation platform. I had those displays in my drawer, so I picked one for this project. My final hardware will be running on a STM32F103, but I wanted to get up and running fast and chose Arduino for prototyping.

BTW, I tested two high power diodes 1N-something placed across the input terminals as overvoltage protection and they didn't affect the readings at all as the measurement voltage is iwell below diodes' threshold voltage. In the actual design I will use an isolated +5V/+5V DC/DC-converter and optoisolators to isolate the HX711 from the rest of the system so that the device can be powered safely from a USB-port and the measurement signals are truly floating.

Edit: Using the TFT gives some possibilities here. For example, there can be two reading on the display: One is the latest measurement value, updated 8 times in a second with the resolution of 1 milliohm. The other value shown is filtered/averaged value giving resolution of 0.1 milliohms. Of course, the display could also show some other measurement statistics like low/high resistance in milliohms etc. I have also a beeper onboard which is will change its pitch according to the measured resistance.
dannyf:

--- Quote ---n the final version I will use the exponential filtering, though.
--- End quote ---

If you want, I can share with you an approach that I have used to quickly calculate moving average (sum actually): it takes one subtraction, one addition, and one assignment to yield a moving sum. Plus one division or one shift if you wish to get an average. The algorithm is particularly useful if you desire a long window of data.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod