CuVoodoo

the sorcery of copper

User Tools

Site Tools


spark_counter

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
Next revisionBoth sides next revision
spark_counter [2015/12/07 15:36] – add Orange Pi kingkevinspark_counter [2015/12/28 10:26] – [peacefair PZEM-004] kingkevin
Line 37: Line 37:
 The meter also provides a UART port to query the measured values. The meter also provides a UART port to query the measured values.
 Two opto-couplers isolate the main power meter circuits from the TX and RX UART ports. Two opto-couplers isolate the main power meter circuits from the TX and RX UART ports.
 +
 +^ UART ^ PZEM-004 ^ note ^
 +| 5V | VDD | 3.3V is not enough |
 +| TX | RX | the UART pin needs to be able to sink ~4 mA |
 +| RX | TX | the UART pin needs to be idle high |
 +| GND | GND | |
 +
 +I used a CP2102 based USB to UART converter.
 +CH340 based USB to UART converters will not work (it seems to not be able to sink enough current).
 +And when using the Arduino you should not use the USB port (for serial), since that interferes with the UART signals.
  
 The {{:spark_counter:pzem-004.rtf|manual}} provides the corresponding commands, but lacks some information. The {{:spark_counter:pzem-004.rtf|manual}} provides the corresponding commands, but lacks some information.
Line 137: Line 147:
  
 The values are then simply stored in an [[https://influxdb.com/|InfluxDB]] time series database for visualisation in [[http://grafana.org/|grafana]]. The values are then simply stored in an [[https://influxdb.com/|InfluxDB]] time series database for visualisation in [[http://grafana.org/|grafana]].
 +
 +Note: there is no ARM build of grafana (armel for RPi 1, armhf for later versions).
 +This is also because there is no ARM release of [[http://phantomjs.org/|PhantomJS]].
 +I'm running grafana on my local computer (amd64), using the remote database on the RPi.
  
 {{:spark_counter:grafana.png?0x200|grafana visualization}} {{:spark_counter:grafana.png?0x200|grafana visualization}}
  
 ====== Orange Pi ====== ====== Orange Pi ======
- 
-There is no armel build of grafana for the Raspberry Pi, and compiling it from source wasn't possible because 256MB of RAM aren't enough. 
-Thus I tried to use a Orange Pi since it was also lying around. 
  
 The [[http://www.orangepi.org/orangepipc/|Orange Pi PC]] is a cheap [[http://www.aliexpress.com/item/Orange-Pi-PC-ubuntu-linux-and-android-mini-PC-Beyond-and-Compatible-with-Raspberry-Pi-2/32448079125.html|$15 alternative]] to the Raspberry Pi 2. The [[http://www.orangepi.org/orangepipc/|Orange Pi PC]] is a cheap [[http://www.aliexpress.com/item/Orange-Pi-PC-ubuntu-linux-and-android-mini-PC-Beyond-and-Compatible-with-Raspberry-Pi-2/32448079125.html|$15 alternative]] to the Raspberry Pi 2.
-This single board computer is based on an [[https://linux-sunxi.org/H3|Allwinner H3 (sun8iw7p1)]] SoC with ARM Cortex-A7 @ 1.8GHz, and 1 GB of RAM+This single board computer is based on an [[https://linux-sunxi.org/H3|Allwinner H3 (sun8iw7p1)]] SoC with ARM Cortex-A7 @ 1.2GHz (often over-clocked), and 1 GB of RAM.
-That should be plenty to compile and run grafana.+
  
-For this price the hardware is unbeatable, but the software support is quite poor (outdated but indicating [[http://www.orangepi.org/Docs/FAQ.html|FAQ]])+For this price the hardware is unbeatable, but the software support is really poor. 
-Only Android supports the video hardware acceleration currently. +Also only Android supports the video hardware acceleration currently. 
-The official [[http://www.orangepi.org/downloadresources/|images]] are old (e.g. Android 4.2.2), but there are newer images made available by the community: +The official [[http://www.orangepi.org/downloadresources/|images]] are quite old (e.g. Android 4.2.2), but there are a bit newer images made available by the community: 
-  * such as [[http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=755|Android]], with weird [[http://www.orangepi.org/Docs/SDcardinstallation.html#Install_Android_OS_image|installation process]] +  * [[http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=755|Android]] (often ROMs from other Allwinner based products), with weird [[http://www.orangepi.org/Docs/SDcardinstallation.html#Install_Android_OS_image|installation process]] 
-  * various [[http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=342|linux]]+  * various [[http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=342|linux]] distributions
 Since I'll only use it as server I decided to go with debian jessie minimal. Since I'll only use it as server I decided to go with debian jessie minimal.
  
 The pin header is the same as the [[http://www.raspberry-projects.com/pi/pi-hardware/raspberry-pi-2-model-b/rpi2-model-b-io-pins|40-pin Raspberry Pi]]. The pin header is the same as the [[http://www.raspberry-projects.com/pi/pi-hardware/raspberry-pi-2-model-b/rpi2-model-b-io-pins|40-pin Raspberry Pi]].
spark_counter.txt · Last modified: 2024/01/07 17:49 by 127.0.0.1