This project reflects the second stage of work with the Prototype of Current Clamp with accounting and triggering capabilities.
ACCM ConceptsSinusoidal currents inside electric cables produce a variable and also sinusoidal electromagnetic field. Thanks to the electrical induction physical property, the sct013 sensor (a copper coil and a resistor in parallel) produces a voltage as output which is related to the fluctuations of the electromagnetic fields around the wire going through the sct013 clamp.
Then, based on user frequency settings, the software will try to catch analog sample of data of exactly a period. It will then calculate min and max values over the period and the effective value of the sct013 output and then convert it into a current value (conversion ratio depends of sct013 model).
Final work consist in energy accounting (kWh) and triggering amount of energy used (Wh) or money spent (€) in order to produce an action : the prototype produces a blue led flash.
ACCMv2 FeaturesSmall OLED Display to report to end-user
Fast and fine autocalibration process end-user can launch any time
4 individual SCT lines monitored
Group or Single view (current, power, accounting, budget, noise)
Freq range : 0-500Hz (16 points at 500Hz, 160 points at 50Hz)
Detect power on the lines (red led)
Count user defined energy amount (in Wh) or bill amount (blue led)
Power consumption : 0.25W/h (0.05A)
ACCMv2 Cost killing circuitIn regards of the early prototype of ACCM and its v1 shield for which you'll find some photos, there was a lot of resistors for each SCT lines (vcc dividers to raise up the signals) and resistors for leds and buttons.
There were some interesting technical improvements compared to the original circuit with the ACCM Shield v2 :
- almost all resistors are gone (except for leds) : button can use internal pullup resistor of the Arduino UNO board and if we don't raise up signals of the SCT sensors, it just mean we have to double max value to find original signal amplitude with the great advantage to raise up by 100% the SCT range capabilities of sensors (see Circuit limits section).
- button have been reduced to one piece (playing with multiple way to call for instructions with a single button : short, long, very long, double press)
The Arduino circuit is 5V (using USB power line), centering the sinusoidal signal at 0V allows a max value of 5V also for the sinusoidal signal (3.54V effective). It means this circuit will only allow the following ranges of power, depending of the probe model :
- sct013 1V/10A: 0.1-35.4A
- sct013 1V/30A: 0.3-105.6A
- sct013 1V/60A: 0.6-211.2A
- sct013 1V/100A: 1-340A
Note that if you choose to power your board with Vin or with the regular power entry of the board you can also extend sensors ranges capabilities, just pay attention to the max current the circuit will require if you increase input voltage.
ACCMv2 Software improvementsThere was a couple of things that have been improved in ACCMv2 compared to the prototype application.
A very basic performance add-on was to completely leave the micros() call and only work with millis() to measure time within the application. This is a well known fix.
Main part of improvements concerns data acquisition over a period. While we loose the capability to store all measured point with timestamp index (too much memory required for that feature), using operator overriding on a C++ object class allowed to maintain data acquisition frequency around 8kHz and also to calculate and store min,max,sum,count of a value. Please consult value.h and value.cpp files to look up on this point.
The eZButton object class has been extended to provide new output values depending the way end-users interact with the button : short, long, very long and double press. You may have a look to this there : appButton.h and appButton.cpp.
Some idea was found try build an uptime counter to report about application uptime to end-user (timer.h and timer.cpp).
ACCMv2 Software limitsAvailable memory running the application is actually the main focus to try to switch to a very stable release of the software. Final works will consist in making the code more efficient and optimize running memory usage.
One identified source of high memory usage is String() object concatenation. This is still massively used in the application and may be first step to try improve memory usage.
Comments