Energy Monitoring and Analysis Device with integrated Web App

Energy Monitoring and Analysis Device with integrated Web App

How much TV are you watching in a day? How much does that cost you? What are your usage patterns? How much do you save by running your washing machine at non-peak hours?

Or if you are a business, how much do you use a certain tool in your business? What are the costs involved with operating that piece of machinery? How stable has been voltage around sensitive lab equipment? What is the quality of power that you are receiving at your location?

Dr. Wattson is an energy monitoring board from Upbeat Labs that is coupled with Arduino and Python libraries. It can help you easily measure energy parameters that can help you answer such questions. You can easily incorporate it into your projects to get energy parameters.

But we've now made it even simpler for you! 

The Upbeat Labs Energy Monitor is an energy monitoring and analysis device. It measures the AC energy parameters of any device that is plugged in, like RMS Voltage, Current, Line Frequency, Power Factor, Active/Reactive/Apparent Power etc, logs it to a time-series database, and also exposes the current metrics and historical data charts via a web-app.

It has been created using a Raspberry Pi 4, Dr. Wattson Energy Monitoring Board V2 and an OLED screen. 

ProtoStax Enclosures for Raspberry Pi 3/4/5 and for Dr. Wattson Energy Monitor provide a nice modular enclosure solution for the whole project, including a power inlet and an outlet whose energy consumption parameters can be measured. Plug in your load of interest and start measuring away! 

The Raspberry Pi runs a python Flask based app that queries Dr. Wattson every second and uploads the data to an InfluxDB instance. The app also presents a web user interface using HTML, CSS and Javascript to display the current energy metrics in a dashboard. You can click on each metric to see the last 5 minutes of activity. You can also view historical data via charts - last 5 mins, 10 mins, 30 mins, 60 mins, 3h, 6h, 12h and 24h. You can query the data in JSON format directly with REST APIs. The attached OLED screen on the device shows what the key parameters currently are, so you'll get the data at quick glance by looking at the device screen.

You can use the web app as-is to get a lot of useful information, both current and historical data (up to 24 hours) without any additional coding. Because the code is open source, you can enhance it and build upon it yourself, either by extending the existing codebase or by directly accessing the data in the InfluxDB instance. View and analyze data over longer periods of time (how much data you retain is up to you - you own it!), find patterns, anomalies, figure out costs, and much more!

This infrastructure enables any additional data analysis and control to be built on top of it easily. Since historical data is stored in a time series database, you can also query it, visualize it (using tools such as Grafana which goes together very well with InfluxDB), or analyze it with additional coding and data analytics.

Any device that is plugged into this solution is automatically tracked and data collected - be it a TV, an appliance, a laser cutter, a drill press, a centrifuge, or whatever you fancy (as long as it is under 15 amps!)

You can view AC energy consumption parameters such as:

  • Voltage (RMS)
  • Current (RMS)
  • Line Frequency
  • Power Factor
  • Active Power
  • Reactive Power
  • Apparent Power
  • Which Power Quadrant it is in (Consume, Inductive/Generate, Inductive/Generate, Capacitive/Consume, Capacitive)

You can also view which events have occurred

  • Over Current
  • Over Power
  • Voltage Surge
  • Voltage Sag

*You can set the various limits for the different event conditions - e.g. > 2A, <110 V

You can also view the energy consumed/generated for the day:

  • Active Energy Import
  • Active Energy Export
  • Reactive Energy Import
  • Reactive Energy Export

*The energy accumulation is reset at mid-night every night to start the stats for the new day. If you are a night owl and watch late night TV, for instance, you can change this reset time to a suitable time that happens after you go to bed. 

Here is the architecture diagram.

 

To find out more, build the device and deploy the web app, check out our tutorial at the ProtoStax Project Hub. You can also get the code for the web app at our GitHub repository

I used this project to get information on the TV watching habits in our household - when we watched TV and for how long. Knowing the electricity rates (peak/off-peak rates too), we can also compute how much it would cost on a daily basis. 

If you are a small business running a piece of equipment, for instance, you can get similar metrics for your equipment - how long it has been running, how much current/power is it consuming, and how much does it cost to run. You could use that information to better estimate your product costs, for example. 

What type of load are you going to analyze? What solutions will you build using this? Let us know in the comments below! 😊

Happy Making!

Sridhar

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.