RPICT3V1: Difference between revisions

From lechacal
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:


[[File:B14385c7350dc084d6737e7bd53babfc.png | 150px]]
[[File:B14385c7350dc084d6737e7bd53babfc.png | 150px]]
==Recommended sensors==
* AC Current sensor: SCT-013-000
* AC Voltage sensor:
** UK: 77DB-06-09
** EU: 77DE-06-09
** US: 77DA-10-09 or CT3957-NA





Revision as of 14:29, 15 February 2017

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

Recommended sensors

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


Sketch

Version 1.0

If you wish to use the board as a RPICT3 without any use of the voltage use the sketch below. Note power will be estimated power only.
No Voltage Version 1.0

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.

#!/usr/bin/python
import serial
ser = serial.Serial('/dev/ttyS0', 38400, timeout=1)
ser.open()

try:
       while 1:
               response = ser.readline()
               z = response.split(",")
               if len(z)>=6:
                       print "RealP 1: %s Watts" % z[0]
                       print "RealP 2: %s Watts" % z[1]
                       print "RealP 3: %s Watts" % z[2]
                       print "Power 1: %s Watts" % z[3]
                       print "Power 2: %s Watts" % z[4]
                       print "Power 3: %s Watts" % z[5]
                       print "Vrms   : %s Volts" % z[6][:-2]
except KeyboardInterrupt:
       ser.close()

Related Links

How to calibrate the Voltage Port