From lechacal
Revision as of 19:17, 7 April 2019 by Administrator (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Link to shop


This is RPICT4V3 version 1. This version does not support over serial configuration.

This page is for board specific information. More information can be found on the generic page for RPICT series.

  • 4x AC current sensor
  • 3x AC Voltage sensor.
  • Compute real power.
  • Fit on Raspberrypi 4 holes mounting pattern.
  • Attiny84 Mcu


IMG 0899.JPG


Version Compatible?
Raspberrypi 1 A Yes
Raspberrypi 1 B+ Yes
Raspberrypi 2 B Yes
Raspberrypi 3 B Yes
Raspberrypi 3 B+ Yes

Recommended sensors

  • AC Current sensor: SCT-013-000
  • AC Voltage sensor:
    • UK: 77DB-06-09
    • EU: 77DE-06-09
    • US: 77DA-10-09

IMG 0837 small.jpg


Default Sketch V1.1.

Default Sketch V1.2.

Default Sketch V1.3.

Default Sketch V1.4.

Default Sketch V1.5.

Default Sketch V1.6.


Starting from sketch version 1.6 the RPICT4V3 can be configures over serial.

See the configuration documentation here. Attiny_Over_Serial_Configuration_A2

Output Channels

Using the default sketch version 1.6 and above the output is

NodeID Realpower1 ApparentPower1 Irms1 Vrms1 PowerFactor1 
       Realpower2 ApparentPower2 Irms2 Vrms2 PowerFactor2 
       Realpower3 ApparentPower3 Irms3 Vrms3 PowerFactor3
       Realpower4 ApparentPower4 Irms4 Vrms3 PowerFactor4
  • RealPower in Watts
  • ApparentPower in Watts
  • Irms in Amperes
  • Vrms in Volts
  • PowerFactor without units.

Some channels can be disabled. See this page for more info. RPICT3V1 Disable channels sketch 2

Power Association

The RPICT4V3 computes RealPower using the combination of Voltage and Current sensor.
The 4 RealPower are computed using the following combinations:

RealPower1 -> CT1 and V1
RealPower2 -> CT2 and V2
RealPower3 -> CT3 and V3
RealPower4 -> CT4 and V3

Emoncms Config (Emonhub)

For default configuration.

   nodename = RPICT4V3
   hardware = RPICT4V3
       names = Vrms1,Vrms2,Vrms3,Realpower1,Realpower2,Realpower3,Realpower4
       datacode = 0
       scales = 1,1,1,1,1,1,1
       units = V,V,V,W,W,W,W

Emoncms channels.png

View the data with Python

Please note the uploaded sketch must have CSV enabled. 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.

import serial
ser = serial.Serial('/dev/ttyAMA0', 38400)

       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\tCT4") 
                print ("RealPower:\t%s\t%s\t%s\t%s" % (Z[1], Z[6], Z[11], Z[16]))
                print ("AppaPower:\t%s\t%s\t%s\t%s" % (Z[2], Z[7], Z[12], Z[17]))
                print ("Irms     :\t%s\t%s\t%s\t%s" % (Z[3], Z[8], Z[13], Z[18]))
                print ("Vrms     :\t%s\t%s\t%s\t%s" % (Z[4], Z[9], Z[14], Z[19]))
                print ("PowerFact:\t%s\t%s\t%s\t%s" % (Z[5], Z[10], Z[15], Z[20]))

except KeyboardInterrupt:

Sketch Upload

An avr programmer with 6pin ribbon cable is needed for programming. See our programmer called NanoProg_v1.

Related Link

How to calibrate the Voltage Port


Howto setup Raspbian for serial read