This page is for board specific information. More information can be found on the generic page for RPICT series.
- 3 AC current sensor
- 1 AC Voltage sensor.
- Compute RealPower, ApparentPower, PowerFactor, Vrms, Irms.
- Fit on Raspberrypi 2 holes mounting pattern.
- Arduino Attiny84 Microcontroller.
- 1 Compatibility
- 1.1 Notice
- 1.2 Recommended sensors
- 1.3 Configuration
- 1.4 Default Data Output
- 1.5 Restore Default Config
- 1.6 View the data with Python
- 1.7 Emoncms Config (Emonhub)
- 1.8 Sketch
- 1.9 CAD Drawing
- 1.10 Related Pages
- 1.11 FAQ
|Raspberrypi 1 A||Yes|
|Raspberrypi 1 B+||Yes|
|Raspberrypi 2 B||Yes|
|Raspberrypi 3 B||Yes|
|Raspberrypi 3 B+||Yes|
|Raspberrypi 4 B||Yes|
- Asus Tinkerboard has been reported to work with RPICT units. Note we wont be able to provide support for the Tinkerboard.
The RPICT3V1 must have a voltage sensor to compute Real Power. If you do not want to use a voltage sensor and prefer measuring just current then the RPICT3T1 might be more appropriate.
(Note it is possible to use a different sketch (firmware) to make the RPICT3V1 using estimated voltage. However you will have to flash the unit for that.)
- AC Current sensor:
- SCT-024 400A/100mA
- SCT-031 600A/100mA
- AC Voltage sensor:
- ZMPT101B Module
- UK: 77DB-06-09
- EU: 77DE-06-09
- US: 77DA-10-09
Starting from sketch version 1.1 the RPICT3V1 is configured over serial.
See general instructions for configuration below:
Version 2.0 & 2.1 can be configured using the web tool.
Default Data Output
Using the default sketch version 1.3 and below the output is
NodeID Realpower1 Realpower2 Realpower3 Irms1 Irms2 Irms3 Vrms
- RealPower in Watts
- Irms in MilliAmps
- Vrms in Volts
Using the default sketch version 2.0 and above the output is
NodeID Realpower1 ApparentPower1 Irms1 Vrms1 PowerFactor1 Realpower2 ApparentPower2 Irms2 Vrms2 PowerFactor2 Realpower3 ApparentPower3 Irms3 Vrms3 PowerFactor3
- RealPower in Watts
- ApparentPower in Watts
- Irms in Amperes (or Estimated Power if Vest different from 1.0)
- Vrms in Volts
- PowerFactor without units.
With sketch version 2.0 & 2.1 and above some channels can be disabled. See this page for more info. RPICT3V1 Disable channels sketch 2
Restore Default Config
You should have received a key when acquiring the unit. Use this key to download and restore the default configuration.
If the key was XXXX then execute these commands below. Replace XXXX with your own key.
$ wget lechacal.com/hardware/c/XXXX.conf $ lcl-rpict-config.py -w XXXX.conf
View the data with Python
Please note the configuration must have Emonhub format enabled (format=3). The example script below will be a good starting point.
First of all make sure you have python-serial package installed
$ sudo apt-get install python-serial
Then copy the following into an executable file and run it. This is below for sketch 1.3 and below.
#!/usr/bin/python2 import serial ser = serial.Serial('/dev/ttyAMA0', 38400) try: while 1: # Read one line from the serial buffer line = ser.readline() # Remove the trailing carriage return line feed line = line[:-2] # Create an array of the data Z = line.split(' ') # Print it nicely print ("----------") for i in range(len(Z)): if i==0: print ("NodeID: %s" % Z) elif i in [1,2,3]: print ("RealPower %d: %s W" % (i, Z[i])) elif i in [4,5,6]: print ("Irms %d: %s mA" % (i, Z[i])) elif i==7: print ("Vrms: %s V" % (Z[i])) except KeyboardInterrupt: ser.close()
This is below for sketch 2.0 and above.
#!/usr/bin/python2 import serial ser = serial.Serial('/dev/ttyAMA0', 38400) try: while 1: # Read one line from the serial buffer line = ser.readline() # Remove the trailing carriage return line feed line = line[:-2] # Create an array of the data Z = line.split(' ') # Print it nicely if len(Z)>15: print ("----------") print (" \tCT1\tCT2\tCT3") print ("RealPower:\t%s\t%s\t%s" % (Z, Z, Z)) print ("AppaPower:\t%s\t%s\t%s" % (Z, Z, Z)) print ("Irms :\t%s\t%s\t%s" % (Z, Z, Z)) print ("Vrms :\t%s\t%s\t%s" % (Z, Z, Z)) print ("PowerFact:\t%s\t%s\t%s" % (Z, Z, Z)) except KeyboardInterrupt: ser.close()
To get the above example just enter the command below.
wget lechacal.com/RPICT/example/RPICT3V1_DEMO_02.py.zip unzip RPICT3V1_DEMO_02.py.zip
and run it using
Emoncms Config (Emonhub)
For default configuration with sketch version 1.3.
[] nodename = my_RPICT3V1 hardware = RPICT3V1 [[[rx]]] names = RP1, RP2, RP3, Irms1, Irms2, Irms3, Vrms datacode = 0 scales = 1,1,1,1,1,1,1 units =W,W,W,mA,mA,mA,V
For default configuration with sketch version 2.0 and above.
[] nodename = my_RPICT3V1 hardware = RPICT3V1 [[[rx]]] names = RP1, AP1, Irms1, Vrms1, PF1, RP2, AP2, Irms2, Vrms2, PF2, RP3, AP3, Irms3, Vrms3, PF3 datacode = 0 scales = 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 units = W,W,A,V,.,W,W,A,V,.,W,W,A,V,.
Units are sold flashed with sketch for use with Voltage sensor.
Usage with Voltage sensor
Usage without Voltage sensor
If you wish to use the board without using the voltage sensor use the sketch below. Note power will be estimated power only using fixed voltage setup in configuration.
No Voltage Version 2.0
Once the sketch uploaded write the configuration as follow:
$ wget lechacal.com/RPICT/config/A2/rpict3v1.conf $ lcl-rpict-config.py -w rpict3v1.conf
Output will be in AMps. Change VEST in config from 1 to 240 or 110 to get estimated power.
More generic FAQ are here. Frequently Asked Questions
Why are there 3 Vrms output for only 1 Voltage port?
The RPICT3V1 computes power using associated pairs for Current/Voltage (CV pairs). The result of this computation gives Vrms Irms ActivePower etc.
The CV pairs in the RPICT3V1 are
The output reports the result of Vrms for each of these computation. We do expect the three Vrms values to be the nearly the same with a small diffrence because there are computed at a different time.
In practice for voltage monitoring you should just use one of the three Vrms.
However if you need to know precisely which Vrms was used when computing a given Active Power then make sure you compare it against the Vrms it is associated with.