a bit of this-and-that on electronics

Menu

Monthly Archives:
June 2014

Continuing the series on examining devices to measure AC current, this time we’ll try out the CS5464 from Cirrus Logic. I initially built it up on a breadboard, but I’ll skip writing up this test and instead build up a prototype and run AC line power through it.

This is a Three-channel, Single-phase Power/Energy monitoring chip, and also can use current shunts and is intended for power meters.

This device provides no direct isolation, instead the entire device (input and output) directly coupled to the AC power line. Any isolation must be provided separately.

Measure instantaneous current from 0 to 10 Amps, with 0.5 Amp accuracy

Detect low current and overcurrent conditions

Stretch goal: identify surges during load switching

The CS5464 chip is really a standalone ASIC device that reads multiple ADC inputs and tracks the values on its own without external intervention.
It has a built-in voltage reference, and temperature sensor for automatic compensation.
It simultaneously tracks a variety of values for each channel, including:

Instantaneous Current

Instantaneous Voltage

Instantaneous Power

Active Power Channel

RMS Current Channel

RMS Voltage Channel

That’s just fantastic for my purposes!

This device should meet the goals of identifying brownouts, voltage spikes, and current surges without lots of reads or external processing. It should really lower the demands on the main microcontroller, allowing the core processor to focus on control and reporting functions… it should only need to ping the CS5464 occasionally to get the necessary data.

The CS5464 does indeed have a lot of functionality, but it also comes with a lot more complexity, it requires being reset properly after power-up and various configuration commands before you can get the data you’re after.

Cirrus application note

Prototyping with the CS5464 device can be quite simple, if you just want to simulate the AC power/current flowing through a small shunt using a function generator or other safe, low-voltage source.

But, if you want to use it safely with non-isolated AC line voltage, in a real-world situation, then it gets a little more complex.

To provide some margin of safety, I have separated the CS5464 measurement device from the microcontroller (here it’s an Arduino), using the ADuM41xx series galvanic digital isolators from Analog Devices.

But, the CS5464 and the “line side” of the couplers need power… This could be provided by a non-isolated capacitive drop approach, like this one in the application notes:

But, since I already have nice clean power for my microcontroller, I can just use a 5010 Iso-Power device. It’s small and needs few components.

Here’s the test setup:

Even if I have to power all 8 channels on the ADum7441 devices, the total power will be 25ma, which should be okay for the IsoPower chip to run.

Here’s the prototype, built up on perfboard. Sections of the board are marked:Redis the AC input/shunt sectionGreenindicates the isolated, low voltage section that connects to the microcontroller
The unmarked area is logic-level signalling, but is tied directly to the AC line (no isolation)

Testing

I tested the prototype board measuring AC (line) current using a set of 150W lamps.

The test load is connected to the AC power and shunt via the IEC plug that is broken out to insulated spade connectors.

Test Results:

Input

(Amps)

Shunt Reading

(mV)

Counts

Counts, less

395 offset

Counts

per Amp

0

0.045

395

1.21

12.155

2444

2049

1693

2.41

24.152

4488

4093

1698

3.58

35.96

6500

6105

1705

The results are very linear, with only a little, steady increase in counts as the current rose. This could have been caused by thermal drift as the shunt warmed up under load.
Here’s some sample code for working with the CS5464. This code is not really my own, as much of it is a collection of snippets that I came across. I’ll see if I can find the original sources and reference those.

Measure instantaneous current from 0 to 10 Amps, with 0.5 Amp accuracy

Detect low current and overcurrent conditions

Stretch goal: identify surges during load switching

Constraints…

Size, I have some flexibility but an initial goal is to have the power and logic boards fit into a 4” x 8” space.

Standard U.S. single phase AC power

will be installed outdoors in an IP-67 enclosure

I have some aversion to messing with AC line voltage, and generally I work with little more than TTL levels. So, I opted for an isolated approach, that is: the AC line voltages are completely separated from the microcontroller and other logic.

This will allow me to have the AC sensing circuitry on a separate board allowing me to poke and prod the microcontroller without concern of any shock hazard.

Here’s a typical setup for the hall-effect sensor, and here’s a breakout board mounted in an enclosure to make using it on the bench with AC line voltage a bit safer.

{insert picture of ACS756 breakout}

I initially tested it out using a heavy DC power supply and load… it worked fine, was moderately accurate, and simple.

Results:

usable, but not great…

Test Results:

{ put in table here }

For AC current tests the system configuration is

Test Results:

… the results were a mess… random numbers all over the place!

Why?

When no current is flowing through the ACS756, the output is about 2.5V.

When we run positive current (the + output of the line is connected to the + on the ACS756), the output of the sensor goes up.

If we run negative current (the – output of the line is connected to the + on the ACS756), the output of the sensor goes down.

In this test we ran alternating current through the device, causing the ACS756 to provide a sine wave like output.

The readings were somewhat random, as it depended on where in the wave the Arduino took the sample.

{ put in table here }

I did try using a peak detector circuit. That helped, but the results were non-linear and it was really going to complicate things.