Building Reservoirs and Weighing Water for level gauging and flow metering.
Our journey has long left the mere "reservoir" part behind. Sometimes it appears things are growing into each other, often displacing features, sometimes acting synergistically.
This time the reservoir housing has become something between an enclosure for reservoir, pump and controller, a holder for the reservoir vessel and a fancy desk lamp. The scale / strain gauges aren't integrated at this point but we'll get there in due time.
Note this prototype has been implemented with translucent PMMA while later version will be made from opaque white PMMA. With the lights out, the thing still looks rather shiny:
The wide open and simple lid should make pouring in without spills an easy feat. The food safe stainless steel vessel is a GN 1/6 200 mm container holding up to 3.4 L. It's a multi-sourced standard part and the dimensions are more or less guaranteed. They also come in translucent plastic.
White PMMA is a much better diffusor. Here are the rough target dimenions of the part estimated from measurements and later confirmed to almost perfectly fit the container (note the circumferential step, the mantle has to sit behind that.
I was about to say the rest is as easy as bending PMMA in shape. In practice we built the strip heater first, created bends on 3 mm test pieces (same thickness as the mantle) and measured the resulting inside and outside lengths of the specimen to base the model on them.
The bending device consists of a 600W IR heater (~45cm in length) occluded with aluminium T profiles and a flat profile wrapped in Al foil and tape in a haphazard attempt to control convective heating of those rails. It works for now but requires cooldown after each bend, so consider a water-cooled solution.
The unfolded surface model considers bend allowance to some degree. The pro forma way to calculate bend allowance is shown here,
but there is no straight-forward way to calculate yielding under compressive or tensile strain in a part transiently heated from one side.
Anything between these temperatures is fair game for bending. with a distance of around 20 mm from the quartz heater and the rear reflector still in place a heating cycle time of about 2 min 15 sec (starting cold with no pre-heat) softens the material on one side sufficiently and seems to keep the other side near Tg so it will yield only slightly,
Initially a "compressive yield bend" - towards the heated side - was intended, but due to a minor oversight the first bend was made the other way ;-) As it turns out the "tensile yield bend" doesn't produce an unsightly wrinkle but slightly lengthens the material, once again owed to the inhomogenous thermal profile throughout the thickness of the sheet.
With a bit of over-bending (about 10 .. 30° held for 1-2 sec) springback is eliminated. A right angle fixture is mandatory to control the resulting angle and the 45° facet is eyeballed and tweaked in the early moments of cooling.
Minor adjustments are possible by re-heating one bend line at a time, all the while softening is tested by observation and feeling how the part reacts to slightly bending the zone back and forth.
The unfolded surface has been designed in OpenSCAD, adding small notched that help aligning the bend line to the heater slots with two drill bits. Works a treat.
The OpenSCAD export to .svg has been used to create suitable files which, once checked and modified for proper scaling are fed to the lasersaur web interface.
Let's cut to the chase and figure out how to treat an ultra low noise reference like MAX6126.
It will be annoying to add a temperature sensor to the load cell, e.g. by glueing an NTC to the element and judging by our previous set of experiments the single point load cell type does not seem to be overly sensitive to temperature variations and satisfies temperature stability requirements without further compensation and software calibration. Absolute measurements however are degraded by reference drift:
TC74, AT30TS74, TMP100 (cheap to expensive)
Once again it's easier to not cause disturbances than to deal with them later on.
But to quote DaveEvans on temperature calibration ( https://forum.arduino.cc/index.php?topic=365107.0 ):
I'm not especially happy with the results. Subsequent tests showed that it improves accuracy somewhat, but not as much as I'd hoped.
Once more we'e left with the need to perform more experiments to see where the 80-20 trade-off is. Maybe we're already there, or maybe integrating HX711 and subjecting it to heat and switch-mode converter noise will be a big deal.
next up we'll finally use HX711 data to determine the effects of PNP transistor selection, output bypassing, reference bypassing and power supply ripple rejection.
Having a look around for layout recommendations initially chips like MAX4196, MAX1452 and MAX1455 cropped up - preamp and signal conditioner ICs for strain gauge measurements. But that's a bit beside the point so here's just a reference for further reading.
More intriguingly there's ADS1231 for ten times the price of an HX711. Check out its features:
While HX711 provides the same features (except the datasheet doesn't go into detail as to how the 50 / 60 Hz suppression is implemented, possibly due to patent issues) - it expands the capabilities by adding an input multiplexer with different gain options, a bit-counting command decoder for the new config options and sadly eliminates both the filter / bw limit capacitor after the PGA stage as well as the differential reference input.
ADS1231 relies on an external voltage reference and implements sleep mode with a low side switch while HX711 has an integrated LDO with external PNP pass transistor and its power-down capability.
general LDO noise
Since we're talking 20-100 nV precision it's very interesting to see this seeming neglect of differential reference implementation in the HX711 design. ADS1231 design choices also seem to hint at a possibility that integrated LDOs are usually not good enough - even dedicated external "ultra low noise" LDOs like http://www.ti.com/lit/ds/symlink/lp5907.pdf still feature 10µVrms (10 Hz .. 100 kHz BW, *with* 1µF output capacitance?) with a substantial 1/f-noise contribution in the 10-100 Hz band
the primary noise source of an LDO is its reference, so proper bypassing of the voltage reference pin might be just as effective as increasing the LDO output capacitance. This is particularly relevant...Read more »
There's a lot of room for paranoia when stepping from the digital domain with its noise margins, supply ripple and voltage tolerances into areas of analog and mixed signal circuitry.
Connectors, analog switches, scaling networks, voltage reference and supply filtering components are situated in the analog domain while dedicated ADCs and controllers with integrated multiplexers, programmable gain amplifiers and ultimately ADCs are mixed-signal ICs.
Suddenly there are concerns about internal electromagnetic compatibility, identification of sources of - and ways to mitigate - interference. There are also selected aspects of systematic measurement errors which will not be discussed in this log (temperature effects like bias current / voltage shifts, reference voltage drift, thermoelectric voltages; mechanical effects like strain hardening, yielding or just creep, hysteresis of sensing elements, non-ideality of summed sensing elements and so on).
There are a few coupling mechanisms for EMI to consider when creating a new layout or fixing an existing one.
Obviously the effects - noise currents into or noise voltages added to analog nodes of the circuit (including supply rails) - are the same no matter the way they were created. The above nomenclature helps pointing at the causes of interference while looking at the interaction of electric and magnetic fields yields ideas how to address susceptibility.
A brief detour through classic electromagnetism.
Furthermore it feels to me like the distinction between "coupled" and "radiated" EMI often doesn't make a lot of sense at the component or PCB trace level.
If part of the circuit picks up interference, it's susceptible to the local values of the electric or magnetic fields while "radiated" only suggests to me that there are electromagnetic waves involved which in turn means that one is only supposed to be concerned with field components that are able to propagate through space.
To quote https://en.wikipedia.org/wiki/Near_and_far_field on the distinction of field zones,
"Far-field E (electric) and B (magnetic) field strength decreases inversely with distance from the source, resulting in an inverse-square law for the radiated power intensity of electromagnetic radiation. By contrast, near-field E and B strength decrease more rapidly with distance: part decreases by the inverse-distance squared, the other part by an inverse cubed law, resulting in a diminished power in the parts of the electric field by an inverse fourth-power and sixth-power, respectively. The rapid drop in power contained in the near-field ensures that effects due to the near-field essentially vanish a few wavelengths away from the radiating part of the antenna."
Usually the near field is a complicated mess (topologically) but what matters is the net induced current or voltage. surfaces act as capacitors, loops and slots act as inductors which couple to alternating fields, constituting capacitive and magnetic coupling respectively.
Inversely, purely magnetic (loop antennas) or purely dielectric (DRA) structures work fine while predominantly coupling to one of the fields. The complementary field is being regenerated as per
But I digress. Take-away: open conductor loop areas act as magnetic noise pick-ups while free standing conductors sample the local electric field.
So "just make bad antennas". Minimize susceptible loop areas, block AC magnetic flux paths by adding ground planes and if possible arrange components to they provide Faraday shielding against electric fields (e.g. stacked PCBs or dedicated shielding cans).
Even if high frequency fields are outside the frequency bands of relevance, they might still interact non-linearly with the circuit and can thus be rectified into voltage offsets or bursts. This is where the dimensions come into play, at least in...
The hardest part about running an experiment is to resist messing with it as it's running and there is time to figure out what things need to be changed or improved.
It's a bit counter-intuitive: A consistent measurement is better than one conducted under spontaneously changing conditions. It's easy to restart measurements when they're done within a matter of half an hour. With measurements that run for days on end it's a different story.
In the following graph two abrupt changes are recorded. The first one is due to the identification of a possible source of error and subsequent mitigation attempt:
The second change was caused merely by moving the cables around a bit, causing a 0.5% jump in the reading. The change equals ~25 g load change which can hardly be explained by a few 0.14 mm² IDC ribbon cables pushing in a different way. So beside thermoelectric effects, noise pickup seems a likely cause.
A third run will use just the HX711 front ends, the scale electronics and the four pairs of sense cables will be removed to monitor just the unperturbed load cell elements.
Adding the transformer to sample mains voltage variations was still a valid idea to quantify DMM transformer + LDO loss influences and understand the other measurements in retrospect.
So on the one hand it's always worth investing a couple more hours improving the experimental setup to get better and more credible results. On the other hand, part of cunducting experiments is to identify all the things that have been overlooked or to been considered.
We shall be doing this again. For science :)
Say hello to these shiny 3.4 L reservoirs made from stainless steel. They're completely off the shelf and a set of those GN 1/6-200mm containers with a cut-out lid cost me about 11€. Custom made stainless steel vessels and tanks are going to be way more expensive and I love the fact that these are multi-sourced, clean-cut standard parts. Living in an area where tap water is basically liquid limestone and wanting to add a whiff of fertilizer to the water is bound to spell precipitation and algal troubles, so I'll hope to keep the annoying cleaning part for more important pieces of the kit, i.e. the tubing.
These reservoirs can be inserted into a rectangular mantle with 150 mm x 162 mm outer dimensions. Since I only have 500 mm x 600 mm stock material for the mantle this is going to be rather interesting. I'm aiming for a good fit but will add 45° corner truncations, moving them inwards by 20 mm. I've only done PMMA bending once and found it to be rather much of a pain, what with it bending back again and taking quite a few minutes to freeze in place.
More experimentation will surely be required to get the mantle right.
On youtube different versions of "acrylic bending table" builds are presented that are competing in their ability to set your place on fire.
More testing to be done.
load cycles: 24h loaded to 100% nominal load, then 24h recovery
temperature cycles: RT (as part of the 24h no-load phase), fridge, RT (~12h each)
seems like now is the time to hook up SPI.
No precision voltage sources will be used this time because HX711 supplies the reference voltage and the measurement scaled to AVDD.
ps. single point cell - temperature drift
The single point cell sense voltage drift looks pretty much the same as that of the 5 kg scale elements one.
I must confess I haven't spent much time looking at NTC curves before. My prior knowledge was that they are somewhat ill-defined and can only deliver reliable measurements when calibrated individually.
The temperature characteristics of NTCs can be fitted using the Steinhart-Hart (S-H) equation to a practical degree of precision:
As it turns out, I seem to have bought 10k NTCs of the K164 type and I don't know their R/T number. Apparently they're made by EPCOS / TDK and offered in a whole array of curve shapes / coefficients.
At first glance, 1014, 2903 and 2904 characteristics seem to match the quick&dirty calibration values:
Mouser only seems to stock B57164K0103K052 which is listed as having the 2904 characteristics (from EPCOS/TDK datasheet above), and the datasheet only states 2904 for the 10k type.
The Steinhart-Hart-coefficients can be fitted after some OCR gore as follows:
Final set of parameters Asymptotic Standard Error ======================= ========================== a0 = 0.00130396 +/- 2.557e-006 (0.1961%) a1 = 0.000214209 +/- 4.56e-007 (0.2129%) a3 = 9.80175e-008 +/- 1.801e-009 (1.837%) correlation matrix of the fit parameters: a0 a1 a3 a0 1.000 a1 -0.991 1.000 a3 0.935 -0.968 1.000
note that the S-H equation needs absolute resistance in Ohm.
There was also an error in prior graph formulas... but now the temperature calculation looks much better:
I could in principle take one of the NTCs to work and properly characterize it over its temperature range against a known PT100 element but for the sake of brevity I'm inclined to trust the datasheet values to within 2 Kelvin.
Sensors deployed in industrial applications tend to work quite reliably, until they don't. Typical failure modes include
Transferring these expectations to the reservoir scale scenario, a few points seem seem rather likely right out the gate:
Assuming proper handling and controlled conditions, temperature and deformation effects can be investigated... and that's what we're going to do now.
One of the modified scales is set up on the windowsill and loaded with 5kg to investigate loss of calibration after a few days of static loading with the maximum permissible weight.
Another scale with both the internal electronics and a HX711 board connected is powered with 5V into the HX711 (SCK needs to be pulled to GND to enable AVDD). This device has four cable pairs connected to the sense and excitation pins.
All are connected to a multichannel digital multimeter:
A rear panel PCB has screw terminals to hook up wires and an NTC sensor. In a later measurement, an additional short circuit on channel 6 was added to investigate instrument drift error during the measurement sequence.
a python script initializes and periodically reads values from individually configured input channels. Git repository:
A first run is conducted through the night to determine offsets and intial settling under full load. The measurement consists of three parts to measure initial offset without any applied voltage, no-load offset of the load cell and fullscale output with a 5kg weight placed on the scale. note the strain gauge output is in millivolt while the excitation voltage is displayed in Volt.
In this graph the instrument error of 74 µV has already been compensated for to better represent the strain gauge output. Y axes ranges are chosen arbitrarily to highlight relative changes over the measurement period after power-up.
The measurement was halted to add a 10k NTC senor and test changes to the code, then restarted. Restart might cause the multimeter to calibrate zero, although it is later found that the offset remained at around 74 µV.
Note the restarted strain gauge sense voltage appears to be slightly higher than in the initial run.
There is hardly a change between the 2nd and 3rd run:
The last plot shows both sense voltage and temperature over time, illustrating the 25..30 µV jump upon restart.
To better...Read more »
With the Silvercrest SKWD-A1 inspected and found to be nicely hackable it is reasonable to get enough scales to make it through the first iterations without yet again having to gamble and possibly ending up with a less elegant solution.
Futhermore it's hard to beat the 17 mm of this low profile scale. Buying online also made it possible to select a slightly less obtrusive pattern and colour scheme.
It is worth noting that while designs may vary over time the internal construction should be kept more or less consistent once settled upon. It also seems doubtful that there is a lot more room left for further simplification and price reduction so hopefully it'll just stay as is in the next 1-3 years.
In the previous post it has been found that HX711 enters power down when CLK is high for longer than 60 µs and a high to low transition occuring after power down will trigger a reset.
When used behind an I2C multiplexer, DOUT connected to a third data line and SCK connected to SCL, HX711 will see SCK high for a long time before selection (I2C pull-up), followed by bitbanged SCL waveforms which will be composed of the following sequences:
[ side note: Completion of the first sampling + conversion is indicated by DOUT high-to-low transition. The datasheet only states, "When output data is not ready for retrieval, digital output pin DOUT is high. Serial clock
input PD_SCK should be low. When DOUT goes
to low, it indicates data is ready for retrieval." which leads to conclude that this also applies to the first conversion after reset. ]
The protocol co-existence described above is enabled by routing DOUT via a third line so it does not interfere with SDA. If connected to SDA, DOUT could create start conditions and lead to invalid I2C command interpretation and lockup.
If only I2C lines are available, one could generate clock pulses to trigger the DOUT high "no new data" state to follow up with I2C multiplexer de-selection but this would also demand converting DOUT to open drain with a diode or MOSFET.
Connecting it to a MOSFET and effectively inverting the output level will have further implications: as long as DOUT is high, SDA will be pulled low so the I2C bus will be in lockup during conversion and possibly also during HX711 power down (not specified in the datasheet).
Next a bit of hardware will be needed to demonstrate the functionality. Ideally the I2C peripheral could be temporarily deactivated and the pins reconfigured for GPIO. Alternatively SCL could be bridged with another GPIO configured as open drain or push-pull if it is guaranteed that I2C will not be driven in the meantime.