Power Analyzer

Measuring power line voltage and power consumption can be accomplished with cheap power point line monitors. However, when it comes to extracting those measurement to put into to a computer the price heads in to the stratosphere.

For a mere hand full of dollars you can build your own and even have a certified electrician connect it up in the in the meter box. With the arrival of the Raspberry Pi Zero with WiFi connectivity it's even low risk as an electrical fault can't blow up your computers.

The power analyzer is composed of:

Raspberry Pi Zero W (wifi)

Audio input board supporting LineIn standard

Plugpack 5 volt

240 to 9v centre tapped voltage sensing transformer (the cause of some issues)

Raspbian

  • https://www.raspberrypi.org/downloads/raspbian/
  • Select Raspbian Stretch Lite
  • V1.0 unit here uses 2017-11-29-raspbian-stretch-lite.zip
  • V2.0 unit uses 2019-04-08-raspbian-stretch-lite.zip
  • Install the image to a microSD card using Etcher (Pi official instructions)
    Works on Windows, Mac and of course Linux (as shown here)

ALSA audio

  • Change and add the following lines to the end of /boot/config.txt

# Enable audio (loads snd_bcm2835)
#dtparam=audio=on
dtparam=audio=off

# To do this, you must edit /boot/config.txt and add the following lines...
dtoverlay=fe-pi-audio
dtoverlay=i2s-mmap

 

Apache httpd (you're talking to it right now to see the waveform - below).

  • Install PHP
  • apt-get install php libapache2-mod-php -y
  • apt-get install php-gd

Problem with the waveform is possibly related to the iron core in the transformer. I'm looking for some expert opinion on the subject. I don't think it's the audio processing but you never know.

OK so the expert opinion is that this waveform is actually pretty good. Here is a video of a "shit" waveform out of London.

Spectral analysis

Raspberry Pi - Accelerating Fourier transforms using the GPU: ( Click link )

This should work on the Raspberry Pi Zero since it's pretty much a Pi 1.