RPICT3: Difference between revisions

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


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]].


[[File:IMG_0767.png | 300px | right]]
[[File:IMG_0767.png | 300px | right]]

Revision as of 15:09, 22 March 2017

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

Link to shop

  • 3x AC Current Sensor
  • Attiny85 Mcu

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/ttyAMA0', 38400, timeout=1)

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

Files

RPICT3 (v1.4)