Chip-cn-dat/HLW-dat/HLW8012-dat/2023-10-24-12-28-02.png
... ...
Binary files /dev/null and b/Chip-cn-dat/HLW-dat/HLW8012-dat/2023-10-24-12-28-02.png differ
Chip-cn-dat/HLW-dat/HLW8012-dat/2024-08-05-17-18-12.png
... ...
Binary files /dev/null and b/Chip-cn-dat/HLW-dat/HLW8012-dat/2024-08-05-17-18-12.png differ
Chip-cn-dat/HLW-dat/HLW8012-dat/2024-08-05-17-20-03.png
... ...
Binary files /dev/null and b/Chip-cn-dat/HLW-dat/HLW8012-dat/2024-08-05-17-20-03.png differ
Chip-cn-dat/HLW-dat/HLW8012-dat/HLW8012-HLW-REV1.3.pdf
... ...
Binary files /dev/null and b/Chip-cn-dat/HLW-dat/HLW8012-dat/HLW8012-HLW-REV1.3.pdf differ
Chip-cn-dat/HLW-dat/HLW8012-dat/HLW8012-dat.md
... ...
@@ -0,0 +1,82 @@
1
+
2
+# HLW8012-dat
3
+
4
+- [legacy wiki page ](https://w.electrodragon.com/w/HLW8012)
5
+
6
+## Chip Info
7
+
8
+![](2024-08-05-17-18-12.png)
9
+
10
+### Hardware Design Note
11
+* Board AC Mains is be NOT isolated.
12
+* Better use optical-coupler to send isolated signal to your MCU.
13
+* MCU better use seperated power supply to HLW8012.
14
+
15
+#### other note
16
+* Built-in crystal, 2.43V voltage reference source and power monitoring circuit
17
+* 5V single power supply, operating current less than 3mA
18
+
19
+## Application
20
+
21
+![](2024-08-05-17-20-03.png)
22
+
23
+As shown in Figure 3, the power supply the HLW8012 should be in parallel with two small capacitors to filter out the noise from the grid.
24
+
25
+- The signal of current channel is provided by the current diverter.
26
+- The signal of voltage channel is provided by the resistor network.
27
+
28
+CF, CF1, SEL connect to the input port of the MCU. MCU measure the pulse periods of CF and CF1, then calculate the active power, current RMS and voltageRMS
29
+
30
+
31
+#### Sample resistor
32
+
33
+* Sample Resistor is 0.002R, 2mR (diameter 2.5mm, rate current is 20A. space is 10mm, height 7.5mm, "door" shape).
34
+
35
+
36
+## Calculatoin
37
+
38
+![](2023-10-24-12-28-02.png)
39
+
40
+
41
+
42
+ F_cf = (V1xV2x48)/(V_ref)^2 x (F_osc/128)
43
+ F_cf1 = (V1x24)/(V_ref) x (F_osc/512)
44
+ F_cfu = (V2x2)/V_ref x (F_osc/512)
45
+
46
+Note
47
+
48
+* Fcf = Power, Fcf1 = current, Fcfu = voltage
49
+* V1: Voltage signal on the current channel pin
50
+* V2: Voltage signal on voltage channel pin
51
+* Fosc: built-in crystal, the typical frequency of about 3.579MHz;
52
+* Vref: built-in reference source, the typical voltage is 2.43V
53
+
54
+## Use with ESP8266
55
+
56
+* The demo code will monitoring the power, current, voltage and frequency, you can monitor it via telnet to see remote debug output, same as serial output, but safe when AC main power connected.
57
+* Pin definition to esp8266 please see the comments in sketch
58
+* Also can calibrate the parameters, see the comments in sketch
59
+* Enter SSID and password in the sketch, run the demo code first to see IP address
60
+* Connect to AC main power, login remotely via telnet, in windows for example, command: telnet 192.168.0.100
61
+
62
+* [Demo code here](https://github.com/Edragon/esp8266_arduino/tree/master/HLW8012/remote_debug)
63
+
64
+
65
+## Demo
66
+
67
+https://www.youtube.com/watch?v=0aiuwRB8Uic
68
+
69
+
70
+## DS
71
+
72
+- [[HLW8012-HLW-REV1.3.pdf]]
73
+
74
+
75
+
76
+## ref
77
+
78
+- [[HLW8012-dat]] - [[HLW8032-dat]] - [[HLW-dat]] - [[ac-mains-dat]] - [[power-meter-dat]]
79
+
80
+Boards - [[OPM1126-dat]]
81
+
82
+- [[OPM1126]]
... ...
\ No newline at end of file
Chip-cn-dat/HLW-dat/HLW8032-dat/2023-11-01-18-24-07.png
... ...
Binary files /dev/null and b/Chip-cn-dat/HLW-dat/HLW8032-dat/2023-11-01-18-24-07.png differ
Chip-cn-dat/HLW-dat/HLW8032-dat/HLW8032-DAT.md
... ...
@@ -0,0 +1,40 @@
1
+# HLW8032 DAT
2
+
3
+- [[SVC1031-dat]] - [[SVC1035-dat]]
4
+
5
+## Chip Info
6
+
7
+- The HLW8032 is a high precision energy metering IC that uses a CMOS manufacturing process and is primarily intended for single phase applications. It can measure line voltage and current, and can calculate active power, apparent power and power factor.
8
+- The device integrates two ∑-Δ ADCs and a high-precision energy metering core. The HLW8032 can communicate data through the UART port. The HLW8032 uses a 5V supply, a built-in 3.579M crystal, and an 8PIN SOP package.
9
+- The HLW8032 has the advantages of high precision, low power consumption, high reliability and strong adaptability to the environment. It is suitable for energy metering of single-phase two-wire power users.
10
+
11
+## Hex Read
12
+
13
+ F2 5A 02 DC D0 04 C8 20 00 3E 4E 03 7C A6 4E 2B B8 B9 8A BB 61 00 01 DC
14
+
15
+ seperated: F2 | 5A | 02 DC D0 | 04 C8 20 | 00 3E 4E | 03 7C A6 | 4E 2B B8 | B9 8A BB | 61 | 00 01 | DC
16
+
17
+ convert to int: 85 90 2 220 208 4 134 64 0 62 78 4 25 218 78 43 184 235 216 59 97 0 0 139
18
+
19
+| | hex | dec / int |
20
+| -------------------------- | -------- | ---------- |
21
+| start | F2 | 242 |
22
+| Check register | 5A | 90 |
23
+| Voltage parameter register | 02 DC D0 | 2 220 208 |
24
+| Voltage register | 04 C8 20 | 4 134 64 |
25
+| Current parameter register | 00 3E 4E | 0 62 78 |
26
+| Current register | 03 7C A6 | 3 124 166 |
27
+| Power parameter register | 4E 2B B8 | 78 43 184 |
28
+| Power register | B9 8A BB | 235 216 59 |
29
+| Data updata register | 61 | 97 |
30
+| PF register | 00 01 | 0 1 |
31
+| CheckSum register | DC | 139 |
32
+
33
+
34
+## Applications
35
+
36
+![](2023-11-01-18-24-07.png)
37
+
38
+## ref
39
+
40
+- [[HLW8032.pdf]]
Chip-cn-dat/HLW-dat/HLW8032-dat/HLW8032.pdf
... ...
Binary files /dev/null and b/Chip-cn-dat/HLW-dat/HLW8032-dat/HLW8032.pdf differ
Chip-cn-dat/HLW-dat/hex2int.py
... ...
@@ -0,0 +1,11 @@
1
+
2
+
3
+def convert_hex_to_int(hex_value):
4
+ bytes = [int(hex_value[i:i+2], 16) for i in range(0, len(hex_value), 2)]
5
+ int_value = bytes[0] << 16 | bytes[1] << 8 | bytes[2]
6
+ return int_value
7
+
8
+hex_value = "02 DC D0"
9
+int_value = convert_hex_to_int(hex_value)
10
+print(int_value)
11
+
Chip-cn-dat/HLW-dat/hlw-dat.md
... ...
@@ -0,0 +1,16 @@
1
+# hlw-dat
2
+
3
+| ! chip | Sensing | Size | Calibration | COMM | Other |
4
+| ------- | ----------------------- | ------- | ----------- | -------- | ---------------------------- |
5
+| HLW8112 | 2x current / 1x voltage | SSOP16 | No need | SPI/UART | OV / LV / Zeor-crossing / OC |
6
+| HLW8032 | Example | Example | | | |
7
+| HLW8012 | Example | Example | | | |
8
+
9
+- http://www.hiliwi.com
10
+
11
+* [[HLW8012-dat]] - [[HLW8032-dat]]
12
+
13
+
14
+## ref
15
+
16
+- [[HLW]]
... ...
\ No newline at end of file
Chip-cn-dat/HLW-dat/test2.py
... ...
@@ -0,0 +1,3 @@
1
+hex_val = '02dcd0'
2
+
3
+print(int(hex_val, 16))
... ...
\ No newline at end of file
Chip-cn-dat/HLW-dat/test3.py
... ...
@@ -0,0 +1,5 @@
1
+
2
+
3
+cal = 2 * 16 * 16 + 220 * 16 + 208
4
+
5
+print (cal)
... ...
\ No newline at end of file
Chip-cn-dat/HLW/HLW8012-dat/2023-10-24-12-28-02.png
... ...
Binary files a/Chip-cn-dat/HLW/HLW8012-dat/2023-10-24-12-28-02.png and /dev/null differ
Chip-cn-dat/HLW/HLW8012-dat/HLW8012-HLW-REV1.3.pdf
... ...
Binary files a/Chip-cn-dat/HLW/HLW8012-dat/HLW8012-HLW-REV1.3.pdf and /dev/null differ
Chip-cn-dat/HLW/HLW8012-dat/HLW8012-dat.md
... ...
@@ -1,67 +0,0 @@
1
-
2
-# HLW8012-dat
3
-
4
-- [legacy wiki page ](https://w.electrodragon.com/w/HLW8012)
5
-
6
-
7
-### Hardware Design Note
8
-* Board AC Mains is be NOT isolated.
9
-* Better use optical-coupler to send isolated signal to your MCU.
10
-* MCU better use seperated power supply to HLW8012.
11
-
12
-#### other note
13
-* Built-in crystal, 2.43V voltage reference source and power monitoring circuit
14
-* 5V single power supply, operating current less than 3mA
15
-
16
-#### Sample resistor
17
-
18
-* Sample Resistor is 0.002R, 2mR (diameter 2.5mm, rate current is 20A. space is 10mm, height 7.5mm, "door" shape).
19
-
20
-
21
-## Calculatoin
22
-
23
-![](2023-10-24-12-28-02.png)
24
-
25
-
26
-
27
- F_cf = (V1xV2x48)/(V_ref)^2 x (F_osc/128)
28
- F_cf1 = (V1x24)/(V_ref) x (F_osc/512)
29
- F_cfu = (V2x2)/V_ref x (F_osc/512)
30
-
31
-Note
32
-
33
-* Fcf = Power, Fcf1 = current, Fcfu = voltage
34
-* V1: Voltage signal on the current channel pin
35
-* V2: Voltage signal on voltage channel pin
36
-* Fosc: built-in crystal, the typical frequency of about 3.579MHz;
37
-* Vref: built-in reference source, the typical voltage is 2.43V
38
-
39
-## Use with ESP8266
40
-
41
-* The demo code will monitoring the power, current, voltage and frequency, you can monitor it via telnet to see remote debug output, same as serial output, but safe when AC main power connected.
42
-* Pin definition to esp8266 please see the comments in sketch
43
-* Also can calibrate the parameters, see the comments in sketch
44
-* Enter SSID and password in the sketch, run the demo code first to see IP address
45
-* Connect to AC main power, login remotely via telnet, in windows for example, command: telnet 192.168.0.100
46
-
47
-* [Demo code here](https://github.com/Edragon/esp8266_arduino/tree/master/HLW8012/remote_debug)
48
-
49
-
50
-## Demo
51
-
52
-https://www.youtube.com/watch?v=0aiuwRB8Uic
53
-
54
-
55
-## DS
56
-
57
-- [[HLW8012-HLW-REV1.3.pdf]]
58
-
59
-
60
-
61
-## ref
62
-
63
-- [[HLW8012-dat]] - [[HLW8032-dat]] - [[HLW-dat]] - [[ac-mains-dat]] - [[power-meter-dat]]
64
-
65
-Boards - [[OPM1126-dat]]
66
-
67
-- [[OPM1126]]
... ...
\ No newline at end of file
Chip-cn-dat/HLW/HLW8032-dat/2023-11-01-18-24-07.png
... ...
Binary files a/Chip-cn-dat/HLW/HLW8032-dat/2023-11-01-18-24-07.png and /dev/null differ
Chip-cn-dat/HLW/HLW8032-dat/HLW8032-DAT.md
... ...
@@ -1,40 +0,0 @@
1
-# HLW8032 DAT
2
-
3
-- [[SVC1031-dat]] - [[SVC1035-dat]]
4
-
5
-## Chip Info
6
-
7
-- The HLW8032 is a high precision energy metering IC that uses a CMOS manufacturing process and is primarily intended for single phase applications. It can measure line voltage and current, and can calculate active power, apparent power and power factor.
8
-- The device integrates two ∑-Δ ADCs and a high-precision energy metering core. The HLW8032 can communicate data through the UART port. The HLW8032 uses a 5V supply, a built-in 3.579M crystal, and an 8PIN SOP package.
9
-- The HLW8032 has the advantages of high precision, low power consumption, high reliability and strong adaptability to the environment. It is suitable for energy metering of single-phase two-wire power users.
10
-
11
-## Hex Read
12
-
13
- F2 5A 02 DC D0 04 C8 20 00 3E 4E 03 7C A6 4E 2B B8 B9 8A BB 61 00 01 DC
14
-
15
- seperated: F2 | 5A | 02 DC D0 | 04 C8 20 | 00 3E 4E | 03 7C A6 | 4E 2B B8 | B9 8A BB | 61 | 00 01 | DC
16
-
17
- convert to int: 85 90 2 220 208 4 134 64 0 62 78 4 25 218 78 43 184 235 216 59 97 0 0 139
18
-
19
-| | hex | dec / int |
20
-| -------------------------- | -------- | ---------- |
21
-| start | F2 | 242 |
22
-| Check register | 5A | 90 |
23
-| Voltage parameter register | 02 DC D0 | 2 220 208 |
24
-| Voltage register | 04 C8 20 | 4 134 64 |
25
-| Current parameter register | 00 3E 4E | 0 62 78 |
26
-| Current register | 03 7C A6 | 3 124 166 |
27
-| Power parameter register | 4E 2B B8 | 78 43 184 |
28
-| Power register | B9 8A BB | 235 216 59 |
29
-| Data updata register | 61 | 97 |
30
-| PF register | 00 01 | 0 1 |
31
-| CheckSum register | DC | 139 |
32
-
33
-
34
-## Applications
35
-
36
-![](2023-11-01-18-24-07.png)
37
-
38
-## ref
39
-
40
-- [[HLW8032.pdf]]
Chip-cn-dat/HLW/HLW8032-dat/HLW8032.pdf
... ...
Binary files a/Chip-cn-dat/HLW/HLW8032-dat/HLW8032.pdf and /dev/null differ
Chip-cn-dat/HLW/hex2int.py
... ...
@@ -1,11 +0,0 @@
1
-
2
-
3
-def convert_hex_to_int(hex_value):
4
- bytes = [int(hex_value[i:i+2], 16) for i in range(0, len(hex_value), 2)]
5
- int_value = bytes[0] << 16 | bytes[1] << 8 | bytes[2]
6
- return int_value
7
-
8
-hex_value = "02 DC D0"
9
-int_value = convert_hex_to_int(hex_value)
10
-print(int_value)
11
-
Chip-cn-dat/HLW/hlw-dat.md
... ...
@@ -1,11 +0,0 @@
1
-# hlw-dat
2
-
3
-| ! chip | Sensing | Size | Calibration | COMM | Other |
4
-| ------- | ----------------------- | ------- | ----------- | -------- | ---------------------------- |
5
-| HLW8112 | 2x current / 1x voltage | SSOP16 | No need | SPI/UART | OV / LV / Zeor-crossing / OC |
6
-| HLW8032 | Example | Example | | | |
7
-| HLW8012 | Example | Example | | | |
8
-
9
-- http://www.hiliwi.com
10
-
11
-* [[HLW8012-dat]] - [[HLW8032-dat]]
Chip-cn-dat/HLW/test2.py
... ...
@@ -1,3 +0,0 @@
1
-hex_val = '02dcd0'
2
-
3
-print(int(hex_val, 16))
... ...
\ No newline at end of file
Chip-cn-dat/HLW/test3.py
... ...
@@ -1,5 +0,0 @@
1
-
2
-
3
-cal = 2 * 16 * 16 + 220 * 16 + 208
4
-
5
-print (cal)
... ...
\ No newline at end of file