Created by
Created June 29, 2013
Last modified October 22, 2013
Tags adc   cny70   gpio   mcp3004   mcp3008   pi   raspberry   raspberry-pi   rpi   spi  


This is the schematic for reading (analog) kilowatt-hour meters. This schematic has two CNY70 sensors to read the "black spot" on the rotating disk. Software will read the ADC converter info and can determine the rotation direction of the disk, and will count the number of rotations.
This schematic is ideal if you have a PV-system and want to know how much you export and/or import from the net.


The source code (in Python) for the Raspberry Pi can be downloaded here:


Do you have software for the Raspberry for measuring the KWH-meter? I do have not the experiance for programming the software myself. I have already a Raspberry for logging my solar-cells (PhotoVoltage Cells) energy from my SunnyExplorer ( energy convertor) with a bluetooth connection with my Raspberry en sending the data with a WiFi connection to What I'm looking for is the same, I The data from the KWH-meter must be sent to so I can see my generated power and my used power.

by thijs1971
July 12, 2013

Hallo Thijs,

I'll write this in English, so other people will be able to read this as well….

Currently, I'm still fine-tuning my software. However, I am able to log the KWH data to my DB on the Pi. I plan to make a script that will update my PVOutput page with the consumption data soon. For this I need to combine both the SMA data and the KWH data to calculate the usage.

I've uploaded my today usage via the manual upload to my test-PV-account here: http:///12L4ptg

by Patrick6325
July 18, 2013

Leave a Comment

Please sign in or create an account to comment.

Revision History

Only the circuit's creator can access stored revision history.