Open superman7886 opened 3 years ago
Did this work for you afterwards? I'm also seeing occasionally every 30 secs, Voltage and Current values are Crazy ~ Volgate around ~12340 (jump from 226-230) and Current ~426 (jump from 0.3 A)
I have also use 20W blub with 204AC but the values are wired. look at the picture. There are some reading with zero values.
I have also use 20W blub with 204AC but the values are wired. look at the picture. There are some reading with zero values.
Hello, the readings as per load are ok but this is due to toggling of Voltage and Current reading pin, From the Reading pin of IC Voltage readings are available when it is high and Current readings are available when it is low( or maybe vice versa pls check it in datasheet). So you have to make an if loop based on which you will get the readings of both voltage and current readings simultaneously.
Other issue i can spot is. If you are using 20W lamp then there is problem in calibration of your load, because power factor should be unity or 1.
hello @xoseperez i am trying your code in my project for measuring current, voltage power and power factor but somehow it is not working properly or i am unable to ride it properly i am using the code from basic.ino hlw8012 please help.At no load it is giving me readings like Voltage = 0, 480,36000, 0,75... similar to current and power
define SERIAL_BAUDRATE 115200
// GPIOs
define RELAY_PIN 12
define SEL_PIN 5
define CF1_PIN 13
define CF_PIN 14
// Check values every 2 seconds
define UPDATE_TIME 2000
// Set SEL_PIN to HIGH to sample current // This is the case for Itead's Sonoff POW, where a // the SEL_PIN drives a transistor that pulls down // the SEL pin in the HLW8012 when closed
define CURRENT_MODE HIGH
// These are the nominal values for the resistors in the circuit
define CURRENT_RESISTOR 0.001
define VOLTAGE_RESISTOR_UPSTREAM ( 5 * 470000 ) // Real: 2280k
define VOLTAGE_RESISTOR_DOWNSTREAM ( 1000 ) // Real 1.009k
HLW8012 hlw8012;
void unblockingDelay(unsigned long mseconds) { unsigned long timeout = millis(); while ((millis() - timeout) < mseconds) delay(1); }
void calibrate() {
}
void setup() {
}
void loop() {
}
it's not only that i have taken no load readings i also connected 20W bulb to it and then got weird readings. PLEASE HELP