Last modified 6 years ago Last modified on 2014-03-23 14:02:51

NOTE! This page is no longer updated

You will find the latest information about MySensors here:

Energy Meter (Pulse Sensor)


You can download the Arduino sketch here.

This sensor counts pulses from a house meter and converts it into watt/kwh. There are a few parameters that needs to be tuned before everything works. On your meter it is usually specified how many pulses/kwh. Set PULSE_FACTOR to this value. You can also set SEND_FREQUENCY (how often you want the sensor to report values). Default is each 20 seconds.

If you want the vera device to show your current meeter value. First turn off your sensor. Update Variable1 value under the vera device advanced tab. Set it to your meters current kwh-value * your PULSE_FACTOR.
Example: Your pulse factor is 1000 and kwh-reading is 33000. Then set Variable1 to 33000000.

The sensor sketch has two modes:


Use this if you run the sensor on battery. In this mode the sensor will report KWH but cannot report any Watt-value. This is because when sensor sleeps it will lose track of time and therefore it is impossible to calculate a correct Watt-value.

SLEEP_MODE = false

In this mode the sensor will always be awake. Watt value will also be reported to Vera. You should probably not run your sensor on batteries in this mode.

Wire things up

Follow the instructions in ConnectingRadioModule to connect radio module.

Connect the digital DO (Digital Out) of the light sensor to digital pin 3 of the Arduino board. Connect VCC to +5V of the Arduino board. GND to GND.

Hardware - Purchase guide

To build this sensor you'll need one arduino + radio specified in the base kit found here:

With the following additional parts:
1x Light sensor


1x TSL250R Light sensor which is a bit easier to mount on meter

TOTAL SENSOR PRICE: $7.6 (arduino + radio) + $2.8 (light sensor) = $10.4

Here I'm trying to simulate meter pulses with another LED while testing the code.