Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can I test high current with a pic?

Status
Not open for further replies.

spindrah

New Member
hi

can i use a pic to read high current? (20-100 amps at 30-100volts)

if so how would i go about it?

this is what i'm working with:

**broken link removed**

thanks

jay
 
spindrah said:
hi

can i use a pic to read high current? (20-100 amps at 30-100volts)

if so how would i go about it?

You simply measure the voltage drop across a low value resistor, amplifying the voltage with an opamp if required - exactly the same as you would for measuring the current with anything else!. A PIC with an A2D is basically a 0-5V voltmeter.
 
I would suggest you use a much smaller resistor or a current transformer. With your 0.5 ohm resistor, at 20A, you will be dissipating 200 watts, that will be mighty big and hot resistor.
 
Nigel Goodwin said:
You simply measure the voltage drop across a low value resistor, amplifying the voltage with an opamp if required - exactly the same as you would for measuring the current with anything else!. A PIC with an A2D is basically a 0-5V voltmeter.

ok, so let me see if i get this

so if i put a .01ohm resistor in series
and use as a voltage devider(to read with pic ADC), that will give me the resistance of my mosfet and coil

then from that i know the current

is that it?? (sorry i'm just learning)

**broken link removed**

thanks for the help :D
 
The solution depends on how much accuracy you want.

The PIC's ADC has a resolution of about 5mV, and an offset error of I think 1 or 2 codes. With a 0.01 ohm shunt, so it's about 500mA per code in the PIC's ADC.

Also note that a 0.01 ohm shunt will STILL be 100 watts at 100 amps. No simple resistor will handle this. https://www.allelectronics.com has a bunch of good shunts, but they're much lower ohms, the voltage at max current is usually 50mV. You'll need to either amplify the signal, or use an external ADC with more resolution. Amplifying the signal with an op amp adds error in the form of both gain errors from resistor tolerances, and additional offset error. External ADCs can give you far better resolutions, lower offsets, and low gain errors.
 
Just one thing

you have an opto there to provide isolation from the FET as well as drive capability to the gate of the gate. However, to use the shunt like this the GND connection of the shunt MUST be the same GND as the PIC, thus eliminating the isolation of the opto

It might be worth (for 100A) looking into a hall-effect sensor (LEM's are good). This provides you with isolation.
Also using that method a voltage will not be developed at the Source of the FET and thus raisig its voltage WRT the gate. It might not be that significant (in this case 1V at 100A) but still worth noting.

oh as far as teh current trasducers go - check out:

https://uk.farnell.com/jsp/endecaSe...Type=&comSearch=true&manufacturerDisplay=true

and specific product (£12.70)
https://www.electro-tech-online.com/custompdfs/2004/09/37259.pdf
 
Styx said:
It might be worth (for 100A) looking into a hall-effect sensor (LEM's are good). This provides you with isolation.

Hall effects are neat in that they have no insertion loss, they're not even electrically connected in there. And they're totally ground isolated.

There's a few problems though. One, they have a hysteresis issue, at least the ones I messed with did. That means, for example that after a 5 amp forward current and then turning off the current, it will read +1 amp. If it was -5 amps current, it will read -1 after being turned off. So reading currents in the low end is not possible.

Current above the rating will mess up the device by permanently magnetizing it. They're also expensive. They also usually require a dual power supply, but there's easy ways to get that due to the ground isolated nature of the device.
 
True in both cases.
But as long as you get a closed-loop Hall-effect you will get such a small hysteresis
Since in close-loop it tries to keep the flux in a core at zero. Thus the amount of Amp-Turns it needs to supply to counter the flux being measure is proportional to the current being measured.

Also you need to scale your hall sensor appropiately. If you will regually see 100A you will need a 100A hall effect and well deal with the low amp error. If however you will see 20A most of the time and only for short pulses 100A you might be able to get away with a 35 or 40A one (and rely on the peak-pulse) the 100A one I have posted can cope with 160A pulse

But extreamly true ab tthe cost. However, there is really nothing to compare to a hall sensor (esp a closed loop one) and the cost is worth it for the sensivitiy and the stability. £12 isnt reall that much if you are playing around with 100A

I would really only go for a sense resistor upto abt 20A at the most. After that hall is the only way to go
 
i realy like the 'current trasducers' idea
ordered one that works on 5volt and gives 0-4volt output(for the pics ADC)

i think that is the best bet
also ordered some .01-.005 5watt current sens resistors to try

thanks for all your help
 
don't waste your time
alegro makes what you need and it's cheap and readily available through most decent channels.
You get small, isolated sensor with range like 0-50, 0-75 or 0-100A
and output 0-5V. check this:

**broken link removed**
 
o don't wory i never wast my time :?

i ordered some samples from them

where do you shop?
mouser and digikey didn't have

i found at newark inone for $10
i'll order from there if they don't give me the samples

thanks for the help
 
Interesting. The closed loop devices I have don't get soldered into the current line at all, they have a hole through the middle.

I once wondered if I could get rid of the DC offset if I wrapped a few windings through the hole and around the side and periodically pulsed AC through it to demagnetize it. It would be controlled by the microcontroller which would be smart enough to know to only use the procedure when the current began high and then approached the hysteresis threshold, and to turn off the ADC readings while performing a demag.

Never tried it out though, I've never seen it in an app note or anything so it's just a theory. You have to be really particular about low-end readings to want to do it though.

Be SURE you get a closed loop device, or the hysteresis error is much larger. The closed loop devices are more expensive.

There's nothing different at all about using shunt resistors over 20A. You just have to get an appropriately rated shunt! They're usually designed to give 50mV at whatever the max current is. Of course, they're also sized so that they can handle the max power. 20A or 200A (and I'm using a 200A shunt on my car's deep cycle battery), it makes no difference in my choice of technology.

Actually, the Hall devices become less desirable as the hysteresis error naturally becomes larger when you select larger devices. Shunts have no such error.
 
Oznog said:
Interesting. The closed loop devices I have don't get soldered into the current line at all, they have a hole through the middle.

I once wondered if I could get rid of the DC offset if I wrapped a few windings through the hole and around the side and periodically pulsed AC through it to demagnetize it. It would be controlled by the microcontroller which would be smart enough to know to only use the procedure when the current began high and then approached the hysteresis threshold, and to turn off the ADC readings while performing a demag.

Never tried it out though, I've never seen it in an app note or anything so it's just a theory. You have to be really particular about low-end readings to want to do it though.

Be SURE you get a closed loop device, or the hysteresis error is much larger. The closed loop devices are more expensive.

There's nothing different at all about using shunt resistors over 20A. You just have to get an appropriately rated shunt! They're usually designed to give 50mV at whatever the max current is. Of course, they're also sized so that they can handle the max power. 20A or 200A (and I'm using a 200A shunt on my car's deep cycle battery), it makes no difference in my choice of technology.

Actually, the Hall devices become less desirable as the hysteresis error naturally becomes larger when you select larger devices. Shunts have no such error.

Well we all have our preferences. For me as I said would not use a shunt abt 20A. the slightest bit of inductance in teh sense resistor and the measurement goes way off. The only time I might concider using one (and only upto 50A) is if I had a well constructed coaxial-shunt. But the space such a device takes then start becoming an issue.

I have never had a problem using closed-loop hall effect (LEM are one of the best). In fact on a project that I am working on we are having to use LEM's rated to 1000A, but are lowest current level is 50A so the lowlevel measure is not a problem.

The arguesment abt accuracy in halls at low measurement current can be true with shut resistors as well. If you are measuing 1A PEAK you would probably go for a 1W 1Ohm resistor, you will then get a decent resolution fo mA readings. However as your MAX current to be measured goes up, the value of the sense resistor MUST come down to ensure you dont get excessive power loss at teh higher current - this then sacrifices the accuracy at low current levels as well.

We all have our preference. I will always prefere Analogue for a cct while others will prefer PIC's that is the beuty of engineering, there reall isn't a wrong answer, just a wrong situation
 
my sample order from allegro has been processed!
it looks like they will be sending me 4 of the 100amp sensors

i'm still getting the through hole one and the resistors(want to try them all)

thanks for all the help
 
Status
Not open for further replies.

Latest threads

Back
Top