SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By calbertson
#139276
I was just experimenting with an optoisolator. The quad unit that Sparkfun sells. I was trying to pass analog signals through. I could sort of get it to work but it is not very linear.

It is possible with better bias and scaling? Do I just need to work harder at it? Or is it that these are only good for switching?

What I want to do is control the output of a variable 0 to 500 Volt DC power supply. I have a 500 Volt linear supply with a pass regulator and I need the Arduino to control the regulator. I wanted to use the isolator in the Arduino analog pins so that any accident (part failure) would not place 500V in the digital site. 500V is serious. It's a lethal voltage. What's the best way to do this?
By Mee_n_Mac
#139309
To answer your 1'st question ... yes they are only intended for switching.

To answer your 2nd question ... I'm not sure what to do.
By skimask
#139310
What happened to using a good ol' voltage divider? A resistor string?
Vin ---> Resistor#1 (say 99K) ---> TAP to Arduino ---> Resistor #2 (1K) ---> Ground

Put the 'duino on the TAP. R1/R2 make a voltage divider. With 500V in, the "TAP" should have 5volts on it.
Probably wouldn't want the thing to run that close to 5v, so change the ratio of the resistors, and put a very low amperage fuse on the line in, and a 5v (or lower) zener on the tap to ground...just in case.
By Philba
#139311
I think he wants isolation. A divider is exactly the opposite of that.

What about moving all the analog stuff inside the "quarantine" zone and communicate with the UI/reporting stuff via serial which can use optos? I think the ps2501 could handle up to 100Khz or so.
By AndyC_772
#139313
skimask wrote:What happened to using a good ol' voltage divider? A resistor string?
Vin ---> Resistor#1 (say 99K) ---> TAP to Arduino ---> Resistor #2 (1K) ---> Ground

Put the 'duino on the TAP. R1/R2 make a voltage divider. With 500V in, the "TAP" should have 5volts on it.
Probably wouldn't want the thing to run that close to 5v, so change the ratio of the resistors, and put a very low amperage fuse on the line in, and a 5v (or lower) zener on the tap to ground...just in case.
This is dangerous, and won't work. The power dissipation in the potential divider works out to 2.5W, so it'll overheat unless high power resistors are used. More importantly, if either resistor fails, you could get 500V on the CPU - which means smoke and fire if you're lucky, and sparky death if you're not. Adding a Zener makes it less bad, but it's still not what would normally be regarded as a safe design.

An opto-isolator isn't linear, but it is monotonic - so when properly biased, an increase in LED current always results in an increase in diode current. This means you can use it to transfer an analogue signal as part of a feedback loop, but you'll need to have an accurate voltage reference on the 'hot' side of the isolation barrier.

Have a good read about the TL431 adjustable shunt regulator; there are classic, well documented power supply designs which use this device for exactly the purpose you're describing. Please don't experiment with any power supply capable of anything anywhere near 500V until you have a circuit in which you have total confidence.
By skimask
#139325
Philba wrote:I think he wants isolation. A divider is exactly the opposite of that.
DOH!...der....good point...
By skimask
#139326
AndyC_772 wrote:This is dangerous, and won't work. The power dissipation in the potential divider works out to 2.5W, so it'll overheat unless high power resistors are used. More importantly, if either resistor fails, you could get 500V on the CPU - which means smoke and fire if you're lucky, and sparky death if you're not. Adding a Zener makes it less bad, but it's still not what would normally be regarded as a safe design.
It'll would work just fine. 2.5W? Ok, then use 99Meg and 1Meg resistors.
If either resistor fails, that's why you've got the low amperage fuse and the Zener.
Ok, fine, yes, I get the point, safety first, complete confidence, and all that. Nothing wrong with that. At the same time, there's something to be said for simplicity, small part count, and low cost.
By AndyC_772
#139338
A fuse will protect neither the operator nor the equipment. You wouldn't willingly shove even a fine wire into a live socket, I'd hope, and 500V will destroy a microchip even faster than it'll stop your heart.

Simplicity, low parts count and low cost are all well and good, but not in cases where a safer approach is absolutely required. The simple potential divider + zener design is OK to draw up in a simulator as a learning exercise, but it's not something to actually build in practice.

I use LTSpice, which is a free and excellent tool: http://www.linear.com/designtools/software/
By Mee_n_Mac
#139353
What "control" of the regulator are you intending the Arduino to do ? Are you trying to use it in the loop to control the regulated voltage itself ? Or something else, like the regulator being up and in range and turning it on and off and ??? If the 500V were 5V, what would the inputs and outputs to/from the Arduino be ? Obviously some analog input(s) but what for an output ? How ameanable are these to Philba's idea above ?
By calbertson
#139441
I want to be able to control the voltage output from the 500V supply from 0 to 500V. I don't need fine control, 8 bits over that range is good enough. So the plan is to map the Arduino's 0-5 volt range on to 0-500. I would pass 0-5 volts through the opto to the power supply. Then across the output of the power supply I have a 100:1 voltage divider. An analog control circuit compares the voltage of the divider to the voltage from the arduino and makes them the same. I don't need much bandwidth as I'd not change the voltage more than about once per second.

Other channels are some analog measurments comming back. I can use a voltage divider and op amps to scale them to the 0-5 volt range and then put them through the opto and then measure using the Arduino.

The application is measuring the characteristics of vacuum tubes. My "500 volt" spec is not absolute" I could use a lower or higher voltage. It could go up to 800V or maybe 250V.

Most of the tube equipment designed today is designed using poor quality scans of 50 year old data sheets. It would be good to have accurate data. Even better if Spice models could be built using this data.
By KeithB
#139451
I suggest two arduino's (or an arduino and an 08m2 picaxe.) One would be on the low voltage side and the other on the high voltage side. You could send a serial data byte through the opto-coupler from the low-voltage-side to the high-voltage side.
By abhinavjain
#149382
I'm facing a similar problem and have a solution in mind. May be you all can advice whether it is a feasible solution.

The problem here is that the optocoupler is not linear. How about we make something like a calibration curve for it and map the voltage value to corresponding voltage response of the optocoupler? Something like this - http://www.itl.nist.gov/div898/handbook ... s/clb1.gif

In principle it should work but needed some advice on it.
By MichaelN
#149386
abhinavjain wrote:I'm facing a similar problem and have a solution in mind. May be you all can advice whether it is a feasible solution.

The problem here is that the optocoupler is not linear. How about we make something like a calibration curve for it and map the voltage value to corresponding voltage response of the optocoupler? Something like this - http://www.itl.nist.gov/div898/handbook ... s/clb1.gif

In principle it should work but needed some advice on it.
Yes, you could do this, but why would you bother when the devices I linked to will do a much better job? The trouble with normal optocouplers (even if calibrated) is that they will drift with temperature & age, whereas the purpose built devices have feedback that will compensate for this.