Code Monkey home page Code Monkey logo

power-meter's Introduction

Power Meter Pulse Counter

A tick counter using Raspberry Pi GPIO pins.

Created to record electricity used by a model EKM-25IDS meter made by EKM Metering. The meter's pulse output pins behave much like a switch that closes and opens 800 times per kWh used.

Input

Reads from GPIO 27 which is hardware pin 13 on a Raspberry Pi B+. Be sure to check which hardware pin GPIO 27 maps to on your system or to change the GPIO pin.

Output

Read the number of pulses since the program started by connecting to TCP port 9001.

pi@raspberrypi ~ $ while [ 0 ] ; do echo | nc localhost 9001 ; echo ; sleep 60 ; done
10794
10801
10807
10814

This allows you to read the value from a remote server and use something like RRDtool to graph power usage.

Example Power Graph

Wiring

Schematic:

Wiring Schematic

  1. Supply 3.3 V from a Raspberry Pi's GPIO pins to the meter.
  2. Use a 1k Ohm resistor on the input GPIO pin to limit current.
  3. Use a 10k Ohm pulldown resistor on the input pin (connected on the power meter side of the 1k Ohm resistor).
  4. Wire the meter to the GPIO input pin.

Building

Run:

make

Generated files:

power-meter.out - executable for the OS the build is run on.

power-meter.pi - executable for Linux on ARM 6.

Starting At Boot

To start the power monitor at boot on Rasbian you can add the following to /etc/rc.local (before the exit 0 line):

/path/to/power-meter.pi > /dev/null &

power-meter's People

Contributors

superfrink avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dtapuska jannes67

power-meter's Issues

Wiring Schematic clarification

Hi, I'm hoping you can clarify your wiring schematic. I'm using an EKM water meter with pulse output. I have 3 wires, and according to this post (https://forum.ekmmetering.com/viewtopic.php?f=9&t=6115), there is a Common wire, pulse-output1 wire, and pulse-output2 wire. I believe, I can safely ignore the pulse-output2 wire, since I only have one device hooked up for reading.

In your wiring diagram, would I hook the Raspberry pi 3.3V output up to the common, then hook the pulse-output1 wire to RPI's pin 13/GPIO 27 with a 1k ohm resistor, and RPI's ground with 10k ohm pulldown?

Also, I'm confused about the order of the 1k, and 10k resistors. The schematic makes it look like they are not inline with each other, but the description says to put the 10k pulldown after the 1k resistor. Can you clarify?

My apologies if these questions are basic, I've never worked anything like this before. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.