DC Volt Meter using ADS1115 - Impedance, AC signal filter and over voltage protection questions

Status
Not open for further replies.

Thread Starter

stephanjohnson

Joined Apr 17, 2012
6
Hello,

Background
I have a project that I have been working on for a few years off and on. It is basically a wireless DC volt meter that uses a GPS to obtain measurements at a very specific interval and record the data with a timestamp, location, etc. I have been successful with making the GPS work and obtaining somewhat accurate voltage measurements simply using an Arduino mega's ADC. My next step is to switch over to the ADS1115 in hopes to increase my precision as the 8bit ADC in the mega isn't quite enough.


My specific questions today have to do with designing the DC volt meter circuitry. I need to know what impact the presence of an AC signal has on the measurement of the DC signal.

The signal I am measuring is actually a corrosion potential (Cathodic Protection related) between a buried pipeline and the ground (electrolyte). Occasionally, AC interference occurs when a power corridor parallels the pipeline and the pipeline also ends up with a certain amount of AC on it as well.

Typical parameters of what the signal I'm trying to measure are:
+4.0 to -4.0 DCV (it is possible the signal may exceed these and would need to protect the inputs)
0 to 5 VAC@60Hz (it is possible the signal may exceed these and would need to protect the inputs)
The VDC signal will be shifting every few seconds, and the VAC signal will remain constant. I only need to obtain a VDC measurement within 200-500mS after the shift. A very typical reading would be signal "ON" @ 0mS. Wait 200mS and then obtain a measurement (usually -1200mVDC and then wait. Signal shifts to "OFF" @3000mS, wait 200mS and then obtain a measurement (usually -900mVDC). The cycle repeats.


List of Questions I would like answers to:

AC Filter Required?
Does the presence of an AC signal cause a measurement error when measuring the VDC with the ADS1115? If so, can I simply put a passive low pass filter in front of the ADC input to block anything beyond 25Hz? I understand the signal would attenuate slightly if I did this, but could it be managed by compensating in the software or perhaps keeping the required resistor so low that it doesn't much matter?

Over-voltage Protection Circuit
The signal I am measuring is usually low voltage, however it is entirely possible that the VDC or VAC may exceed the maximum 6.144 scale and I need to have the inputs protected against this particular danger. My first thought is to use the 6.144V scale and a 5V Zener diode to clamp the voltage to a maximum of 5V. However, I don't fully understand if this is sufficient protection (does that work with AC?) and does it impact my measurement accuracy? I had the thought that I could simply use one of the Mega's ADC channels and a voltage divider to "check" the approximate voltage before measuring with the ADS1115 on the lower scale, but I'd like to make this project as rugged as possible. Relying on the user not attempting to measure voltages outside the range seems like a bad design.

Voltmeter Input Impedance
The impedance of the meter is important to the particular measurements I am attempting to take. The reason being that the half-cell contact (the connection to ground) is occasionally very high resistance and anything below 10Mohm will cause errors in measurement more frequently. I see that the ADS1115 has different input impedance for the various scales. For example, in differential mode the 6.144 scale is 22Mohm and 4.096 is 15Mohm. There is actually a formula that would be useful to use that requires the same measurement to be taken with two different impedance values and the calculated result would tell me if the measurement is error free. I am therefore considering switching between the scales on the ADS1115 to take advantage of this feature. However, is there a way to externally increase the impedance of an ADC (for example the ADC of the mega itself) just by adding external resistors and does this impact my accuracy?

Measuring low voltage AC
Is it possible to measure 0-5VAC with the ADS1115 or is there a better unit/module/circuit that would be better? It seems like I'd have to rectify the AC to DC to measure it, but would likely have to amplify it if it's under a few volts. I'm inclined to avoid the whole mess altogether but thought it worth asking. My only other thought was that since the ADS1115 can measure both positive and negative voltages, would it be possible to sample fast enough to capture a 60Hz waveform? I understand the ADS1115 is rather slow so again, I'm inclined to leave it alone but would be a nice feature if it would work.



Thank you for anyone that reads this and is willing to shine a light on it. I hope that I have been specific enough, although I'm sure I've somehow left out important information. I will update the post once I am able to take pictures of the circuits.
 

danadak

Joined Mar 10, 2018
4,057
AC Filter Required?
You could do it using filter, or using code, or circuit to get rid of AC CM.

Over-voltage Protection Circuit
I would be more inclined to use schottkys tied to rails and an input
R to limit current. So input is clamped to Vcc + Vf > Vin > Vss - Vf

If you buffer the input then the buffer small Ibias would
result in very low Voffset.


Voltmeter Input Impedance
You could buffer with unity G OpAmps, eg. followers, and achive very high Z.
You would have to do an error budget to see if signal path end to end meets your
requirements. Also a good RRIO, low drift, low Ibias makes sense for this.

Measuring low voltage AC
Sure, using A/D, sampling and some code you could measure its freq, Vrms, Vpeak,
Vavg. Its really a sample set coding problem, quite straightforward. Find Vmin, Vmax,
in the sample set, the rest falls into place.

Just an FYI, A PSOC with onboard 20 bit Delsig, gives you an ARM core and
OpAmps and Vref and a whole lot more. A natural for this kind of design. In fact
there is even DSP filter onboard, analog muxes, DAC, COM, LCD......

And you can do this differential to get rid of CM problems. Note DelSig common modes
to 100 mV outside its rails, and measures accurately in that region of input. And it has
an input buffer if you choose to enable it. Note design below is configed single ended,
ignore that. And if you needed more channels drag and drop a diff mux (also internal)
onto schematic and wire that up with tool.



Compiler and tool free, starter board $ 10.

Regards, Dana.
 
Last edited:

ebp

Joined Feb 8, 2018
2,332
As soon as I saw GPS and voltage measurement I thought "CP?"

I have many answers but I have to think carefully about what I can say. I did a lot of design for CP in my days as an insultant, including dealing with everything you mentioned, but since I was paid for my work I own my client confidentiality. One of the bits I did was specifically to reject AC for a pipeline running for a long distance under a power line (it was actually one of the most satisfying projects I ever did - it was small, not terribly technically complicated and solved a problem others had been struggling with for a long time - and I like the company I was doing it for).

Without saying why, I think the ADC you are considering is much too slow. This is a problem with most delta sigma converter and those with higher resolution are generally much worse. Other converter types will typically come with other issues such as power consumption, but speed can be much higher. My feeling is that 13 or 14 "real" bits is sufficient for what you want to do and higher actual resolution can't be justified due to limitations elsewhere in the system.

With suitable op amps you can easily achieve input impedance in the gigohm range, but it complicates matters when you have bipolar signals since you will require bipolar power supplies (perhaps not strictly necessary, depending on the entire system and what is relative to what; certainly the voltage between the pipe and ref cell will be truly AC; with very few exceptions, no IC is going to cope with signals much beyond its supply rails). With very high input impedance, relatively simple techniques can be used to protect against over-voltage, but great care is required to avoid introducing errors due to things like leakage currents in diodes (Schottkys are generally terrible and even common PN junction diodes like the 1N4148 are marginal). You won't just have "miscellaneous" over-voltages to deal with, you'll also have lightning strikes (direct strikes will likely blow you stuff to kingdom come regardless of what you do, but nearby strikes should be survivable).
 

danadak

Joined Mar 10, 2018
4,057
You can get small signal schottkys in 100 nA range for leakage, should be adequate for your design.

If you do 16 bits the PSOC DelSig is limited to 48,000 SPS, 14 bits 134,000 SPS. Is that sufficient ?


Regards, Dana.
 

ebp

Joined Feb 8, 2018
2,332
100 nA is dismal and completely unsuitable for high impedance work. That is a millivolt of error at 10k and a full volt at 10M.

The PSoC converter appears to be fast enough but as I said, delta sigma converters have some issues and without spending a lot of time finding out about the details of that in question it is hard to say for sure if it is suitable. The expected input has a relatively fast and large DC step, possibly on the order of several volts. The data from the ADC needs to be valid within a fairly short period of time. The settling time will depend on the nature of the digital filter for the ADC and may be a limiting factor.


===
I think I'm going to bow out of the discussions at this point, lest I say things I shouldn't. Normally I take the view that I'll share anything I know, but as I mentioned before, in this case some of the things I know, even if they were my ideas in the first place, don't ethically belong to me.

A little more background on cathodic protection for others who might want to jump in.

The fundamental idea behind CP is very simple. Oxidation (rusting, for ferrous metals) is loss of electrons. If you make up for the lost electrons with an impressed electrical current you prevent the rusting. The amount of current required depends on lots of factors such as the electrolyte (soil composition, moisture content, etc. for buried structures) and how much metal is exposed to the electrolyte. New pipelines are coated so little metal is exposed. As the pipelines age and coatings break down, more metal is exposed and the current required is higher. The objective is to supply sufficient current to maintain a protective potential (voltage), usually measured between the structure (pipe) and an electrochemical reference "half cell", often copper-copper sulfate. If the potential is too small, corrosion can occur. If it is too high you can get electrolysis of water and hydrogen embrittlement of the steel. Protection currents can range from milliamps to tens to hundreds of amperes. A bare steel structure in the ocean needs a huge amount of current. Coated pipeline in the desert needs little (but a lot of voltage, sometimes).

The protection current flows between the structure and anode beds located at some distance from the structure. The ref cell is usually somewhere between, at least electrically, so the voltage difference between the ref and the structure is partly protection potential and partly IR drop in the resistance of the electrolyte (soil). To get the most accurate readings of protection potential, the protection current is briefly interrupted and the potential read. This results in a step in DC voltage that may be much higher than the measured potential once it has settled.

In some systems, data acquired from potential readings is used to manually adjust the tap(s) used on a transformer to alter the rectified DC output voltage ("tap set rectifier"). In some systems, a manual adjustment to regulated current might be made. In the most sophisticated systems in general use, the reading of the protection potential is used in in a feedback loop that automatically regulates that potential. Some systems use ON potential (current is not interrupted) rather than OFF potential. (My '"thing" in CP was design of switch mode power supplies and phase angle controllers for single and 3-phase "rectifiers" to provide constant voltage, constant current or constant potential control. My first kick at the problem was a 500 W switcher that would accurately control microwatts - made for some interesting challenges, especially since it was also my very first switch mode power supply design.)
 

danadak

Joined Mar 10, 2018
4,057
Boy I did miss TS comment about 10M desired. So totally agree small signal
diodes would have to be used, not schottkys, for protection circuits. I stand
corrected.

Regards, Dana.
 

Thread Starter

stephanjohnson

Joined Apr 17, 2012
6
Thank you for the responses Dana... EBP did a much better job of articulating what specific challenges I'm up against! I have so many questions for him... it's very hard to find anyone that's even heard of cathodic protection, never mind someone that has actual first hand functional knowledge of it. I'm not going to lie, the conservative ethical position made my heart fall into my stomach. It's like finally meeting Yoda and he refuses to train you...

Project Update
I have integrated the ADS1115 into my project and have it collecting very accurate VDC measurements in synch with GPS time. I have tested it's accuracy against my scope and am quite happy with the results; it's easily accurate to under 1mV and that's enough for me. I'm sure I can increase that if I write proper code to take more than the single shot reading and average out the result.

Input Protection
Damn! I knew I had to be careful with what I put in front of the ADC as I don't want to lose my accuracy. I had finally wrapped my head around the schottky diode configuration and was wondering what it would do to the circuit. If I am following along correctly, it shouldn't change the configuration but simply use small signal diodes? Could you recommend a specific small signal diode? I am assuming the configuration below is (mostly) correct. I am also wondering if the resistors are necessary as my understanding is they simply limit the current through the diodes and to the ADC, however as the circuit I am measuring is already very high resistance due to the (half-cell contacting the ground) I don't believe any significant amount of current can flow. I also won't worry about lightning or other issues like that.


AC Measurement
It sounds like I need to use some different hardware. I'll keep my ADS1115 for measuring the VDC (I already have them and they seem to work nicely) and add on a separate circuit to handle any AC measurements. I looked into the PSOC DelSig Dana suggested and can't say that I know enough to make any sort of judgement. The 134K SPS on 14bit seems like a lot... but I'm curious to know what EBP was alluding to. Ultimately, I think my design parameters are likely a little more relaxed than whatever EBP was involved in designing, so I'm thinking that speed is probably more the issue than bits. I don't need super high resolution on the VAC measurements... it's more like a sweep to see if any AC is present on the line and roughly how much. A detailed AC interference study would be done to follow up with any significant AC.

Next Steps
1. Protect input from over voltage condition without messing up my accuracy.
2. Package hardware into a rugged project box to allow for field testing.
3. Setup wireless communication between the GPS Voltmeter and some "platform" to handle/record data. I'm leaning towards using the Xbee modules to communicate with either a RaspberryPi (could make a slick touch screen app to handle things) or PC (simple interface to excel perhaps).


I very much appreciate everyone's help. I am a big dumb animal and every new idea, or piece of hardware or software required forces me to learn. I took electronic engineering in college but never continued with it in my career, so I literally have to learn everything as I go. My middle aged brain slows me down and the distractions of work and family life leaves little time to get ahead.
 

danadak

Joined Mar 10, 2018
4,057
The ADS1114 is a Delta Sigma A/D converter, like the PSOC.

For diodes I would simply look for low leakage. I am out of date but I would have reached for 1N914s
as they have low leakage. However on inspection hot they leak like a sieve, so I am sure there are
better choices out there.

https://www.diodes.com/products/discrete/diodes-and-rectifiers/diodes/small-signal-switching-diodes/


PSOC is available with BT, BLE, or WiFi.

http://www.cypress.com/solutions/internet-things-iot

Or plain vanilla PSOC with ESP8266 type solution. I use ESP8266 in simple
T sensing WiFi enabled, work very good actually, and just WiFi boards down
around $2. Net has gobs of projects on ESP8266 and fully supported in Arduino.


Regards, Dana.
 

ebp

Joined Feb 8, 2018
2,332
I know how you feel about having to learn a whole bunch of new stuff every time. It can be pretty daunting.

I wish I could help more with some important generalities, but ...

One thing I can address, because it is "universal" in analog electronics, is input protection.

The big would-be advantage to Schottky diodes is that their lower forward voltage means that you can do a better job of preventing the protection diodes at IC inputs (almost all inputs have them) from conducting any current. But the reverse leakage current is a killer in high impedance circuitry. Low-leakage diodes can be had, but the choices are few and they are rather expensive (not in absolute terms, but certainly relative to ordinary switching diodes). The junctions of ordinary small bipolar transistors, such as the 2N3904 & 3906 actually do quite well as low leakage diodes. The collector-base junction is more broadly useful because of higher reverse breakdown voltage, but the base-emitter junction is a bit faster. The gate-body diode of a JFET can be very good, but they are a good deal more expensive. The late Bob Pease wrote a fair bit about diode characteristics. I know there was some in his book Troubleshooting Analog Circuits which I recommend as a source of all sorts of helpful information (just ignore his fanatic hatred of computers). He may have also written on the topic in his column in EDN, in which case it can probably be found free on the web.

I can't recall if I ever found any low leakage diodes that are available in surface mount packages and reasonably priced. If I did, the info is on another computer. I'll check later & report one way or the other.

Be very careful with overvoltge at the inputs of any analog to digital converter that has a multiplexer. This is something I learned the hard way in a CP circuit design. I had used two channels of the ADC for measuring the same thing, one channel with a high gain amplifier and one with a low gain, more or less as an alternative to a programmable gain amp. I clamped the outputs of the amps to the supply rails for the ADC using moderate resistance and ordinary signal diodes. It turned out that with that particular ADC, any voltage more than a few tens of millivolts, far below the clamping voltage, on any channel would interfere with all channels. Of course my high gain amp was usually operating where the output was clamped and when wanted to read the low-gain channel. It took a phone call to Linear Technology to find out that little detail that wasn't in the datasheet at the time. I had to rework a chunk of circuitry to fix the problem. Precision clamping is quite tricky, so I used a "clamping rail" to prevent the overvoltage and reduced my reference voltage for the ADC to have some margin between full scale and clamping.

The issues with signals beyond the rails can render on-chip variable gain amplifiers nearly useless, but it does depend entirely on the way the IC has been made. It is one of those things where talking to a manufacturer's aps engineer can be very valuable. Sometimes the added cost and complexity of not trying to do everything on one IC is worth it / necessary.

From your descriptions, I'm guessing your equipment is intended to do surveys on existing systems, rather than real-time control of the rectifier, and that GPS is both a convenience in terms of locations for the logs (it's not as if CP'd structures wander about the countryside, as a rule) and to facilitate synchronization of interruption of protection current over a long stretch of pipe.
 
Status
Not open for further replies.
Top