Close
0%
0%

Simple Electricity Meter Reader and Display

Particle Photon electricity meter pulse counter and Nextion display driver

Similar projects worth following
After seeing a few projects using arduinos, in combination, or solely using a RaspberryPi to read an electricity meter I set out to make a simpler and cheaper alternative. I'm a big fan of the Particle (previously Spark) products and with two Photons on pre-order I figured they'd be the answer. Using 1 to drive a display and the other to log the electricity usage via pulse counting the 1 Wh LED.

Nextion display demo video
https://www.youtube.com/watch?v=t3y08wBBB8c

HARDWARE

Nextion Display

If you haven't seen Itead Studios Nextion displays and you want a display for your next Arduino project take a look! If you've ever used .Net forms then you'll feel right at home. It's not perfect and you're not going to make smooth animated objects due to the lack of double buffering but it's far better then a text or graphics LCD.

Use the Nextion Editor to design and compile your "forms" with any components (text boxes, picture boxes, gauges, sliders....) and place the compiled image onto an sdcard. Throw the sdcard into the display and it will flash the firmware after which the microsd card is no longer required. The components on my display are only pictures and text boxes. Itead's built in gauges are very limited but if you can draw it in Photoshop (I made my graphics in PowerPoint!) you can display in on the Nextion.


Particle Photon

It's a fantastic device made for the IoT. I'm not sure what I'd say is the best feature of the Photon; their cloud functionality or the $18 (£18 too) price tag. You're not going to get anything more capable for that price with that level of support. It's perfect for this kind of project. My electricity meter is on the far side of my garage so WiFi signal is an issue. Luckily the Photon has an on-board ceramic antennae as well as a u.FL connector which can be selected from within your firmware. I spent £15 on the u.FL to SMA lead and the largest antennae I could find on ebay. Annoyingly by Photon now has far better WiFi strength then my laptop!


DHT22 Temperature Sensor

£3,50 from ebay and gives the temperature and humidity to 0.1. There's a great library called PietteTech_DHT for the Photon which makes reading the DHT22 almost too easy. The only issue I found was that I was using an interrupt for the light sensor which was interrupting (pun intended) the precise timings needed to communicate with the sensor over a single wire. Simply remove any other interrupts before reading from the sensor and reattach them once complete. The PietteTech_DHT library also uses interrupts so disabling them isn't an option. I'm polling it every 5 minutes so missing a flash of the meter every 5 minutes isn't an issue as the previously recorded value will be resent if needed.

TSL257 Light to Voltage Sensor

It's simple, cheap, and VERY sensitive. I've duck taped it to my electricity which is made of perspex. Opening the door to view the meter is enough for the sensor to read high! Lucky really as the LED is so dim it's sometime hard to see the flash but the TSL257 catches it every time.

SOFTWARE

emoncms

The only piece of software in this project is emoncms which is part of the OpenEnergyMonitor platform. This has a fantastic API which makes it easy to push and pull data from the platform. As well as a good webpage where you can manage and view your data in a number of dashboard and graphs. The two Photons use http get request to push the current watt hours, temperature, and humidity as well as pull the current and historic data via the api. This can be hosted yourself on a linux or windows server or you can use the public version at emoncms.org. I work for a Cloud hosting company so hosting a linux server wasn't an issue. Currently the Cloud version has not been upgraded since 8.35 where as self hosted has seen versions 8.5 and currently 9.0 RC.

  • 2 × Particle Photon An arduino on steroids with built-in WiFi and cloud connectivity.
  • 1 × Nextion 5" Display Nextion takes the difficulty out of driving an LCD and makes it more like a .net form. Send simple commands such as txtPower.text="200 Wh" to write to the screen.
  • 1 × DHT22 With a Photon outside logging power it's easy to add temperature and humidity with the DHT22
  • 1 × TLS257 Light to voltage sensor used to measure the led pulses on the electricity meter.
  • 1 × Duck tape There's always a use for it in every project.

  • Panasonic NaPiOn PIR

    Kevin Cooper09/28/2015 at 18:50 0 comments

    I've added a Panasonic AMN31111 PIR to the display which removes the need for switching the display on/off. It's more expensive then a typical PIR module (£2 for a PIR module and £12 for the Panasonic) but you're paying for the tiny size (1 cm across). It's very sensitive and notices everything down to very small arm movements. I've used it to set the brightness of the display to 0 after 10 minutes of no movement and to put the display to sleep after 30 minutes. It also turns off the WiFi on the Photon which is the biggest consumer of power. An interrupt keeps track of any movement and turns the display/wifi back on if it has gone to sleep.

    Overall a really nice feature. I would like to 3D print an enclosure for the screen, photon, and PIR but I'll need more practice with SketchUp first.

  • Emoncms Android Application

    Kevin Cooper09/28/2015 at 18:37 0 comments

    I've started developing a native android application that mimics the MyElectric screen. It's using MPAndroidChart to display the last 6 hours of power usage and the last 7 days.

    Comments and download available on the OpenEnergyMonitor forum:

    http://openenergymonitor.org/emon/node/11260

View all 2 project logs

Enjoy this project?

Share

Discussions

penny.lane.mini wrote 03/22/2016 at 22:45 point

Hi I was just wondering if you were using any of the touch functions of the Nextion?




Is it possible to send image data to the nextion on the fly? i.e the photon could give it an image to display dynamically?

  Are you sure? yes | no

Kevin Cooper wrote 03/24/2016 at 09:31 point

I don't believe Nextion has that ability and due to the limited space on the Photon I don't think it could store any meaningful images.

  Are you sure? yes | no

MobileWill wrote 10/02/2015 at 01:21 point

Hi, awesome to see someone else using the Nextion. I have started playing with mine. Can you post the HMI file? I would like to see how you setup display to look so nice. Thanks. 

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates