RPICT3V1 Sketch version 1.3 documentation
This is the archived documentation for firmware 1.3 of the RPICT3V1.
Make sure to check your firmware version using the command
lcl-show-header.py
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
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/python3
import serial
ser = serial.Serial('/dev/ttyAMA0', 38400)
try:
while 1:
# Read one line from the serial buffer
line = ser.readline().decode().strip()
# 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[0])
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()
Emoncms Config (Emonhub)
For default configuration with sketch version 1.3.
[[11]] 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
Sketch
Units are sold flashed with sketch for use with a Voltage sensor.
Usage with Voltage sensor
Version 1.0
Version 1.1
Version 1.2
Version 1.3
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.
Related Pages
Howto setup Raspbian for serial read
How to calibrate the Voltage Port
How to program an Attiny85 or Attiny84
Flash RPICT Attiny84 with Arduino UNO
FAQ
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
P1-> CT1/V1
P2-> CT2/V1
P3-> CT3/V1
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.