2805 views|3 replies

7

Posts

1

Resources
The OP
 

Smart Electricity Meter [Copy link]

1. Introduction

The smart electricity meter digital electricity metering module can measure the current voltage, current, active power, reactive power and other data in real time by connecting this module to the home power grid. The html server is built using Raspberry Pi to push the electricity consumption to the web page for display, and the cumulative electricity consumption is recorded under Raspberry Pi.

2. Principle Introduction

2.1 Digital Electricity Metering Module

The measurement module uses a professional metering chip to accurately measure voltage, current, active power, and accumulated power information. It has been calibrated at the factory and does not require user calibration.

The output result of the module is output through the serial port with TTL level.

2.2 GD32E231

This project uses the serial port function of GD32E231 to read the power meter module and convert the data. The communication format is as follows

Serial number

Function

Head

Data 1-Data 5

Sum

1

Voltage

B0

C0 A8 01 01 00 ( computer sends a request to read voltage value )

1A

A0

0 0 E6 02 00 00 ( the meter reply voltage value is 230.2V)

88

2

Current

B1

C0 A8 01 01 00 ( computer sends a request to read the current value )

1B

A1

00 11 20 00 00 ( The meter returns a current value of 17.32A)

D2

3

Active Power

B2

C0 A8 01 01 00 (computer sends a request to read active power)

1C

A2

08 98 00 00 00 (The meter replies that the active power value is 2200w )

42

4

Reading power

B 3

C0 A8 01 01 00 (computer sends a request to read the power value)

1D

A 3

01 86 9f 00 00 ( The meter returns the power value to 99999wh)

C9

5

Set the module address

B4

C0 A8 01 01 00 (the computer sends a request to set the address, the address is 192.168.1.1)

1E

A4

00 00 00 00 00 (indicates that the address setting is successful)

A4

6

Set the power alarm value

B5

C0 A8 01 01 14 (The computer sends a command to set the power alarm value)

33

A5

00 00 00 00 00 (Indicates that the power alarm value is set successfully)

A5

Table 1 Communication protocol

Communication protocol example

③Read the current voltage

Send command: B0 C0 A8 01 01 00 1A

Reply data: A0 00 E6 02 00 00 88

Note: The reply voltage data is D1D2D3=00 E6 02 , 00 E6 represents the integer of the voltage, 02 represents the decimal of the voltage, the decimal of the voltage is 1 , 00 E6 is converted to decimal as 230 ; 02 is converted to decimal as 2 , so the current voltage value is 230.2V .

GD32 sends instructions to the metering module to read voltage, current, power and electricity in turn. After receiving the instructions, the metering module sends the results in hex format to GD32, and gd32 converts the received information.

2.3 Raspberry Pi

The Raspberry Pi stores the information sent by gd32 in the sqlite database

Raspberry Pi runs flask and websocket.

The front-end code will periodically request data from the back-end program through ws. After receiving the request, the back-end will remove the latest results from the database and send them to the front-end.

The front-end code uses the echarts framework to draw a straight line graph

3. Source code

链接已隐藏,如需查看请登录或者注册

4. Demonstration

5. Documentation

smartpower.docx (511.91 KB, downloads: 11)

See the attached video

智能电量计量器.mp4

2.01 MB, downloads: 0

This post is from GD32 MCU

Latest reply

OP, I saw the document you sent. Warm reminder, you also need to submit a video demonstration of your work. You can upload the video to the University Hall: https://training.eeworld.com.cn/course/upcourse * _ *   Details Published on 2019-6-20 21:47
 

824

Posts

190

Resources
2
 

OP, don't forget to submit a video demonstration of your work below the post. I saw that you have sent a document. You can upload the video to the University Hall: https://training.eeworld.com.cn/course/upcourse

This post is from GD32 MCU
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
Personal signature在路上……

EEworld 有你有我
 
 

23

Posts

0

Resources
3
 

Please go back and get the word document.

This post is from GD32 MCU
 
 
 

824

Posts

190

Resources
4
 

OP, I saw the document you sent. Warm reminder, you also need to submit a video demonstration of your work. You can upload the video to the University Hall: https://training.eeworld.com.cn/course/upcourse * _ *

This post is from GD32 MCU
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
Personal signature在路上……

EEworld 有你有我
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>
Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list