Introduction: KiloWatthour Meter Using RoboRemo App
When my airco/heatpump was installed the app that came with it worked pretty fine ( Panasonic comfort cloud ) . Now the app is OK for controlling the system but the monitoring part fails sometimes due to server timeouts . I also have doubts about the measured kWh's , when I compare two days with almost identical outside temperatures one day results in 11kWh , the other 2kWh ...
Time for action !
Normally I use my favorite board , a Wemos D1 , and Micropython to do the job but after several tests it seemed that the D1's ADC lacked accuracy ... Even a precise peak detector circuit did not solve the problem . Google is my ( and your!) friend so I discovered this fantastic site :Open Energy Monitor . You can learn and discover , all you need is here ! And they also supply an Arduino library that works perfect :EmonLib .
I tested the sketches and modified them because the results are displayed in one of my favorite Android apps : RoboRemo . the final sketch has a built-in kWh-meter and the calibration values are adapted to the current transformer ( CT ) used . I strongly suggest to study the learn-section :
Learn section . Full of goodies ! The connection kWh-meter to AndroidPhone(Tablet) is established via a HC-05 Bluetooth-module .
-- Android phone or tablet with RoboRemo app installed
-- Arduino Uno or Nano and programming cable
--Bluetooth-module HC-05 link
-- CT ( current transformer ) Part number SCT-013-050 link
--2 resistors 10kOhm 1/4W ( different values OK , up to 470kOhm as long as they are identical)
--1 capacitor 10microFarad (16V OK)
--Breadboard for testing
--Breakoutboard for easy assembly
--USB to serial cable for programming the Bluetooth module
Step 1: Preparing the Bluetooth Module
The Bluetooth communication is done via the hardware Arduino Rx/Tx terminals @9600 baud.
So we have to prepare our module , name it and verify/adjust the baudrate . It can be done via the optional USB-serial cable and a terminal emulator (or Arduino IDE serial monitor ) . The "key" pin of the module must be pulled to Vcc and the baudrate set at 38400 . No Cable ? No Problem , this site ( in German ) explains it all : setup HC-05 Gomcu .
Name your module , check/adjust baudrate (UART 9600,0,0) and you're done !
Step 2: Installing the EmonLib in Your Arduino IDE , Uploading Sketch .
It's all here :Installing library . Restart your IDE , done :-)
load the sketch in your UNO/Nano and connect the resistors/capacitor and current transformer as seen in the schematic . CAUTION ! The sketch is modified for current transformer Part Number SCT-013-050 . The resistor parallel to the transformer in the schematic must be removed ( only 2 10kOhm and capacitor needed ) . Other CT's may be used but sketch calibration value must be adapted ( and burden resistor added in case of a "current type") .
Connect Arduino to your computer and open the serial monitor@9600 baud. Reset Arduino , see if the strings are printed in the serial monitor . The Strings are fitted for the RoboRemo interface and can be modified to the users preference ( see RoboRemo manual). Tried to upload the RoboRemo interface but it causes server error ... Anyway sending data to RoboRemo is simple : make a string containing ID + String(Values) +\n , that's all . Commands from RoboRemo are strings ended with \n.
Update feb 29 2019 : I modified the sketch a little , due to Arduino ADC resolution even a shorted input gave .55Amps or approx 100Watts . So all currents under 0.55Amps are cut down to zero .
The new file is version 1.3
Step 3: Caution ! High Voltage !
Installing the CT is very well explained here . Take care , High Voltage !
Connect the Bluetooth module to the Arduino : 5V to Vcc , GND to GND Rx to Tx , Tx to Rx .
Arduino must be powered by a 5V supply , not via USB !
pair bluetooth module with phone/tablet , launch app and you have a nice kWhmeter !