Smart Electricity Meter

by gfwilliams in Circuits > Wireless

5816 Views, 15 Favorites, 0 Comments

Smart Electricity Meter

DIY Smart Electricity Meter with Puck.js

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 https://www.espruino.com/Smart+Meter) for more information.

Hardware

vlcsnap-2019-04-10-09h36m09s684.png
vlcsnap-2019-04-10-09h35m50s031.png
vlcsnap-2019-04-10-09h39m13s604.png
vlcsnap-2019-04-10-09h38m34s880.png
vlcsnap-2019-04-10-09h35m12s413.png
vlcsnap-2019-04-10-09h38m50s361.png
vlcsnap-2019-04-10-09h39m38s434.png
vlcsnap-2019-04-10-09h33m40s931.png

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.

Software

vlcsnap-2019-04-10-09h59m32s073.png
vlcsnap-2019-04-10-09h59m46s460.png

All you need to do is:

  • Follow the Espruino Guide to get connected with Puck.js: http://www.espruino.com/Quick+Start+BLE#puckjs
  • 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 https://www.espruino.com/Smart+Meter for more code and a more detailed explanation

Downloads

Phone App

vlcsnap-2019-04-10-09h34m29s794.png
vlcsnap-2019-04-10-09h34m48s452.png

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 https://www.espruino.com/Smart+Meter