## Recommended Posts

Hello Wizards,

I was wondering what hardware can we use for conversion of high dc vlaue upto 400V to with 5V dc range (linear) so that the ADC module can measure and display the result using 7 seg display?

Shree

##### Share on other sites

Resistors.

Use two in series between the 400V source and ground. Take the point between the resistors and send it to the PIC but put a 100 Ohm resistor in series with that.

400V -/\/\/\/--A---\/\/\/\/\---GND

At point A-----/\/\/\/\/\----PIC

Call the resistor between 400V and point A R1, the resistor between A and GND R2, the resistor between A and the PIC R3. Make R3 100 Ohms to limit current to the PIC clamping diode in case some nut case puts 1KV on the input. To solve for R1 and R2 requires knowledge of what kind of load you can put on the 400V source. I'll assume it can handle 10K Ohms.

Our buddy Ohm has a law that states the Voltage = Current * Resistance (V=IR). So at 400V we would like point A to have 5V so the voltage across R2 is 5V. The current is (I=V/R) or V/(R1+R2) or 400/10,000 = 40mA. R1 = V/I = 5/40mA = 125 Ohms.

R1+R2 = 10,000 so R1 = 10,000-125 =9875 Ohms. The bummer is that you can't buy these values. The magic ratio you are looking for is 1/80 so R2/(R1+R2) is 1/80. You could use a 100 ohm for R1 and a 8.2K for R2 and get close (1/83). This would make 400V equal 4.82 at the PIC. This is a 4% error that you could get rid of with a lookup table or our friend y=mx+b.

I hope this helps.

##### Share on other sites
Resistors.

Use two in series between the 400V source and ground. Take the point between the resistors and send it to the PIC but put a 100 Ohm resistor in series with that.

400V -/\/\/\/--A---\/\/\/\/\---GND

At point A-----/\/\/\/\/\----PIC

Call the resistor between 400V and point A R1, the resistor between A and GND R2, the resistor between A and the PIC R3. Make R3 100 Ohms to limit current to the PIC clamping diode in case some nut case puts 1KV on the input. To solve for R1 and R2 requires knowledge of what kind of load you can put on the 400V source. I'll assume it can handle 10K Ohms.

Our buddy Ohm has a law that states the Voltage = Current * Resistance (V=IR). So at 400V we would like point A to have 5V so the voltage across R2 is 5V. The current is (I=V/R) or V/(R1+R2) or 400/10,000 = 40mA. R1 = V/I = 5/40mA = 125 Ohms.

R1+R2 = 10,000 so R1 = 10,000-125 =9875 Ohms. The bummer is that you can't buy these values. The magic ratio you are looking for is 1/80 so R2/(R1+R2) is 1/80. You could use a 100 ohm for R1 and a 8.2K for R2 and get close (1/83). This would make 400V equal 4.82 at the PIC. This is a 4% error that you could get rid of with a lookup table or our friend y=mx+b.

I hope this helps.

Thanks Ted,

A small question...if I am using a voltage divider circuit, the grounds of 400 V dc and the 5V dc supply of the PIC would be different (As I am using a SMPS for powering the PIC). Would not the two different grounds (400V dc and 5V dc) affect the ADC calculations? Another way round if I shorted the two grounds wont the 5Vdc would be clamped up?

Thanks again

Regards

Shree

##### Share on other sites
Resistors.

Use two in series between the 400V source and ground. Take the point between the resistors and send it to the PIC but put a 100 Ohm resistor in series with that.

400V -/\/\/\/--A---\/\/\/\/\---GND

At point A-----/\/\/\/\/\----PIC

Call the resistor between 400V and point A R1, the resistor between A and GND R2, the resistor between A and the PIC R3. Make R3 100 Ohms to limit current to the PIC clamping diode in case some nut case puts 1KV on the input. To solve for R1 and R2 requires knowledge of what kind of load you can put on the 400V source. I'll assume it can handle 10K Ohms.

Our buddy Ohm has a law that states the Voltage = Current * Resistance (V=IR). So at 400V we would like point A to have 5V so the voltage across R2 is 5V. The current is (I=V/R) or V/(R1+R2) or 400/10,000 = 40mA. R1 = V/I = 5/40mA = 125 Ohms.

R1+R2 = 10,000 so R1 = 10,000-125 =9875 Ohms. The bummer is that you can't buy these values. The magic ratio you are looking for is 1/80 so R2/(R1+R2) is 1/80. You could use a 100 ohm for R1 and a 8.2K for R2 and get close (1/83). This would make 400V equal 4.82 at the PIC. This is a 4% error that you could get rid of with a lookup table or our friend y=mx+b.

I hope this helps.

Ted,

If you use 10k for R1 then you will need to dissipate approximately 16W! Large power resistors are never very good for pot chains anyway and their range of values is small.

In your last statement you say that R1 is 100R and R2 is 8k2. Something definitely wrong there!

Shree,

Apart from dissipation you also have to consider the voltage rating of R1. This needs to be at least 500V or use 2 or more resistors in series to make up the value.

The impedance seen by the PIC ADC input needs to be kept as low as possible (lower than 4.7k - 10k for most PICs).

You need to keep the voltage to be measured within the range of the ADC otherwise you will hit the end stop and get a false reading. This means that you must consider the range of measurement, the resolution required and the full scale reading possible. e.g. if you expect to read 0 - 400V then I would make the fullscale reading say 450V or even 500V. This does reduce the accuracy somewhat but if you only need to measure the 400V within a narrow band of say +/- 50V then you could use the -ref pin to provide an offset to make full use of the ADC range to improve the accuracy.

For basic measurements of 0-450V simply use the 5V rail as the reference, make R1 = 440k (2 x 220k 1/2W in series), R2 = 4k94 (4.7k 1/8W + 240R 1/8W in series) and R3 = 100R 1/8W.

For greatest accuracy use an accurate reference voltage such as a REF198 (4.096V) with say 0.5% or better tolerance resistors with appropriate values and place a non-inverting buffer amplifier between the chain and the ADC input to reduce the impedance.

The 400V ground and the PIC ground MUST be common for the above simply circuits to work. If your SMPS supplying the PIC is truly isolated and everything is safely enclosed (i.e. nothing can be touched by the operator or poked through holes and safety clearances are maintained) then you should be able to connect the measured supply and PIC supply grounds together.

If you need to have isolation between the PIC and the measured voltage then you need to look at either analogue isolators (NOT simple optos!) or carry out the measurement on the 400V side and transfer the result over an isolated digital link. In most isolation cases you will also need to provide isolated supplies for amps, PICs etc. which is always a bind.

Regards

davidb

##### Share on other sites

Hey David & Ted,

Thanks for that. Would try and let you know if it works.

Regards

Shree

## Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible. ×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.