Home power-line load monitor based on LM
Example: Home power-line load monitor based on LogicMachine Reactor
Task
How to make cost-effective power-line current monitor solution based on LogicMachine Reactor?
Connect current sensor with analog output to Reactor’s Analog input
We recommend Veris Industries H923 split-core current sensor which provides accurate load trending information with a proportional output signal. Or there are even more cost-effective 0-5V solution available from YHCD (~EUR 4/pcs).
Add Analog input object in Reactor tab of LogicMachine2
The measurement is automatically seen in Reactor tab as well as Objects tab
Calculate the Amps of flow
As the analog input will show the value in Volts, you have to calculate real Amps of the load, also calculate average Amps per hour.
Click on the Event-based script icon on the respective Analog input channel line
Add the following code, which will update the object 1/1/3 once an hour with average load in Amps
- amps = event.getvalue() * 3 -- max current device supports is 30A, Analog input is 0..10V, so 30A/10V = 3A = 1V
- avg = storage.get('avg', {}) -- array of variables
- table.insert(avg, amps)
-
- if #avg == 60 then -- reading is done once in a minute so we have to record 60 readings to calculate average
- total = 0
- for _, value in ipairs(avg) do -- summarize all reading to calculate average
- total = total + value
- end
-
- average = total / 60
- grp.update('1/1/3', average)
-
- avg = {}
- end
-
- storage.set('avg', avg)