Introduction: Smart Electricity Meter

About: I enjoy making things - both hardware and software. I run a small company that makes the Open Source Espruino JavaScript interpreter ( as well as the R4 and Morphyre Music Visualisers (…

Pretty much all Digital Electricity meters (smart or not) have a light that blinks every time a certain amount of energy is used - often once for every Watt-hour (Usually labelled as 1000 imp/kWh).

You can easily detect this with a simple Light Dependent Resistor and use it to measure and record your energy usage over time. We'll use a Puck.js to work out statistics and let you view them over Bluetooth, but you could easily write them to an SD card or broadcast them to something like a Raspberry pi.

The video above should give you a good run through of what you need to do, or check out the steps here (and also for more information.

Step 1: Hardware

The hardware's really easy. You just need a Puck.js device and a Light dependent resistor (most LDRs should work).

Drill a hole in the Puck.js case to fit the LDR (with the 'step' in the case facing downwards, you want to drill where the top left indent is). Push the LDR into the D1 and D2 pins (orientation is not important), fit everything in the case and then solder it in.

To fit the Puck to the electricity meter I've just used some double-sided sticky tape (VHB tape) and have cut a hole in it for the LDR - this ensures you get a nice fit to the electricity meter while also cutting out any outside light.

Finally, just place the Puck with the LDR as close to the Electricty meter's light as possible.

Step 2: Software

All you need to do is:

  • Follow the Espruino Guide to get connected with Puck.js:
  • Copy and paste the attached code into the right-hand side of the IDE
  • Click the 'Upload' button
  • Type 'save()' and hit enter on the left-hand side of the IDE
  • Disconnect.

Check out the video and for more code and a more detailed explanation


Step 3: Phone App

For the phone app we're just using Web Bluetooth.

On an Android phone with Chrome (or iPhone with the WebBLE app) just go to this link and you can tap the screen to connect and see historical electricity usage graphs (in the screenshot the graphs aren't too exciting as I only had the monitor connected for a day!).

It's easy to modify the code to display whatever information you want though! Full source for the Web app is at

Arduino Contest 2019

Participated in the
Arduino Contest 2019