Introduction: Smart Electricity Meter
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.
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: 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
Check out the video and https://www.espruino.com/Smart+Meter 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 https://www.espruino.com/Smart+Meter
Participated in the
Arduino Contest 2019
4 years ago
I like this, this will work also for another project I have in mind, to measure water flow. The water meters that give electronic output are expensive, but with your project the sensor could be placed over the window of a mechanical (cheaper) meter to detect when the needle passes under the sensor. Each revolution of the needle is a fixed quantity of water that has flowed.
Reply 4 years ago
Thanks! I wonder is just a needle going past the sensor will be enough to trigger it with the current code, but the nRF52 chip in the Puck has a comparator built in so you should be able to detect quite minor changes in lighting if you need to (http://www.espruino.com/NRF52LL).