Difference between revisions of "RPI LCT3V1"

From lechacal
Jump to: navigation, search
(Created page with " right [http://lechacalshop.com/en/rpict-series/20-raspberrypi-1x-current-sensor-adaptor-1-voltage-emoncms.html Link to shop] This page is for board sp...")
 
(Compatibility)
 
(18 intermediate revisions by one user not shown)
Line 1: Line 1:
  
[[File:btc | 300px | right]]
+
[[File:IMG 1810 small.png | 300px | right]]
[http://lechacalshop.com/en/rpict-series/20-raspberrypi-1x-current-sensor-adaptor-1-voltage-emoncms.html Link to shop]
+
[http://lechacalshop.com/gb/internetofthing/57-rpilct3v1.html Link to shop]  
  
 
This page is for board specific information. More information can be found on the [[Raspberrypi_Current_and_Temperature_Sensor_Adaptor | generic page for RPICT series]].
 
This page is for board specific information. More information can be found on the [[Raspberrypi_Current_and_Temperature_Sensor_Adaptor | generic page for RPICT series]].
 +
 +
The RPI LCT3V1 has been specifically designed for large CT of 400A and more. CT connector are screw terminal types as opposed to jack connectors.
  
 
* 3 AC current sensor
 
* 3 AC current sensor
Line 10: Line 12:
 
* Fit on Raspberrypi 2 holes mounting pattern.
 
* Fit on Raspberrypi 2 holes mounting pattern.
 
* Attiny84 Mcu
 
* Attiny84 Mcu
 +
* Use with 400A CT
  
 
=Compatibility=
 
=Compatibility=
Line 31: Line 34:
 
|-
 
|-
 
|Raspberrypi 3 B+
 
|Raspberrypi 3 B+
 +
|Yes
 +
|-
 +
|Raspberrypi 4
 
|Yes
 
|Yes
 
|-
 
|-
 
|}
 
|}
 
==Recommended sensors==
 
==Recommended sensors==
[[File:IMG_1118_small.png | 300px | right]]
+
[[File:IMG 1807 small.png | 300px | right]]
  
 
* AC Current sensor: SCT-024
 
* AC Current sensor: SCT-024
Line 41: Line 47:
 
** UK: 77DB-06-09
 
** UK: 77DB-06-09
 
** EU: 77DE-06-09
 
** EU: 77DE-06-09
** US: 77DA-10-09 or STA-4190D
+
** US: 77DA-10-09
  
 
==Configuration==
 
==Configuration==
 
+
[[File:IMG 1809 small.png | 300px | right]]
Starting from sketch version 1.1 the RPICT3V1 is configured over serial.
+
  
 
See general instructions for configuration below:
 
See general instructions for configuration below:
Line 51: Line 56:
 
[[Attiny Over Serial Configuration | Configuration over serial for sketch version 1.1]].
 
[[Attiny Over Serial Configuration | Configuration over serial for sketch version 1.1]].
  
[[Attiny Over Serial Configuration A1 | Configuration over serial for sketch version 1.2]].
+
[[Attiny Over Serial Configuration A1 | Configuration over serial for sketch version 1.2 & 1.3]].
 +
 
 +
[[Attiny Over Serial Configuration A2 | Configuration over serial for sketch version 2.0 & 2.1]].
 +
 
 +
Version 2.0 & 2.1 can be configured using the web tool. [http://lechacal.com/RPICT/config/generator/rpict3v1_v1.0/ Online Config Generator]
  
 
==View the data with Python==
 
==View the data with Python==
Line 61: Line 70:
  
 
Then copy the following into an executable file and run it.
 
Then copy the following into an executable file and run it.
 +
This is below for '''sketch 1.3''' and below.
  
  #!/usr/bin/python
+
  #!/usr/bin/python2
 
  import serial
 
  import serial
 
  ser = serial.Serial('/dev/ttyAMA0', 38400)
 
  ser = serial.Serial('/dev/ttyAMA0', 38400)
Line 68: Line 78:
 
  try:
 
  try:
 
         while 1:
 
         while 1:
                response = ser.readline()
+
            # Read one line from the serial buffer
                z = response.split(" ")
+
            line = ser.readline()
                if len(z)>=7:
+
                        print "RealP 1: %s Watts" % z[1]
+
            # Remove the trailing carriage return line feed
                        print "RealP 2: %s Watts" % z[2]
+
            line = line[:-2]
                        print "RealP 3: %s Watts" % z[3]
+
                        print "Irms 1: %s mA" % z[4]
+
            # Create an array of the data
                        print "Irms 2: %s mA" % z[5]
+
            Z = line.split(' ')
                        print "Irms 3: %s mA" % z[6]
+
                        print "Vrms   : %s Volts" % z[7][:-2]
+
            # 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:
 
  except KeyboardInterrupt:
 
         ser.close()
 
         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[1], Z[6], Z[11]))
 +
                print ("AppaPower:\t%s\t%s\t%s" % (Z[2], Z[7], Z[12]))
 +
                print ("Irms    :\t%s\t%s\t%s" % (Z[3], Z[8], Z[13]))
 +
                print ("Vrms    :\t%s\t%s\t%s" % (Z[4], Z[9], Z[14]))
 +
                print ("PowerFact:\t%s\t%s\t%s" % (Z[5], Z[10], Z[15]))
 +
 +
                       
 +
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
 +
python RPICT3V1_DEMO_02.py
  
 
==Emoncms Config (Emonhub)==
 
==Emoncms Config (Emonhub)==
  
For default configuration.
+
For default configuration with sketch '''version 1.3'''.
  
 
   <nowiki>[[11]]</nowiki>
 
   <nowiki>[[11]]</nowiki>
Line 94: Line 155:
 
       units =W,W,W,mA,mA,mA,V
 
       units =W,W,W,mA,mA,mA,V
  
Using the default sketch the output will be <br>
 
NodeID Realpower1  Realpower2 Realpower3 Irms1 Irms2 Irms3 Vrms
 
* RealPower in Watts
 
* Irms in MilliAmps
 
* Vrms in Volts
 
  
 
[[File:rpict3v1_channel_emoncms.png]]
 
[[File:rpict3v1_channel_emoncms.png]]
 +
 +
 +
For default configuration with sketch '''version 2.0''' and above.
 +
 +
  <nowiki>[[11]]</nowiki>
 +
    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,.
  
 
==Sketch==
 
==Sketch==
Line 110: Line 178:
 
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_0.ino Version 1.0]<br>
 
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_0.ino Version 1.0]<br>
 
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_1.ino Version 1.1]<br>
 
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_1.ino Version 1.1]<br>
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_2.ino Version 1.2]
+
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_2.ino Version 1.2]<br>
 +
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v1_3.ino Version 1.3]<br>
 +
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v2_0.ino Version 2.0]<br>
 +
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_v2.1.ino Version 2.1]<br>
  
 
===Usage without 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.<br>
 
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.<br>
 
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_noV_v1_0.ino No Voltage Version 1.0]<br>
 
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_noV_v1_0.ino No Voltage Version 1.0]<br>
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_noV_v1_1.ino No Voltage Version 1.1]
+
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_noV_v1_1.ino No Voltage Version 1.1]<br>
 +
[http://lechacal.com/RPICT/CT3V1/RPICT3V1_noV_v1_2.ino No Voltage Version 1.2]
  
 
Once the sketch uploaded write the configuration as follow:
 
Once the sketch uploaded write the configuration as follow:
  
 
  $ wget lechacal.com/RPICT/config/A0/rpict3t1.conf
 
  $ wget lechacal.com/RPICT/config/A0/rpict3t1.conf
  $ ./lcl-rpict-config.py -w rpict3t1.conf
+
  $ lcl-rpict-config.py -w rpict3t1.conf
 
<small>* rpict3'''t'''1 above is not a tipo</small>
 
<small>* rpict3'''t'''1 above is not a tipo</small>
  
Line 128: Line 200:
 
[[Use Emonhub with RPICT]]
 
[[Use Emonhub with RPICT]]
  
[[Howto setup rpi3 for CSV reading]]
+
[[Howto setup Raspbian for serial read]]
  
 
[[How to program an Attiny85 or Attiny84]]
 
[[How to program an Attiny85 or Attiny84]]

Latest revision as of 11:38, 19 March 2020

IMG 1810 small.png

Link to shop

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

The RPI LCT3V1 has been specifically designed for large CT of 400A and more. CT connector are screw terminal types as opposed to jack connectors.

  • 3 AC current sensor
  • 1 AC Voltage sensor.
  • Compute real power.
  • Fit on Raspberrypi 2 holes mounting pattern.
  • Attiny84 Mcu
  • Use with 400A CT

Compatibility

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

Recommended sensors

IMG 1807 small.png
  • AC Current sensor: SCT-024
  • AC Voltage sensor:
    • UK: 77DB-06-09
    • EU: 77DE-06-09
    • US: 77DA-10-09

Configuration

IMG 1809 small.png

See general instructions for configuration below:

Configuration over serial for sketch version 1.1.

Configuration over serial for sketch version 1.2 & 1.3.

Configuration over serial for sketch version 2.0 & 2.1.

Version 2.0 & 2.1 can be configured using the web tool. Online Config Generator

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[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()


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

                       
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

python RPICT3V1_DEMO_02.py

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


Rpict3v1 channel emoncms.png


For default configuration with sketch version 2.0 and above.

 [[11]]
   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,.

Sketch

Units are sold flashed with sketch for use with Voltage sensor.

Usage with Voltage sensor

Version 1.0
Version 1.1
Version 1.2
Version 1.3
Version 2.0
Version 2.1

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 1.0
No Voltage Version 1.1
No Voltage Version 1.2

Once the sketch uploaded write the configuration as follow:

$ wget lechacal.com/RPICT/config/A0/rpict3t1.conf
$ lcl-rpict-config.py -w rpict3t1.conf

* rpict3t1 above is not a tipo

Related Pages

How to calibrate the Voltage Port

Use Emonhub with RPICT

Howto setup Raspbian for serial read

How to program an Attiny85 or Attiny84