Isolated measuring of voltage/current using an Arduino - Page 1
Forum section: electronics / beginners

author: mcoms
author_rank: Newbie
timestamp: February 12, 2015, 08:13:51 pm
content: Hey all,I'd like to measure a voltage in the range 0-5V using an Arduino, but, I don't want to tie the ground lines of the two circuits. Is that possible?Background:I have a Yaesu FT-857 Amateur Radio transceiver which has an output for an Analogue Moving Coil meter (signal + ground).The radio will output a current varying between zero and 1 milliamp (0–1mA), depending on the signal strength received by the set. This is intended to drive the coil of an analogue meter. 1mA indicates a very strong incoming signal, values below are weaker stations.The spec doesn't give a voltage, but I've measured that this varies between zero and five volts (0–5V). It does appear that the voltage also varies with signal strength.I initially wanted to stick to measuring the current, but someresponses to this question on Stack Exchangepoint out it's probably a voltage source internally, so measuring either current or voltage should work.What's the best way to measure/sample this signal, while maintaining electrical isolation, so that I can use the value in an Arduino? The project will eventually be a digital 7-segment signal display.Thanks!

author: suicidaleggroll
author_rank: Super Contributor
timestamp: February 12, 2015, 08:17:23 pm
content: The simplest way is to sample it with an ADC on the local power supply (same gnd as the source), and then isolate the digital comms between the ADC and the MCU using an opto-isolator or similar.

author: Seekonk
author_rank: Super Contributor
timestamp: February 13, 2015, 11:57:41 am
content: An opto isolator is pretty linear, but your meter circuit is probably floating. T he opto will have to be driven by a differential input op amp. There is no reason why you can't just float the uno and directly attach it to the meter. I've been working with the MINI328 boards that are just the same as the UNO but smaller than two postage stamps and cost less than $3. These can be used in place of a lot of assemblies. Third, even if the meter is offset from ground there is no reason why both sides of the meter can't be used as inputs to the uno with appropriate voltage dividers and subtract one from the other to obtain a value.

author: dannyf
author_rank: Super Contributor
timestamp: February 13, 2015, 12:35:15 pm
content: QuoteYou can use high-linearity optocouplers - very expensive and not that great.Alternatively, do the measurement on the common ground side and use regular optocouplers to transmit the data (digitally).

author: cosmicray
author_rank: Frequent Contributor
timestamp: February 13, 2015, 03:01:01 pm
content: Depending on how low the current is, you may want to look at something that implements one of the Allegro Hall effect-based linear current sensor chips (ACS709, ACS711, etc). The boards that I've seen are implementing the current flow as an isolated circuit on 2-oz copper pad.Pololu makes a series of these boards, but keep in mind these boards were designed to operate on a larger current flow. Pay special attention to the warnings/disclaimers on each board as to the upper end operating voltage. The chips themselves are spec'ed for a higher isolation, but Pololu doesn't want you going there unless you really know what you are doing.https://www.pololu.com/search/compare/118Have you measured the voltage between this output jack and the frame ground of the unit ?

author: PeterFW
author_rank: Frequent Contributor
timestamp: February 13, 2015, 03:13:17 pm
content: Quote from: cosmicray on February 13, 2015, 03:01:01 pmMeasuring <=1mA current with one of the Allegro devices seems not possible with anny significant resolution. At least it looks like that to me.I only played with a ACS712 and just had a look at the other ICs, none of them looks suited to this task. They do a good job at higher currents though.But they reference the output against the supply voltage, to me that is a big PIA.Greetings,Peter

author: cosmicray
author_rank: Frequent Contributor
timestamp: February 13, 2015, 03:25:29 pm
content: Quote from: PeterFW on February 13, 2015, 03:13:17 pmAgreed. One of the parts had a rating of 185 mV/A, but that would leave a 1 mA current flow generating a change of less than 1 mV on the output, which would put it down in the noise. Too bad the hall effect sensor requires a minimal amount of current.

author: mcoms
author_rank: Newbie
timestamp: February 15, 2015, 11:09:24 pm
content: Thanks everyone!Did a little more experimenting on this... The ground of the meter output does seem to be common with the radio's ground/chassis and PSU, so sampling on the radio side does seem to be a nice/easy option (and probably the most accurate).I do have an ACS712 module handy, but unfortunately the current (1mA) does seem too low to reliably measure with it.For fun, I hooked up a PC817 Photocoupler I had laying around, and ended up with the following:Surprisingly this does seem to work — the current through the 10K resistor does vary according to the input, and the voltage on the test point [relative to GND] is the inverse of the input.I can't be sure how linear/accurate this actually is with the cheapo meter I have, but will do a bit more testing.Does this schematic seem sensible? How about the choice for the resistor values — giving the varying voltage/current on the meter terminals, I was a bit unsure how to choose R2 to protect the PC817's internal diode. R1's value was more or less arbitrary...Cheers!

author: dannyf
author_rank: Super Contributor
timestamp: February 15, 2015, 11:23:06 pm
content: QuoteAll in the datasheet - CTR.

author: Seekonk
author_rank: Super Contributor
timestamp: February 16, 2015, 09:41:46 am
content: Have you used the MAP function? An easy way to convert one unit to another. Even if the output is non linear it is easy to break up the curve to 2 or 3 sections with an IF and use the MAP on them.

author: langwadt
author_rank: Super Contributor
timestamp: February 16, 2015, 02:12:34 pm
content: Quote from: dannyf on February 15, 2015, 11:23:06 pmAnd can be anything between 50x and 600x depending on which one you get, vary nearly 2x from 1mA to 15mA,changes as the LED ages. As draw it the LED is driven via a resistor, not with current source so even more non-linear

author: Zero999
author_rank: Super Contributor
timestamp: February 16, 2015, 03:32:19 pm
content: Opto-couplers are not linear and their characteristics change over time and at different temperatures so are not suitable without compensation.An opto-coupler can be used but it needs to be one with a pair of matched photodiodes both coupled to the same LED. One of the photodiodes is then placed inside the feedback loop of an op-amp circuit which compensates for the non-linearities.http://www.jameco.com/Jameco/Products/ProdDS/1548967.pdf

author: Seekonk
author_rank: Super Contributor
timestamp: February 16, 2015, 05:04:58 pm
content: Anything not worth doing is not worth doing right. It's a S meter.

author: jamesd168
author_rank: Contributor
timestamp: February 16, 2015, 07:36:36 pm
content: Quote from: mcoms on February 15, 2015, 11:09:24 pmit will be nice to know the transient aspect of the signal, which will help you decide on the correct parameters for the parts used.

author: Seekonk
author_rank: Super Contributor
timestamp: February 17, 2015, 04:08:43 am
content: As far as linearity, surprised no one has noticed that the opto doesn't start conducting till about 1.3V. That is 1/4 the meter scale. Suppose you could put a battery in series.Honestly, the requirement for isolation is absurd. If the meter floats a few volts above ground it can be read differentially with two A/D inputs with well over 100K input resistance. This would have far less effect than pulling off a couple ma to drive an opto.