Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:52 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : Measuring an isolated voltage

Author Message
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 11:58pm 24 Jan 2012
Copy link to clipboard 
Print this post

I've been trying to figure out a way to measure a voltage on a solar panel (or battery or whatever) using the ADC on a microcontroller that does not share a common ground with the voltage being measured.

I've been thinking about using an optoisolator and feeding the output of that directly into the ADC. I'm thinking that the brightness of the led will vary with the voltage input to the optoisolator which will (hopefully) vary the output as well.

However I'm not sure it'll work. Any of you electronics gurus care to comment on if you think it'll work/any gotchas etc? I'll post a proposed schematic when I get a chance to knock one together.
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 01:48am 25 Jan 2012
Copy link to clipboard 
Print this post

okay, here is a rough concept of what I'm thinking about. The battery on the left is a substitute for whatever voltage source is going to be monitored by the adc.



 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 06:23am 25 Jan 2012
Copy link to clipboard 
Print this post

I doubt that would be even remotely linear. There are special optos to do this, they have feedback to the isolated side but a standard opto would not work IMO. it will also load the source a lot which may or may not matter.

The best way I think it to use serial of some type to transfer the data across the isolation barrier.

For example a VCO powered by the source, or an 8-pin uC sending serial data from its ADC.

What level of Vs are you expecting?

______
Rob Edited by graynomad 2012-01-26
Rob Gray, AKA the Graynomad, www.robgray.com
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 10:33am 25 Jan 2012
Copy link to clipboard 
Print this post

Thanks for your input Rob. I think you may be right about using a small microcontroller's serial output. It seems the best approach. I was trying to come up with something a little cheaper, but given the cost of the other components the price is going to come out fairly close to a small microcontroller anyway.

The initial set up I'm planning on trialling this on is a 12V system (solar & wind into a battery bank), however I'll be switching to a 48V system later.

Mostly at the moment I'm kicking ideas around before I finalise the design for my modular charge controller. The basic concept is a small micro monitors the battery and switches on various loads (i.e dump loads) as appropriate, but I'm also playing with the idea of disconnecting the sources for various reasons. each source will have its own module with a voltage sensor and a current sensor, plus n-channel mosfets to connect the source.

I'd like to disconnect the wind turbine to allow it to spin up to a working voltage faster before loading it up with the batteries/dump load.
I'd also like to disconnect and/or PWM control the solar panel output to regulate the charge current.

I guess the other way I could go is use a common ground and either p-channel mosfets or n-channel mosfets with a high side controller chip.
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 10:17pm 29 Jan 2012
Copy link to clipboard 
Print this post

I got around to testing the concept over the weekend with an old opto-isolator. If anybody else cares, Rob was right: its completely non-linear and pretty much non-workable.

Oh well, live and learn.

Thanks again Rob.
 
sjh7132
Newbie

Joined: 27/12/2011
Location: United States
Posts: 13
Posted: 10:25pm 29 Jan 2012
Copy link to clipboard 
Print this post

Check out the Analog Devices AduM5402. In a single chip you get an isolated 5v power supply and 2 lines of isolated communications in each direction.

Using one of these parts, and a 5v serial A/D you could run your A/D at the potential of the battery you are measuring. This chip would supply power and the communications path.


Steve
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 10:49pm 29 Jan 2012
Copy link to clipboard 
Print this post

Have a go at googling "linear optocoupler". There are a few chips out there that are designed for just this purpose.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 12:03am 30 Jan 2012
Copy link to clipboard 
Print this post

I have had a mate email me to say he's got a similar circuit working with a standard opto, but I think it was very dependent on getting the components just right and matched and only linear in a reduced range.

So I guess it can be made to work if you really know your analogue, but I'm 90% digital and always go for converting analogue to digital once as close to the source as possible.

_____
RobEdited by graynomad 2012-01-31
Rob Gray, AKA the Graynomad, www.robgray.com
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 04:33am 30 Jan 2012
Copy link to clipboard 
Print this post

Thanks for the input guys.

I've had a look at those suggestions and I think they could work. Unfortunately the cost of going this way gets pretty substantial once you start looking at 2 inputs per source, and 4 different sources.

About the cheapest I came up with was a 2 channel ADC chip talking back to the microcrontroller via an optocoupler. With their own regulators and precision voltage references that worked out at just under $42 for the 4 sources (not including resistors and capacitors), or $10.36 per source. Not too bad, considering there are some pretty good advantages to doing things that way.

I'd still like to find a cheaper option if I can manage it though. I'm contemplating using a differential amplifier (- input to the source gnd, + input to the output of the source zener voltage divider, powered by the uC's VCC). With a gain of 1. I imagine to do this I'd need to tie the source's gnd to the uC's gnd with a 100k resistor (guessing). Cost comes out at approx $1 per source, or $4.38 per source if each source has its own ADC. Any thoughts on this approach?
 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 11:48am 30 Jan 2012
Copy link to clipboard 
Print this post

I designed a system a few weeks ago that used micros powered from the load and had them all on an opto-coupled ring network.

All cheap parts, no expensive ADCs.

I posted about it here to gauge if it was of interest to people but got no response so moved on.

______
Rob Edited by graynomad 2012-01-31
Rob Gray, AKA the Graynomad, www.robgray.com
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 08:38pm 30 Jan 2012
Copy link to clipboard 
Print this post

I would use an Analog Devices AD654 voltage controlled oscillator.
Low cost and very few components required to get it going.

This chip has enough output grunt to drive an opto coupler directly.
Then use a microcontroller that has a timer input function that can measure either frequency or period.

Very easy to get at least three digit accuracy, excellent long term stability, and perfectly linear.



Cheers,  Tony.
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 11:16pm 30 Jan 2012
Copy link to clipboard 
Print this post

  graynomad said   I designed a system a few weeks ago that used micros powered from the load and had them all on an opto-coupled ring network.

All cheap parts, no expensive ADCs.

I posted about it here to gauge if it was of interest to people but got no response so moved on.
______
Rob


I must have missed that one Rob, I'll go look it up.

*edit* Found it I think, and even posted about it at the time.
http://www.thebackshed.com/forum/forum_posts.asp?TID=4351

stupid crappy memory.

So I'm curious about how you designed/implemented it. If I use something like a Attiny20 ($1.78 digikey) powered from the source I'd still need the precision vref ($2.75), 5v voltage regulator ($1.07) and the optocoupler ($1.50ish, havn't selected an exact one) for each channel. Thats a bit better at $7.10(ish). I'm assuming everything will be talking over the SPI port, which would require 2 data lines and an "enable" signal...

Would you be able to provide any detail on your design Rob? I'd quite like to learn from it. I'm pretty much a newb at this, and the amount I don't know about electronics is astounding.Edited by powerednut 2012-02-01
 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 11:40pm 30 Jan 2012
Copy link to clipboard 
Print this post

Actually I just checked

http://www.thebackshed.com/forum/forum_posts.asp?TID=4351&PN =2

and you were the only one that did respond

______
RobEdited by graynomad 2012-02-01
Rob Gray, AKA the Graynomad, www.robgray.com
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 11:50pm 30 Jan 2012
Copy link to clipboard 
Print this post

  Warpspeed said   I would use an Analog Devices AD654 voltage controlled oscillator.
Low cost and very few components required to get it going.

This chip has enough output grunt to drive an opto coupler directly.
Then use a microcontroller that has a timer input function that can measure either frequency or period.

Very easy to get at least three digit accuracy, excellent long term stability, and perfectly linear.




Thanks Warpspeed, thats a nice suggestion... looks like the chip could be run directly from the source power which is good. A bit on the expensive side at $9.87 a chip, though I could eliminate a bunch of the other components (voltage reg, precision ref etc) with it. I'll play around with a design involving that and see how it comes out cost wise.
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 12:18am 31 Jan 2012
Copy link to clipboard 
Print this post

I think you will be very pleased with the performance of the AD654.

I have used it many times over the years for similar isolated measurement applications.

Two hidden advantage are the automatic noise averaging effect over the time measurement window at the microcontroller, and the very high theoretical resolution possible with this approach.

If you use 1% metal film resistors, and a 1% polystyrene timing capacitor, you may be able get away without any zero or scale adjustment trim potentiometers.
They are that good.


Cheers,  Tony.
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 11:53pm 31 Jan 2012
Copy link to clipboard 
Print this post

Well, I worked through a couple of variations on the design. Turns out the cheapest method is to use a high-side driver chip, in this case a MIC5014, and keep the ground common. That might not be the case in a 48V system, but for my current 12V system it'll work fine.

I did find an interesting write up on using differential amplifiers to monitor individual cells in battery bank. Thats here if anybody is interested.

Thanks for all your input and suggestions guys. Your help was very much appreciated.
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 12:07am 01 Feb 2012
Copy link to clipboard 
Print this post

I am curious ???

How do you use a high side gate driver chip to measure an isolated voltage ?
Cheers,  Tony.
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 01:18am 01 Feb 2012
Copy link to clipboard 
Print this post

Good question. Buggered if I know, I don't think it can.

It does, however, let me tie the gnds of the battery and the various sources together and switch the +V lines., which means the voltages are no longer isolated, and I can read them easily with my microcontroller's ADC.

The way my circuit was designed I had the +V from the panel/turbine/whatever connected to the + on the battery bank. the - on the battery bank was connected to the drain on my n-channel mosfets, with the source on the mosfets connected to the panels 0V. That left the 0V from the panel floating from the battery when the mosfet wasn't turned on.
Thats only really a problem because I was trying to use one central microcontroller to run 4 different inputs and I want to hold off connecting some of the inputs depending on their voltage level.

I'm probably vastly overcomplicating things.
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 01:45am 01 Feb 2012
Copy link to clipboard 
Print this post

One effective way to measure a completely isolated voltage is the "flying capacitor" method.

What happens is, you connect a storage capacitor across the voltage you wish to measure with one side of a pair of changeover relay contacts.

The capacitor charges up and holds the voltage.

Then the contacts change back, and connect the capacitor to a high impedance DAC, or whatever.

This can provide very high values of ohmic or voltage isolation, and is very effective.

You can also measure negative voltages with a positive reading DAC by crossing the relay connections over on the return.
It may sound rather crude and a bit dodgy, and it probably is that, but with the right components it can certainly be made to work very well.

It doesn't get much cheaper than that either...

While it is probably not the best way to continuously monitor a single isolated voltage of interest.
It would be practical for logging infrequent samples of maybe individual battery or cell voltages, or individual ultracap voltages in a fairly high voltage string.Edited by Warpspeed 2012-02-02
Cheers,  Tony.
 
powerednut

Senior Member

Joined: 09/12/2009
Location: Australia
Posts: 221
Posted: 03:40am 01 Feb 2012
Copy link to clipboard 
Print this post

neat trick. I'm learning heaps from this thread.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024