Readout of domestic water meter using a coil and reading the LC loop in the meter

michael8

Joined Jan 11, 2015
410
Will the CD4066 be in the high current path? My CD4066 datasheet says something like 500 to 1K ohms and that's at 5V, at 3V it may not be even that good.
 

Thread Starter

mar10

Joined Mar 23, 2019
69
The 4066 is intended to go between three sets of diagram v6 and the comparator circuit that will then not have to be build three times. The load of the comparator is compatible with this path resistance, especially because it is always the same for a given coil circuit and we just want to make neat pulses to count. I wonder if we can also use the JFET amplifier in a shared fashion from node N007 and I guess that is doable and there path resistance is even less of an issue.
 

Thread Starter

mar10

Joined Mar 23, 2019
69
Moving on and realising that I can skip the 4066 altogether if I use an LM339 (on the shelf ;-) straight away which has 4 parallel comparators with open collector so they just bind together on a 1k pullup R.

The following shows the entire circuit to be connected to the ESP8266 for 2 coils. Adding a third coil is optional and is straight forward. The LSK170A is a fancy version of the 2SK170 which is readily available. I will buy 20 and pick the favourable units which the LSK factory probably did to classify the A, B, C and D versions. [that is an assumption!]
The FDS4435 can be replaced by a AO3423 for less overkill design...

Key purpose of this post is to see how it all fits together
V2 and V4 is the same I2S pin, but like this it is easier to show the two phases for coil 1 and coil 2 separate.
V3 and V5 are the way for the ESP8266 to select which coil gets activated, one each 100µs (or slower is also OK)
Vout is presented to the interrupt input or to a counter input (TBD)
L3 and L1 are the rotating resonator part.
Screenshot 2021-08-23 at 22.28.53.png
 

Attachments

Last edited:

Thread Starter

mar10

Joined Mar 23, 2019
69
@michael8 I just re-read your post and realised that you had an advice to be tried.
And indeed, the LC ratio using C2=1µF is a much better voltage.
Even so much that I tried to feed it straight into the LM339.
And how well it works! With much less components ;-)
Coming weekend I will build this and see, if I can wait that long ;-)
Screenshot 2021-08-23 at 23.53.42.png
 

Attachments

michael8

Joined Jan 11, 2015
410
Great. I redid my driver, simpler. Just an NPN and about a 1uH coil (cheat wth small core). WIthout the core the frequency is about 500 KHz so about 410 nH (still rings).

npndrvr1-sim.pngnpndrvr1-cir.jpgnpndrvr-ring1.jpg
 

Attachments

Thread Starter

mar10

Joined Mar 23, 2019
69
Wow, that looks great. Nice Scope!
One consideration though is that (I think) we agreed that using a coil without core would be better, since it would be more accessible to the general public.
I am currently looking into a combination of a 1µF X7R cap and a 247nH coil.
For this I contemplate a coil made with a 0.5mm wire with an inner diameter of 3mm and two layers for a total of 9.5 turns. Like this it would be about 2.5 mm long and the depth is 1 mm and the average diameter 4mm
Using this site it should be 257nH. Real life dictates that the coil is a bit sloppy and better use 10 turns at length 3mm.

The concern is that anything too big will not match the rotating dial anymore so this seems like a reasonable balance.

What do you say?
Screenshot 2021-08-24 at 22.58.33.png
 
Last edited:

michael8

Joined Jan 11, 2015
410
I agree a smaller diameter coil is better. I like higher inductance as the higher inductor impedance will lead to higher Q and
I think that the effect when coupled will be more obvious. Also I'm hard pressed for 1uF capacitors (only have some smd ones).

I made a coil with wire 0.4 mm dia on a plastic (coffee stir?) 2.4mm dia. The coil has 10 turns in two layers length is about 4.3mm . The top layer is a bit scrambled. With a 100nF capacitor it rings about 1.1 MHz so about 205nH.

a coil without core would be better, since it would be more accessible to the general public.

Possibly. I tried adding a core -- 3 2cm long pieces of a paper clip each 1mm dia and the frequency came down to about 770 KHz. So thats about 428nH. Would still need > 500nF of cap. I think the core added some losses. It might concentrate the field at the tip though. Needs more thought/testing. Anyway it's an idea.
 
Last edited:

Thread Starter

mar10

Joined Mar 23, 2019
69
Regarding the SMD caps, I am aiming for the dark grey ones (X7R?) and they have a reasonable ESR I think.
I have loads of old equipment so finding the right stuff is a matter of looking, but else a bag of those caps at Ali is no big deal either.
Regarding your coil, how can 10 turns in two layers which equal 5 turns per layer result in length=4.3mm if 5x0.4=2mm??
Or do you mean each layer has 10 turns so 20 total? But that has a higher inductance. Maybe thick isolation on the wire...
 

michael8

Joined Jan 11, 2015
410
It's a total of 10 turns, 5 per layer. The wire tends to spread out a bit, so while the wire is 0.4mm thick, it doesn't take much
to make it longer. The top layer tries to push apart the bottom layer turns. In some places it's intruded all the way, in
others, perhaps (hard to see), it's just opened the spacing a bit. There's nothing holding the wire in position/shape other than
the "coil form" and the leads soldered to the cap.

Reality is harder than a simulation...
 

Thread Starter

mar10

Joined Mar 23, 2019
69
Indeed reality is harder than simulation. With the coil from post #46 I created a similar circuit as yours with C=1µF.
It seems to ring at 300kHz and then I held it close to the watermeter pointer. There was NO discernible difference!
Now wondering what is the catch... Should the frequency be better matched? Is a coil needed to couple better, etc...

Screenshot 2021-08-25 at 18.42.39.png
I excite the circuit with 3 pulses of 1.56µs and we can see the amplitude rise accordingly.
 
Last edited:

Thread Starter

mar10

Joined Mar 23, 2019
69
Small weekend update: Success!
I constructed a coil with 0.25mm wire, 32turns on a 3mm core two layers 4.5mm long with ferrite core.
Supposedly around 9-10µH.
With a 24.5nF (2x12) capacitor, and the possibility to tune the circuit with the core I am able to tune it to 320kHz 'exact'.
The peak amplitude is about 1V.
Then I used the coil/cap from the previous experiment and hold it close. And behold, the amplitude drops!
So, the concept is verifiable and we need to make it work with the water meter which is the real thing.
Question is how critical the tuning is. We'll find out.
Screenshot 2021-08-28 at 13.49.22.png
 
Last edited:

Thread Starter

mar10

Joined Mar 23, 2019
69
Better news yet, the actual water meter is also reacting as predicted.
Next move is integrating the comparator and detect the pulse in the ESP8266.

Longer run, I would consider that the first 30 seconds after booting, there is a routine in the ESP8266 that would help in tuning the coil/cap so that a person that starts using this can be up and running without the need of a scope etc.
This would still depend on the comparator pulses but then capturing the time needed for a few dozen spikes.
 

Thread Starter

mar10

Joined Mar 23, 2019
69
First, I used the same circuit but without coil and tuned to 320kHz again.
While my test-LC was able to show a difference in the ringing, the water meter was not.
For now I consider the coil a necessity and when we have a working device, we could find out how to make it work without coil.
Screenshot 2021-08-29 at 12.21.27.png
picture made from circuit in message #51 which is using a BSS138 from V+ and C2=24.5nF

Some considerations for the LM339
The idea is to use a common mode input of 0V (message #44: watermeter-v8) which is allowed...
However, I am reading these two quotes in the spec-sheet:
  1. The voltage at either input or common-mode must not be allowed to go negative by more than 0.3 V. The upper end of the common-mode voltage range is VCC+ – 1.5 V; however, one input can exceed VCC, and the comparator will provide a proper output state as long as the other input remains in the common-mode range. Either or both inputs can go to 30 V without damage.
  2. MAX Input current is -25mA: Input current flows through parasitic diode to ground and will turn on parasitic transistors that will increase ICC and may cause output to be incorrect. Normal operation resumes when input is removed.

Screenshot 2021-08-29 at 13.00.50.pngI have created circuit watermeter-v9 and simulation shows very high voltages.
So, our L/C is ringing between -8V and +5V if the common mode voltage is 0V. I wonder if this will damage the LM339 since at the peak moments, the L is running currents like 400mA and that current is going to use the input line.
Note that the LTspice simulation for Vout shows weird output until 110µs which might be just this effect
Screenshot 2021-08-29 at 13.15.44.pngSo in watermeter-v10 I added R6/R7 to limit the voltage to the (+)input and considering that if I am doing that, I can reduce the R4 value and the currents and voltages in the system anyhow making R7 obsolete (and R6 stays, just in case)

So I tried if I can then use a 2N3906 instead of the MOSFET leading to watermeter-v11
This has a much nicer BillOfMaterial and if this really will work, it looks very good!
Screenshot 2021-08-29 at 14.58.23.png
BTW, The coupling K1 is now 0 0.1 and 0.3 whereas in previous simulations I used 0 0.3 and 0.7
 

Attachments

Thread Starter

mar10

Joined Mar 23, 2019
69
One stage ready for testing... let's hope all resistors have the right value ;-)
And yes, that LM339 is from the 80s and they still made (silicon) chips in england back then...
Screenshot 2021-08-29 at 23.02.11.png
 

Thread Starter

mar10

Joined Mar 23, 2019
69
just a message in a bottle ;-)
This project is not dead.
I simply did not have time to make progress.
But those times will return.
2Bcontinued
 

Thread Starter

mar10

Joined Mar 23, 2019
69
Yeah, I'm back, and test results are good!
First, to keep the reponse of the transistor snappy, I have verified in a static voltage setting that the current in R4 is just not saturated, since lowering R5 a bit adds almost nothing to I(R4) but still a bit.
Because my scope is very limited at these frequencies around 300kHz, the output of the comparator which is supposed to be square, is displayed as a sawtooth, but hopefully the interrupt input of the ESP8266 will be able to handle it as a square.
The input to R5 is the three spikes at 320kHz, like in watermeter-v11 above, generated with the ESP8266.
The two pictures merged together show that the amount of pulses can be influenced by a factor of two or more like this. And that there are plenty of pulses to make some granularity in the counting.
Screenshot 2021-10-24 at 11.32.19.png
A warning though. When I changed the layout of the wires, the result was only 3 teeth on the sawtooth, or a permanent high, and very unstable altogether. Some more discipline in the final setup seems to be critical. e.g. I did not yet put the remaining inputs of the LM339 to GND and V+ to prevent interference pickup...

2Bcontinued, to pick up the output in the ESP8266 in a reliable way...
No commitment on the next time slot I will have time though...
 

Thread Starter

mar10

Joined Mar 23, 2019
69
A bit of bad news: I realised that I forgot to swap the + and - for the comparator when swapping the polarity from watermeter-v7x2 to watermeter-v8. This means that the circuit will only work for 1 channel, but will always be zeroed for more channels.
A quick and dirty swap of the + and - did not result in a working mirrored circuit. Maybe too hasty, so, to be investigated.
Maybe someone could explain if the circuit is now inherently broken? And how to fix it if so...
 

Thread Starter

mar10

Joined Mar 23, 2019
69
No idea what is wrong, but the output (with external trigger else there is no way to see this !) keeps flipping around and the 'DC' level keeps shifting... There must be something with the LM339. I have put the R9/R10 divider output to the + of input 1 and 2
the - of input 1 and 2 is by virtue of the coil connected to ground. Input 3 and 4 are + to V+ and - to GND.
I have no way to explain the LONG square, at the moment of sending the pulses (the left edge is equal to the ext-trigger). Why does it not stay on V+ during the 'tail' which is the left side of the screen???? see simulation of v8 circuit.
The mid screen shows output flatlined at V+/2. What makes that possible?
I prefer my circuits to be better behaved ;-)
Other than that, the sawtooth is there and it can be influenced with the external coil, so the base is still there...
Screenshot 2021-10-26 at 18.48.01.pngScreenshot 2021-10-26 at 18.47.38.pngScreenshot 2021-10-26 at 18.47.07.png
 

Thread Starter

mar10

Joined Mar 23, 2019
69
Mystery solved.
Somehow I connected the ground wire between the ESP board and the scope board to the wrong hole, so they had no common ground!
It all looks good now, with inverted logic, so we can make independent measurements for up to four coils... :)
Up to the ESP interrupts, maybe on Sunday.
 
Top