# How to read 0 -10V analog voltage with lower voltage tolerant ADCs without a voltage divider

Background Information

I want to implement an ADC as an extension to a Raspberry Pi, so that it has the capability to read analog signals. I will be using the MCP3004/3008, as I got lost in the datasheets of the TI counterparts. For now, 10-bit resolution is good enough.

I am aware that I could use a voltage divider like this:

simulate this circuit – Schematic created using CircuitLab

The Question

Because this is for a prototype that should be up to industrial safety standards, my boss wants me to isolate the 10 V from the 3.3 V logic. I don't really know a method to do this though while reading analog signals.

My Google search didn't yield any answers to me. So I was wondering if there is a method to read analog values, without a voltage divider that is safer to use when reading higher voltages with low logic voltage components. I would use an opto-coupler if this was a digital signal, but I am not sure if there is a way to achieve the same level of isolation while reading analog values. I would appreciate it if somebody more experienced would share his knowledge.

• Either build a clamping input circuit, or put an MCU with a 10-bit ADC on the input side and feed a serial stream through an optoisolator into a pi. Or just decide that a pi itself is cheap (and itself ultimately quite unreliable given the SD card) and consider the whole thing to be a sacrificial component in the overall system. You need more specific details of your boss's motivation to chose a proper solution. Nov 5 '20 at 17:54
• @TonyM, be careful replacing schematics with images. The schematics provide the simulator link and we can use that to copy and edit the schematic into our answers. I can't run the simulator on the OP's circuit now. d:^) Nov 5 '20 at 18:05
• @Transistor made the schematic less... dominant, whilst keeping it editable. Nov 5 '20 at 18:10
• @TonyM. Another Imgur trick is to add an 's', 'm' or 'l' in front of the ".png" to force small, medium or large. Nov 5 '20 at 18:32
• What do you mean by "isolate"? Do you literally need galvanic isolation, or is this something else? Nov 6 '20 at 12:38

However because this is for a prototype that should be up to Industrial safety standards, my boss wants me to isolate the 10V from the 3.3V logic.

I question your boss's logic when it comes to industrial standards: Where you need that level of isolation, I'd presume you want something very different than a raspberry pi running general purpose operating systems for safety reasons. But I digress.

Basically, isolating an analog signal and still reproducing it with a high number of bits is hard, and nearly impossible when you want accuracy at DC.

What you do instead is usually put the ADC on the unprotected side, and isolate the digital interface to the ADC!

Two ways to do that:

1. Using typically optocouplers to interface your ADC to your MCU. That's easy with an SPI ADC (by the way, you could at 10 bits also just throw out the MC3004, and use any of hundreds of capable microcontrollers that have a built-in ADC and might make your solution more flexible, but I, again digress).
2. Using an isolated ADC, which does isolation internally.

• @EmreMUTLU yeah, well then your boss is bad at risk assessment: Bachelor students are awesome (they really are), but the risk of your code malfunctioning vs a high-value resistor divider letting through enough current to damage an ADC which, in itself (datasheet, "absolute maximum ratings") is ESD-protected is um... ovewhelming. Nov 5 '20 at 19:00
• yes, great, still, you're the hardware guy, so what hardware risks are you actually mitigating by using isolation here? What specifically is protected against what kind of failure, i.e. under which condition does your isolation actually do anything that you need? Nov 5 '20 at 19:23
• again, isolation isn't solving any problems that actually do exist here, almost certainly. Pinpoint one realistic problem you're solving by isolating this one voltage. Nov 5 '20 at 20:49
• To second Marcus's point, your bachelor's thesis relies on you having a pinpoint understanding. You're the hardware designer, so you need solid requirements including the reasons for them (your final report will most likely list those requirements in detail as the first chapter after the introduction), and you can make decisions on your own if you know the requirements. Get serious about understanding the system, because if you can't explain your hardware to the examiners, you likely won't be awarded your degree. Nov 6 '20 at 7:59
• @EmreMUTLU but as PCB designer, you need to understand your requirements. All you got was a frankly vague and unsensible direction of your boss, not an understanding what you need to design to protect what against what failure. That's the lack of understanding. Nov 6 '20 at 9:44

I would use an opto-coupler if this was a digital signal, but I am not sure if there is a way to achieve the same level of isolation while reading analog values.

There is a product sold as a "precision linear optocoupler" for this purpose. Basically this is an optocoupler with one transmitting LED and two receivers. You use the second receiver to provide feedback to an op-amp circuit on the transmit side of the circuit to linearize the optocoupler response.

(image source --- be aware that this specific product is obsolete)

I haven't used these parts enough to know how difficult it would be to achieve 10-bit accuracy when using them.

However, based on your comments to Marcus' answer, it seems like what you really need is not galvanic isolation but simple input over-voltage protection. You could achieve this with a simple zener diode limiter, for example:

simulate this circuit – Schematic created using CircuitLab

Now if we pick an 8 V zener (for example) it won't interfere with the ADC voltage under normal conditions, but it will limit the voltage delivered to the ADC under fault conditions to 4 V through 1 kohm, which can be handled by the over-voltage protection circuits of typical ADCs. When the fault occurs, the zener will need to absorb $$P_Z = (8\ {\rm V})\frac{48-8}{2k}{\rm A} = 160\ {\rm mW}$$ which is an easily obtained rating.

It's possible you actually need both isolation (to protect against common mode transients up to 100's or 1000's of volts, which may occur in circuits connected to motorized machines) and over-voltage protection (to protect against your 48 V supply shorting to this analog signal), in which case you might want to use both the zener and the opto-isolator (probably with the zener circuit protecting the input of the optoisolator circuit).

• Thanks a lot, just learned something new. I will look into it! Nov 5 '20 at 18:30
• @EmreMUTLU: Your boss is smart to isolate the inputs. This is standard practice on industrial PLC analog inputs. Nov 5 '20 at 18:44
• @Transistor, in another comment it was mentioned the reason to use the RPi is to communicate with WiFi from the "module" to wherever the signal goes. That will provide "substantial" isolation already. Admittedly it's not very clear exactly what OP or their boss really wants or needs and what faults they are protecting against. Nov 5 '20 at 18:46
• @ThePhoton Didn't know there's linearized optoisolators! But you're right to mention that their utility here might be limited: little help if you isolate a signal, but fail to isolate supplies. Nov 5 '20 at 20:01
• Personally, I've recently dealt with IL300. As long as that circuit works correct, there are lots of problems with calibration. ICs may come from different production series. Different currents, sensitives, temperature dependencies. Callibration is not so easy. Nov 6 '20 at 10:52

I suggest using an ADC + MCU or maybe an MCU with an onboard ADC and transmitting the data digitally over the isolation barrier.

Analog methods are possible (transformer methods are usually better than optoisolator), but it's difficult not to significantly compromise even a 10-bit ADC.

If you want to avoid the MCU, you can find a single-chip solution to isolating the I2C bus and use an I2C ADC chip. No extra programming then.

• @EmreMUTLU Well, they claim their own product (which I have specified) works fine, and that's been my experience. Nov 5 '20 at 19:46
• I deleted my comment. Because on the next page they say theirs worked fine. Thanks this will be very usefull. Nov 5 '20 at 19:48
• Nobody's mentioned the old school V/F converter. Nov 6 '20 at 20:09
• @DDuck Sounds like a possible answer. Nov 6 '20 at 20:58

Another option not mentioned above are "isolation amplifiers". They come in a couple of different flavours, but essentially act as analog buffers with isolation between the input and output. Really simple to implement, can have mediocre to excellent accuracy, can be expensive.

Use a voltage to frequency converter (VFC) to generate a square wave at a frequency proportional to the input voltage. Take this digital signal through an opto-isolator and then into a digital pin of the microcontroller - which then can be used to to decode the frequency into a voltage.

There are still 8 pin VFC chips available - something like a LM331 - with 0.14 % full scale resolution it has only about 9 bits. Other VFC ICs exist but in general they are becoming rare and expensive.

However because this is for a prototype that should be up to industrial safety standards, my boss wants me to isolate the 10 V from the 3.3 V logic.

Your boss is half right. They really should be insisting that you get rid of the Raspberry Pi entirely. This is not an appropriate piece of equipment to introduce into an industrial environment. It also does not make sense to prototype using this as a platform. It is not an industrial tool - full stop. Whatever proof of concept you develop with this prototype would need to be re-engineered from the ground up if it worked, so why not prototype with something that doesn't require you to prototype twice?

The correct tool for the job would be an industrial PLC with an appropriate analog I/O module. 0-10V is a ubiquitous industrial standard. You can get cheap PLCs in the \$100 range and they ALL will support 0-10V I/O with proper isolation and protection already built in. There is absolutely no reason to go to cheap hobby toys when you are developing professional solutions. They don't interface without a hack because they are not intended to ever be used in the same environment.

Industrial environments, further, almost exclusively work on 24VDC control logic. The RPi's 3.3V and 5V logic are simply incompatible, so to even interface this to most industrial systems you would also need a 24VDC power supply and isolation relays between all your discrete I/O also. It doesn't need to be stated how silly this would be.

• Comments are not for extended discussion; this conversation has been moved to chat. Nov 8 '20 at 19:26