• Email: info@sparkyswidgets.com

Isolated eC interface

Isolated eC interface

Project description

IsoEC is an electrical conductivity interface with galvanic isolation that outputs data via I2C. It is able to select its gain range to adjust to the various KCell constants that probes come in and is a very cost effective solution for eC water quality probe sensing capability to any project. Built upon the proven MinieC interface project, combined with research from my Isolated breakout boards this board is the most cost effective way to add electrical conductivity sensing to any project!

I2CIsoBreakout

KISS

Simple but effective eC interface, great for every project that needs eC sensing

 

I always intended to round out my water quality sensor interface line and eC has always been a big focus of mine. It is a very difficult value to measure in a "friendly" way. That is we want to take measurements but we do not want to disturb what we are testing. From a chemical standpoint if we tried to use a DC signal to test the conductivity of a SUT we would end up breaking down the salt molecules, cause electrolysis and erode the electrodes. To account for this we must use an AC signal in the frequency range of 1 - 10 KHz we don't want to oscillate to slow, and we don't want to go to fast else we run into other problems.

To generate the sine wave we use a simple Wein bridge oscillator, made up from one stage of a quad op-amp. This oscillator can be a bit tricky, and may be changed to a phase shift style oscillator at a later time. The basic idea is the same we generate a large signal sine wave(about 3-4vpp) pass this signal through a voltage divider to get it into the .2Vpp range. From here it enters into the non-inverting input with the gain control feedback loop made up of a known resistor and the unknown resistance of the probe submerged in the SUT. The more salts(or TDS) the less resistance and the more gain we will get. From here it is a simple matter of math to calculate the resistance, and then to convert this to eC/PPM/TDS numbers.

One of the major drawbacks of interfaces like this are the noise considerations, there is also potential for serious ground loop and other galvanic problems to arise making measurements erratic and not very precise. To combat this I was one of the first to develop a full I2C interface stack complete with single supply isolated dc-dc converters, I2C isolators, I2C ADCs and precision Vrefs. The idea is very simple let the entire AFE float to probe potential. Most other units up until I released the first first isolated designs required the use to 2 isolated power supplies, one at source and one at the interface's "secondary" side. While they are isolated the probes are held to the secondary supply's reference which in many cases is not ideal. This is troublesome both from an ideal measurement standpoint and increasing the complexity and cost of implementation if done properly. the Iso line solves these issues but still remains quite cost effective, and miles above the competition (who frankly copy me way more than they should).

What's inside

A bit about the vision of my interfaces and whats indie this project!!!

A couple years ago I started shifting my designs to leverage I2C and the available I2C hardware better. Frankly speaking it just makes sense from an engineering aspect, a 2 wire bus that allows many downstream units that is quite robust and really easy to implement especially for bringing in future unknown hardware. From a parts standpoint you can get really high quality ICs at great prices, due to slower bus speeds than SPI for example. I was always planning to leverage this to make galvanic isolation much easier, and to provide better overall measurements and raise the bar on sensor interfaces such as this. The idea is really simple, I only need to isolate 4 lines, SDA, SCL, V+ and GND. Now we can float the the analog stuff but still communicate over a simple yet robust protocol, all the while allowing us to add more control and sensor capability on the isolated end just by adding I2C solutions. This project is the perfect example of this, by using I2C potentiometers we can increase our capabilities with out adding any more complexity in terms or isolation and communication. An example of this would be to add in an I2C temp sensor, DAC for offset control or even a I2C-1Wire bridge to a temp probe.

Isolation Portion

How to Isolate I2C with a single supply!

There are a lot of isolated DC-DC solutions on the market, but I had very specific requirements which lead me to source the Analog Devices uModule line of isolators. First this has to be a single supply, that has always been my intention for very reasons, and AD were one of the very first to offer on die air core micro transformers that could provide a substantial amount of current (mA not uA!!) with very high isolation ratings per IC size. Not only did this mean monolithic devices but it also meant they had established a well rounded line of ICs around this technology for most applications including I2C with speeds up to 1mhz!. Space and voltage regulation are other considerations I in mind when doing parametric searches for the perfect solution. In the end I had tried several solutions but most had some serious gotchas and traps in them. Sometimes it pays off to research these a bit 🙂 After extensive parts searching, research and many late night datasheet sessions I settled on the ADUM6010 and ADUM1251 combo. They are available, fairly cheap for what they offer and they work really well!!

The ADUM6010 is a DC-DC converter that is fully isolated with some interesting features that make it very useful in the end. The first is since it contains 4 on die air core resistors it has a very high isolation rating, it is also monolithic without the need for external switchmode chokes or transformers. The unit has voltage select-able output which is regulated and can support up to 150mW of total power throughput. It also has a great input voltage range from about 2.7 up to 5.5 with regulated output at the selected value. This makes the 6010 useful for powering level shifting devices should they need isolation as well (this is quite common actually). In short VIN from 2.7 to 5.5 and you get an isolated regulated Vout at 3.3 or 5V, all this without the need of extra components besides a couple caps and feedback resistors!!

The ADUM1251 is a bi-directional hotswappable I2C isolation IC, it is open drain on both sides so you can drop it directly inline with existing I2C devices(like 2 breakout boards with interconnects). It has all the protection passives inside the die to allow for hotswapping without extra termination on either end. The really cool feature is that either end can be primary or secondary which means this device will work in situations were you may have only 2.7V in but the high on the output will be at output sides VDD! Because we may have situations where a master may be on the isolation end it is important to use the Bi-directional variant. The 1251 is a really simple and effective chip and makes isolation of an I2C bus extremely easy. In the end it was far easier to Isolate the entire analog front end and let it float to the sensors reference passing only a digital signal over the barrier, after all I have a single supply and no need for opto-couple or photo-transistors to pass analog over for digitization. With these types of probes its best to digitize early!

Analog Front End

Why not just send the analog over?

The more conventional method of conveying the sensor information would be to filter and condition the signal for analog transport. If you wanted to cross isolation barriers it would mean the use of photo-transistors, opto-couplers, magnetics or other means. The analog signal on the other end would still need to conditioning for input into an ADC anyway. To make things simpler and more effective its easier to digitize early. This type of sensor interface is a perfect candidate for early digitization. The signals are fairly predictable (we know our ranges and the Fqs are pretty low really) and easy to filter in software, this means with can do some basic filtering and conditioning before the ADC but can let our DSPs or software do what it does best!

At the heart of IsoEC is an upgraded MiniEC analog front end. It consists of a quad op-amp with the first stage acting as a wein bridge oscillator without AGC. We can get away with this since our board is a very controlled environment, dispite this the temp-co of the resistors and caps mean it is sensitive to temp changes. I have been looking into switching the first stage to a phase shift style oscillator. The first stage could be just though of as a black box oscillator to the next stage. The amplification stage is where all the work happens. We treat the probe in Solution Under Test as an unkown resistance, and place it as one part of a gain feedback loop. By using a known resistance as the other leg of the control feedback loop combined with a known input signal we can calculate the gain adn therefor the unkown resistance of the SUT. Once we have the resistance is simply a matter of math to perform the eC, PPM and TDS calculations. To finalize the signal conditioning we rectify it with a super diode op-amp stage followed by the last stage configured as a buffer. This gives us a pretty nice DC output proportional to the eC of the SUT! A digipot was added to allow for probe tuning and should let you use KCell outside their regions!

The charge pump output was cleaned up a bit with the added RC filter to catch any stray 250Khz noise kicking off. This also lets me put the filter cap near the Op-amp which will give the negative rail a bit of bypass capacitance. The layout on MinipH was pretty close so it used the 1uF as a basic bypass but .1uF is really much more ideal. The other thing of note is that this is where the Datasheet layout was more closely followed, IE moved the Flyback cap to the just in front of the 2 pins.

On the digitization side of the Analog front end is the MCP3221 12Bit ADC from Microship. I have used this ADC in many projects and am very pleased with its performance especially when price is factored in. It is a highly mass produced ADC, that is readily available with well know performance. It has 8 different address variants so you can create quite a lineup out of them with 8 on the bus at the same time! The MCP3221 is the perfect combination of features to make it usable in a digitize early design. The I2C lines can be pulled up higher than the ICs VDD(which is also the VRef In), so you can feed it a 3.0 reference but use 5v level logic. It comes in a small SOT23-5 package so board space use is kept to a minimum. Because of its low power nature you can power it from a precision vRef, which is extremely useful. All in all it is one of my favorite external ADCs, its open ended nature means you just ask it for its value, it handles conversions itself!

That's about it

digitizing and sending back the data is goal after all

That really is the bulk of it all, we have a single supply isolation DC-DC converter powering our AFE and ADC, plus a precision vRef and digital pot. It may seem daunting or a bit complex at first but each problem was broken down, solved and tested to ensure that when the pieces are brought together the impact from each part to the other is minimal. In the end this has been an effective project and a great upgrade to the Mini line of sensor! This project is a very high quality sensor interface at a very reasonable cost that is easy to use! What more could you ask for from an Open Source Ion Selective Electrode Interface!

You checkout my store to find IsoEC.

Basic Usage

Very similar to the MiniEC, its easy to set gain and read back values

Happy Water Sensing!

Creative Commons License

IsoEC I2C eC Probe Interface by Ryan Edwards, Sparky's Widgets is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.Based on a work at http://www.sparkyswidgets.com/portfolio-item/ion-selective-electrode-interface/.

Overview

I2C eC probe interface with Galvanic Isolation

Details

  • I2C protocol
  • Galvanic Isolation
  • adjustable gain for probe tuning