How can I accurately measure DC voltage between 180 and 117 volts? I found the schematic for measuring more than 5 VDC at: Arduino Playground - HomePage
However, can't find an optoisolator that will handle up to 180 volds of DC. Any suggestions?
The circuits will give you an on-off signal (i.e., is the high-voltage signal there or not) but won't you let you measure it. Is that what you mean? do you want to be able to say, for example, that the voltage is 123.4V or do you just want to know whether the voltage is there (between 117V-180V) or not (0V)?
If you truly do want to measure it, how accurately is "accurately"?
--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected
My goal is to build an amp hour counter so I need as accurate a reading as practical. This information will be combined with a current measurement from a shunt to provide the current information. I think I can use the arduino directly to read the current in the form of a 0 to 50 millivolt drop across the shunt. However I haven't found a way to measure voltage in the expected range.
I'd avoid reading the output of a shunt directly. Instead, I'd go for something like the S22P series current sensors from Tamura. Isolated = good. Plus, the S22P puts out a always-positive signal centered around 2.5V, which is perfect for the Arduino because it uses a unipolar ADC.
As for reading voltage, few opto-isolators put out a linear signal, most are on/off, but they do exist. A carefully constructed voltage divider may be the way to go on the input side of the opto-isolator. But I would fuse that one very carefully given the potentials you are likely dealing with and I'd use a removable opto-isolator (i.e. DIP mount with a corresponding socket) to make opto-isolator replacement easy if you accidentally let the blue smoke out.
When dealing with high voltages try and make the circuit robust against component faliure - for instance the high-voltage arm of a voltage-divider should have 2 or more resistors in series (if any one shorts out the others protect you). The low-voltage side of a resistive divider should have a zener diode to limit voltage. You might think a resistor can't just short out like this, but it takes just one insect to crawl over it, or one drop of water to fall on it (for instance).
You mention DC so I assume the following warning isn't relevant, but I'll include it anyway:
Don't connect directly to the mains whatever you do, this may be illegal where you are, will invalidate your buildings insurance, etc etc. Mains can get extremely high voltage spikes due to lightning, nearby industrial switch gear, etc. Some sort of isolation good to many kV is a requirement.
Oh yes, one more thing, high voltage DC is more dangerous volt-for-volt than AC for shock hazard - DC causes your muscles to spasm and not let go (till the power is turned off). Neither is recommended(!).
While I understand the theory of a voltage divider, I really don't know how I'd design and impliment a circuit to utilize one when the voltage is going to range from a low of 121 VDC to a high of 166.5 with currents of up to 500 amps max for short periods of time.
The application is a amp hour counter within a electric vehicle that uses Lithium batteries.
If I understand the limitations of the Arduino, the max voltage it can measure directly is 5 VDC so a voltage divider to measure the expected range of voltages (45.5 volts) would have to include roughly 10 individual resisters in series.
I haven't sketched out this circuit yet because I'm still looking for a different approach. I know it can be accomplished but possibly not with an Arduino. I've seen demonstrated a slick device that can measure voltage, current, and track amp hours all in one panel mout meter. However, they seem to be no longer in production and I've not been able to find one yet. All I know for sure is that they are or were made in China.
If your goal is to measure both power consumption and voltage than you need 2 different things. Is it not easier to use a DMM with serial output and connect the serial output to your Arduino? I found the following example online: http://www.linuxtoys.org/dvm/dvm.html
Measuring the current is easy - you simply use a hall sensor rated for your desired current. Choose the correct model and it will provide a DC voltage output of 0 to 5 volts for +/- 500 amps
The voltage measurement is a little more complex and one possible solution might involve using a precision op amp with bias off-set. By way of example and using "round" numbers for illustration, say it has a gain of 2. Using a simple potential divider chain, break down a nominal 200 volts to say 10 volts. So, 0 to 10 volts represents 0 to 200 volts. Now you need to provide a constant off-set bias to the amplifier negative input of the equivalent of 150 volts, in this case 7.5 volts. So, with 7.5 volts (150 volts equivalent) going into the sense port, the amplifer inputs will cancel each other and an output of 0 volts will result. With 10 volts (200 volts equivalent) input the amplifier will see 10 - 7.5 = 2.5 volts, so will output 5 volts.
For any input less than 150 volts the amplifier will output a negative voltage, which can be blocked by means of a precision diode circuit.
The net result is a measuring system outputing 0 to 5 volts for a DC input of 150 to 200 volts
Adjust the figures to suit your particular application and variation ranges.