RPICT3T1

From lechacal
Jump to: navigation, search
IMG 1206 small.png

Link to shop

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

Overview

The RPICT3T1 measures AC Power and Temperature.

  • 3x AC current sensor
  • 1x DS18B20 Temperature Sensor
  • Attiny84 Microcontroller

Notice

Power is computed using a fixed estimated Voltage. This estimated voltage can be configured. Default value is 240V. You will be able to change this to 110 or 220 depending on the country where it is used.

If you require more accurate power measurement then use the RPICT3V1 board instead. This will also read Voltage and calculate Real Power. A voltage sensor will be required in this case.

Compatibility

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
    • SCT-019
    • SCT-006

Temperature Sensor

The DS18B20 temperature sensor can be connected directly to the screw terminal connector.

Connection is as follow:
Vcc - Red
Din - Yellow
Gnd - Black

IMG 1176 small.png

Configuration

See general instructions for

Configuration over serial for sketch version 1.2 1.3 & 2.0.

Configuration over serial for sketch version 3.0.

The serial port will output 4 values. These are the 3 estimated powers and the temperature. If you prefer having current in Amperes rather than Power in Watt set VEST=1 in the configuration. Likewise set VEST=1000 to get milliAmperes.

Calibration

If calibration is required only ICAL has any effect on the calibration.

VCAL and PHASECAL might be present in the config but have no effect. These should be ignored.

Emoncms Config (Emonhub)

For default configuration. Used as single board only (not stacked).

 [[11]]
   nodename = RPICT1T1
   firmware = RPICT3T1_V1_1.ino
   hardware = RPICT3T1
   [[[rx]]]
       names = Power1,Power2,Power3,Temperature
       datacode = 0
       scales = 1,1,1,1
       units = W,W,W,C

Python demo script

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.

  1.  #!/usr/bin/python2
  2.  import serial
  3.  ser = serial.Serial('/dev/ttyAMA0', 38400)
  4.  
  5.  try:
  6.         while 1:
  7.              # Read one line from the serial buffer
  8.              line = ser.readline()
  9.  
  10.              # Remove the trailing carriage return line feed
  11.              line = line[:-2]
  12.  
  13.              # Create an array of the data
  14.              Z = line.split(' ')
  15.  
  16.              # Print it nicely
  17.              print ("----------")
  18.              for i in range(len(Z)):
  19.                  if i==0:
  20.                      print ("NodeID: %s" % Z[0])
  21.                  elif i in [1,2,3]:
  22.                      print ("Power %d: %s W" % (i, Z[i]))
  23.                  elif i==4:
  24.                      print ("Temperature: %s C" % (Z[i]))
  25.  
  26.  except KeyboardInterrupt:
  27.         ser.close()

Files

Please verify which board version is yours. This is written on the circuit board itself.

Hardware Version 1.3

IMG 1208 small.png

Default Sketch v1.3
Default Sketch v1.4

Hardware Version 2.1

Default Sketch v2.0
Default Sketch v3.0
Default Sketch v3.1

Related Pages

Use Emonhub with RPICT

Howto_setup_Raspbian_for_serial_read

How to program an Attiny85 or Attiny84