Reading Ampy meters via the inductive serial port

Robert, Thank you so much for your explanation and help !
I didn’t see this message until now (not sure why I didn’t get the alert) and have spent the past 2 days learning about how all of this works. The principle of operation you have explained really well to me, so thank you for taking the time to do that. It is now much clearer what should be happening.

Sorry the image is so badly drawn, attached is one done with Fritzing (awesome programme!)
I’ve got the coil & cap calculated and oscillating nicely at 26Khz (1000uh & 5nf).
With experimentation and some calculations (which may well be wrong), I’ve went for 0.1uf for caps C3 (electrolytic) & C4 (detector) - do you think they are valid ? C4 in particular - the frequency is 26Khz carrier and I 2400 baud (say 3Khz for margin of error). If not, I’ll go for your recommendations !

Thanks again for responding, this little project has really stuck in my claw and I’m determined to get it working… if nothing else it may help others and save me a trip to read the meter !

Alan

Now we know the baud rate - you did mean 2400? - C4 is far too big. 4.7 nF is enough. (According to my LTSpice simulation, anyway.)

This is with a 0.3 V amplitude signal from the pick-up coil (simulated with a signal generator and modulated by a switch).

It shouldn’t be oscillating, it should be resonant, if that’s the frequency that the meter sends out. If it’s oscillating on its own, you won’t be able to detect the signals from the meter.
If it is oscillating on its own, you might need a large electrolytic in parallel with C5 - 22 μF, or a damping resistor in parallel with the coil.

BTW, it’s normal, when drawing a circuit diagram of this sort of thing, for the signal to go left to right.

Again, thanks for this, I’m learning a lot.

Yes, sorry I meant resonating, not oscillating.

Yes, 2400 baud, according to the manual.
Can you share the equation on calculating c4 ?

I tried quite a few, and used 1/(2pi * RC) as the formula for the RC values, solving for C using a cut off frequency (fo) as 6634. The cut off frequency was chosen with information gleaned here
I calculated fo using the formula :
fc = carrier freq
fd= data freq
fo=√ (fc * fd)
fo = √ (26000 * 3000)
fo = 279

Then solving for C4 , I arrive at 38nF (not sure how I got 0.1uf last time, it was 3am I guess !)

Now, finally my new signal generator arrived today, (was using an arduino to drive 26khz!) so I can experiment and see what it does.

One final question, the signal is DC biased over 2v or so, how exactly does D1 rectify in this case , as the signal will always be higher than the turn on voltage (even the negative of the ac waveform does not go below 0.7v)

Thanks again for helping a newbie with this stuff !

Alan

As I said, the time constant must be long in relation to the carrier frequency, but short in relation to the bit length of the modulating signal. I’m fairly sure an amateur radio textbook will tell you, but if you want to know how I did it, I guessed a number based on the bit length and checked it in LTSpice.

This is what 38 nF looks like:
image
That’s not giving a very clean pulse train.

It’s just pumping the voltage up a bit, enough for the comparator op.amp to switch. It’s not very sensitive, it needs about 0.2 V amplitude (0.14 V rms) to work.

Happy to report it’s all working on my bench.
The £43 I spent on the sig generator was well worth it. It allows me to create an ASK (digital AM) signal using an external input to modulate. Using an arduino, I wrote a small program to write at 2400 baud to the serial port. Using this as input to sig gen and putting the output of the sig gen into a small wire wrapped around the coil and onto a small load resistor, after some fiddling it all works beautifully !
I sure learnt a lot following the signal through the circuit.

I did find an error in the circuit, in the original circuit as I uploaded, the output was inverted. Swopping pin 2&3 (2nd stage opamp) corrected that.

Again, thanks for all your help, I could not have got this done without your explanation and helping my calculations which were, ahem, dodgy to say the least.

Correct circuit attached (and next time I will draw from left to right :slight_smile:

I’ll post when I get this off the breadboard and stuck onto the meter to see if it all really does work

Alan

1 Like

Maybe not an error, you could have changed that in the software that decodes the message, quite simply by calling a high voltage input a logic ‘low’, and vice versa.
Or maybe, the software already does that (I haven’t looked), in which case you can either swap the op.amp back to as it was, or “unswap” it in the software.

Very true - I haven’t looked at the software yet

So the software uses Software Serial and doesn’t invert any bits. That said, maybe the meter output is inverted itself. I’m going to recheck the PCB layout and see.

I just tried the circuit on the side of the meter, but alas no output was seen by the arduino (inverted or otherwise).
Next step is to take a scope down to the meter (which is outside and it’s raining hard !) and see what I can see. really curious if any signal is being picked up at all…

More to come.

My first guess will be you need to adjust the tuning capacitor across the coil. The second is, if the coil Q is too high, it will still be ringing (and the detector detecting) during the signal breaks. The cure for that will be a damping resistor in parallel with the coil - start high ( a few kΩ) and reduce until you get a clean digital output.
@Bill.Thomson is the expert in this area.

I hope after all this that you do have a meter that does radiate a signal.

So on the ‘does the meter have the inductive output’ - that crossed my mind.
According to the manual for this model, it seems to do so, it does not appear to be optional.
Manual

On the bench, with a 26Khz modulated signal, the pulses are clean, and the HF noise isn’t there. There doesn’t appear to be ringing or anything else abnormal with what I see on the scope.

To test on the bench, a 5V square wave modulated signal loaded into a 360K resistor and 3 wraps around the coil was able to be detected and processed perfectly.

I wonder is the signal from the meter not strong enough, or … well who knows. Hopefully the 'scope will tell me tomorrow what (if anything) is going on.

Looks like I need more help.

Taken the circuit & scope to the meter, and verified that the meter is giving out data at 26Khz on the scope.
The coil picks this up and I’m able to see a very jaggy 26khz sine wave on pin 6 of the opamp.
This is measured at approx 20mv pk-pk.

Knowing this, back on my bench I created an inducted 26Khz signal that generates the approx the same pk to pk voltage at pin 6.
The output then of pin 7 is approx 200mv pk - pk ( looks close to the 6x gain as the signal I could generate varied between 20 & 40mv) with a DC bias of 1.6v

The DC bias output on the other side of the detector diode sits at 1.1V when no input present and 1.3v when there is. The AC portion on the same point (somewhat of a sawtooth) has pk-pk of 200mv

Pin 2 with signal is 1.6v (dc only), pin 3 with signal is 1.3V DC bias with a sawtooth 200mv AC wave.
The output at pin 1 is a steady 600mv DC with or without signal applied - no real AC portion (as expected). Just a flat DC line on the scope.

Therefore, I conclude that the coil is not able to pickup enough signal, or the circuit is not quite right for this application (more gain needed) ?

Any help appreciated… Trying to figure out how to get the traces out of the scope for upload here.

Alan

The feedback resistor, R4, I interpreted as 15K from the pic in the original threadAmpy_reader .
It’s quite hard from the pic to ascertain if it supposed to 15K or 1.5K (is the band orange or red ?)
If is 1.5, then the gain is 10X more … I wonder is that the issue ?

pic attached with the R4 circled.

In fact doubting values of R2,R5 and R4. It’s really hard to tell if the multiplier band is red or orange.
And it makes a huge difference …
Hoping this is the last hurdle !

I can’t read the pin numbers on your diagram, but pin 6 is an inverting input of the op.amp, and I wouldn’t expect to see any signal there until the output clips, because it should be held to the same voltage as the non-inverting input by feedback action (and that’s a constant d.c. with no signal on it).

Looking at the open-loop gain curve for the LM358, you should be able to get a gain of around 18 × at 26 kHz, so I doubt that R4 is actually 1k5.

The other question - is your coil & capacitor actually tuned to 26 kHz, or do you need to adjust the value of C2?

I think a (another?) problem is d.c. offsets. Ideally, the output of that amplifier op.amp. should sit at a few tenths of a volt above the bias voltage on the non-inverting input, so that the detector diode is just not turned on. Then, in the presence of a signal, the non-inverting input of the comparator op.amp will rise above the inverting input and switch the output to a logic high.

So if you biassed the comparator non-inverting input to 1.2 V, you’d detect the signal.

Looking at all this, can you check the circuit diagram against the pcb again?

The coil is pretty well tuned, as I’ve varied the frequency inducted across it, and it is the amplitude pk-pk output is highest near 26Khz (it’s actually best at 25.5K, but beggars can’t be choosers)

I’ve re-cheked against the PCB, and the only difference is where I swopped pins 2&3 so as to not get an inverted output.

I’m at the bench now with it, so with a fresh pair of eyes going to look and get some more measurements to see what is going on. At the moment, with the 20mv induced signal, the open gain opamp is not switching.

I can’t do much thinking today - I’ve got a bad head cold. I’ll look again in a day or two.

This is the best I can do today. Biasing the comparator to 1.15 V makes it work with just below 200 mV pp out of the amplifier.

I needed to increase my C2, making the ‘on’ state longer.

For a man with a cold, you sure can come up with the answers.
I wasted 6 hrs today trying to debug this, only to find a short on the board which (between pin 1/2) and that drove me crazy. I thought I had changed something and badly broken it.

I follow your thinking and circuit to lower the bias of the comparator. I created a voltage divider and biased it at 1.1v and the circuit is a lot more sensitive. On the bench an inducted current of 40mv pk-pk operates the circuit, whereas before it took well over 140mv…

Now, when I was playing in the rain and dark 2 nights ago outside at the meter, I’m sure I metered the inducted current at 20mV.

But with the changes I may get lucky and hope the circuit is now sensitive enough to pick up the meter.

I will see tomorrow. It’s been a long long day at this…

I simply could not have done this without your help, effort and pointers. The explanation and LTspice analysis really really helps. And it matches closely with what I see on the bench !

Update tomorrow !

Hmm…
That looks like data to me. Now to decode it. :grin:

I do have some reservations about how reliable the potentiometer approach will be, as it could depend, to at least some extent, on amplifier drift.

A better way would be to generate the bias from a low pass filtered version of the pulse stream. The bias would then sit at the average value of the pulses, and so would more or less ensure that the comparator worked whatever the absolute voltage turned out to be.

However, if the data is absent for a long period, it could easily generate rubbish data from noise.

Yes, indeed it was, and scope decoded it nicely.
It was simply me injecting 1234566890 into the AM stream from a serial port.
So the circuit works on the bench at a low level of input…

Got it.

If this works (which I’ll know shortly), I’ll copy the LPF that is in the original circuit and adjust it for this bias.
I’ve also found that moving the circuit from breadboard to veroboard detuned it slightly (by 2Khz) so small capacitor addition brought it back to 26Khz. I’m hopeful these small kick up the bottoms will allow me to decode now.

Fingers crossed