CuVoodoo

the sorcery of copper

User Tools

Site Tools


spark_abacus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
spark_abacus [2017/01/23 19:34] – adjust summary kingkevinspark_abacus [2024/01/07 17:49] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +{{ :spark_abacus:installation.jpg?400x0|final installation}}
 +
 The spark abacus is a custom electricity meter monitoring system. The spark abacus is a custom electricity meter monitoring system.
 It's a follow-up of the [[spark_counter|spark counter]], but for a 3-phase 4-wire mains electricity power distribution installation. It's a follow-up of the [[spark_counter|spark counter]], but for a 3-phase 4-wire mains electricity power distribution installation.
 +
 +It is composed by:
 +  * 1 [[#DDM100TC|DDM100TC]] 3-phase 4-wire electricity meter with pulse output
 +  * 3 [[#Eastron SDM120-Modbus|SDM120]] single phase electricity meter with Modbus interface (with an UART to RS-485 adapter)
 +  * 3 [[#peacefair PZEM-004T|PZEM-004T]] single phase electricity meter with UART interface
 +  * 1 [[stm32f1xx|STM32F1]] micro-controller to collect the measurements from the electricity meters
 +  * 1 [[#ESP-01|ESP6266]] WiFi module to transmit the measurement values to the database
 +  * 1 [[#Orange Pi PC|Orange Pi PC]] single board computer with [[https://influxdb.com/|InfluxDB]] time series database and [[http://grafana.org/|Grafana]] graphical monitoring tool
 +
 +====== prototypes ======
 +
 +===== complete =====
 +
 +The first prototype used an old WiFi D-Link router case.
 +I glued a DIN-rail mount on the back to install it in the distribution panel.
 +The development board is a small [[stm32f1xx#blue_pill|blue pill]].
 +
 +I could fit all elements inside, including the three PZEM-004Ts, and had nice connectors, but it was too large to fit in the distribution panel along with the other electricity meters and RCCB.
 +
 +The source code and all technical details are available on [[https://git.cuvoodoo.info/kingkevin/spark_abacus/src/branch/full|git]].
 +
 +{{:spark_abacus:complete-01.jpg?0x300|complete prototype, inside}}
 +{{:spark_abacus:complete-02.jpg?0x300|complete prototype, front}}
 +{{:spark_abacus:complete-03.jpg?0x300|complete prototype, back}}
 +
 +===== light =====
 +
 +For this second prototype I used a broken SDM630 electricity meter case.
 +It is smaller and is designed to fit nicely in the distribution panel.
 +
 +This time I did not include the PZEM-004T meters since they are to large to fit in, and would only provide information I could already get from the other electricity meters.
 +This left a lot of space to include a larger [[stm32f1xx#system_board|development board]], and I could use dupont cables to connect all elements.
 +I used the connector already available in the case (for two pulse outputs and one RS-485 interface) as inputs for the monitoring system (one pulse input, as RS-485 master, AC input for 5V).
 +
 +The source code and all technical details are available on [[https://git.cuvoodoo.info/kingkevin/spark_abacus/src/branch/light|git]].
 +
 +{{:spark_abacus:light-03.jpg?0x300|light prototype, fong}}
 +{{:spark_abacus:light-01.jpg?0x300|light prototype, inside}}
 +{{:spark_abacus:light-02.jpg?0x300|light prototype, inside}}
 +{{:spark_abacus:light-04.jpg?0x300|light prototype, connection}}
 +
 +===== improvements ======
 +
 +Future improvments:
 +  * submit measurement values to influxDB using UDP (faster, no need for credentials)
 +  * make a bulk ModBus request to get most measurements at once (the pauses between requests for each measurement cost a lot of time)
 +  * use an LCD to show the values (the LEDs only show the status)
 +  * use the touch button already available on the SDM630 case
  
 ====== electricity meters ====== ====== electricity meters ======
Line 70: Line 120:
 This document also explains the Modbus protocol, but I rather recommend to read the one for the [[http://eastrongroupco.hk02.057321.com/data/uploads/Eastron_SDM630MV_CT_protocol_V1_0_.pdf|SDM630]] since it contains more information, most importantly the timing between messages. This document also explains the Modbus protocol, but I rather recommend to read the one for the [[http://eastrongroupco.hk02.057321.com/data/uploads/Eastron_SDM630MV_CT_protocol_V1_0_.pdf|SDM630]] since it contains more information, most importantly the timing between messages.
  
- +====== ESP8266 ======
-====== EPS8266 ======+
  
 To send the values measured by the electricity meters and collected by the micro-controller, I used a WiFi module based on the [[http://www.esp8266.com/wiki/doku.php|ESP8266]] SoC. To send the values measured by the electricity meters and collected by the micro-controller, I used a WiFi module based on the [[http://www.esp8266.com/wiki/doku.php|ESP8266]] SoC.
Line 144: Line 193:
 It is now also possible to get ESP-01 modules with 8 Mbits / 1 MByte of flash, which supports more recent AT firmwares. It is now also possible to get ESP-01 modules with 8 Mbits / 1 MByte of flash, which supports more recent AT firmwares.
  
-====== Orange Pi ======+====== Orange Pi PC ======
  
 {{:spark_abacus:opi-01.jpg?0x200|Orange Pi PC, front side}} {{:spark_abacus:opi-01.jpg?0x200|Orange Pi PC, front side}}
Line 165: Line 214:
  
 On it I've installed an [[https://www.influxdata.com/|InfluxDB]] time-series database to store the values (using the HTTP API), and [[http://grafana.org/|Grafana]] to visualize them. On it I've installed an [[https://www.influxdata.com/|InfluxDB]] time-series database to store the values (using the HTTP API), and [[http://grafana.org/|Grafana]] to visualize them.
 +
 +{{:spark_abacus:grafana.png?1000x0|simple display of the power consumption}}
spark_abacus.1485200067.txt.gz · Last modified: 2024/01/07 17:49 (external edit)