Author Topic: Isolated Current Measurement  (Read 4288 times)

0 Members and 1 Guest are viewing this topic.

Offline joegtpTopic starter

  • Contributor
  • Posts: 30
Isolated Current Measurement
« on: May 08, 2011, 12:14:08 pm »
I'm trying to build a device that can check if a device is on or not by looking at the current on the AC plug. I can do this using a clamp amp meter, but now I want to make it cheaper and hook it up to a microcontroller. I know you can buy these hall effect clamp on type sensors but they seem to be quite expensive. I also don't need that kind of accuracy, I would be good with the closest 0.5-1 amps. Does anyone have any idea how to do this on the cheap?

I read an article saying magnetoresistive sensors might be an option but I can't seem to find them.

I'm guessing this is just a terminology problem and if I had the right words to search on I could find them.
 

alm

  • Guest
Re: Isolated Current Measurement
« Reply #1 on: May 08, 2011, 12:22:58 pm »
You only need a Hall sensor if you want to measure DC current. For AC current, you should be fine with just a current transformer (same principle as cheap AC-only clamp meters). My guess is that these will be cheaper.
 

Offline scrat

  • Frequent Contributor
  • **
  • Posts: 608
  • Country: it
Re: Isolated Current Measurement
« Reply #2 on: May 08, 2011, 08:54:58 pm »
I see you need AC measuring.
IMO, the choice depends on wether or not you admit using a series connection, or if the device has to be something similar to a clamp (i.e. not interrupting the AC cable), then accuracy vs. range is the other factor.

In the case series connection is not allowed, a Hall sensor might be the simplest solution, although a transformer-like solution (maybe diy) could be viable, but will need some experimenting.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. - Elbert Hubbard
 

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 801
  • Country: gb
Re: Isolated Current Measurement
« Reply #3 on: May 09, 2011, 01:25:34 am »
Try LEM current sensors.  http://www.lem.com/hq/en/component/option,com_catalog/task,displayserie/serie,LTS%20-%20LTSR%20-%20LTSP/output_type,/
They are isolated.

Allegro also makes some hall sensor based ICs for current measurements.
« Last Edit: May 09, 2011, 01:28:01 am by Leo Bodnar »
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: Isolated Current Measurement
« Reply #4 on: May 09, 2011, 05:32:46 am »
I recently built (for fun) a current monitoring system for a large computer gaming LAN.
40x $15 current sensors was just too expensive so i built my own.

At the lan we had every 6-way powerboard modded to have a tiny home-built current transformer around the neutral wire and a one-transistor amplifier inside. All powerboards were cabled to a few external boxes, each containing one mcu (one box could monitor 12 boards using it's built in adc channels). All the boxes were connected together with daisy chained differential SPI to a master mcu which connected to a PC over rs232. The PC displayed the power usage for the entire lan on the projector.

The mcu's were programed to do RMS calculations on all adc channels and store the results ready to be sent back to the master mcu and PC when next polled. The PC was in charge of applying a correction formula to correct for the sensors not being totally linear. The PC also produced nice eye candy 3D graphs which were displayed on the projector at the lan showing the power usage of each powerboard.
They mcu's were also able to send a raw 200point current waveform plots for each powerboard, just for extra eye candy to display.

The current monitoring was done using the cheapest method i could find, as it was only really done for fun. I didn't care too much how accurate it was. After a few tests with different ideas i found the cheapest way was to just wind my own tiny current transformers.
NOTE: This isn't the quickest way, it in-fact takes ages to wind toroids, it's just the cheapest if you have time
You also have to be aware of safety, i was very careful to keep my power monitoring system isolated and it only ever came in contact with the neutral wire and never phase.)

After testing a few types of small toroid cores that i found available for cheap from the local surplus store i settled on a core that seemed to work the best using around 260cm of AWG33 . I'm not sure what type of core it is, it's probably the wrong core for the job, but it worked well enough once you applied a correction to the response. I built a small one transistor amplifier to go with each core since the output of 50mV=10A was too small to travel 20meters to the mcu by itself. This amplified the AC current signal to around +/-2V at 10A


The amp was powered remotely by 24V at the mcu end (pulled to ~12v by the transistor at the sensor end).
The same two power wires were used to transfer the analog current signal to the mcu as +/-2V on top of the 12V DC on the cable.
Here is how it was connected up.



Because the mcu rectified the 10bit adc data in software half the 1->1024 range was lost and the signal ends up 1->512 fully rectified.
The (value^2) was totaled up for 4096 samples and then shifted right by 12 to do a binary divide by 4096. Resulting in a rms value.

NOTE: I was unable to apply the formula to correct the sensor non-linearity before the RMS calculation was done due to it being too complex for a 8bit mcu to do fast enough to keep up with 100's of samples every waveform at 50Hz. I'm aware that this is wrong and that it negatively affected the accuracy. The sensor should have been corrected first but i couldn't get the code fast enough.

The correction for the sensor non-linearity ended up being applied by the computer to the rms value later on.
To get it as accurate as possible i recorded rms readings using many pure resistive loads from 0->10A as well as many computers for non-resistive loads. Both times recording the RMS value from the mcu's and the RMS value from my true rms DMM.

The line labeled FUNCTION below is the formula that i ended up using to try and correct for the sensor non-linearity in the rms value obtained.
As you can see there is a difference between the RMS resistive value and RMS non-resistive value of about 200mA from the Function line.
This accuracy was fine for my purposes



And some tests after the correction was applied to confirm linearity and accuracy...



So that was pretty much it, its not pretty, but it worked really well for its purpose.


« Last Edit: May 09, 2011, 06:15:19 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf