What is it?
Every 10 seconds my smart home power meter sends out data, this can be captured by a simple serial connection.
This project aims to get the latest data from my Vera3 via wifi.
- Every 10 seconds a webpage is requested, this page returns a json object with all the information of my smart meter
My vera3 get is http://10.0.0.15/port_3480/data_request?id=status&output_format=json&DeviceNum=38
The response I get is easy to understand in firebug:
[Update 2015-10]
After implementing the Housedb project, a request is made to a specific webpage that only serves the needed information. - This response is forwarded by the ESP8266 over serial to the arduino.
It is not captured completely by the arduino, as the arduino simply doesn’t have enough memory to work with 1,6 KB (after all my code and let alone processing through this data).
So it only captures a specific part of the json string (just counting opening brackets).
[Update 2015-10]
As only the needed information is in the response, which is around a hundred bytes large, there is no need for this hack anymore. - The than captured usage is displayed on the 7segment display.
Eagle layout
I have used TPIC6C595 as they are able to drain 12volts (Thanks to http://forum.arduino.cc/index.php?topic=264333)
The complete board was broken into two parts as you can see on the next pictures of the end result
Every resistor next to the TPIC6C595 is 680 ohm.
Arduino and NodeMCU code
All the code can be found on my github: https://github.com/timdows/AMD/tree/master/SevenSegementDisplay
The lua script makes sure that it is connected to my wifi access-point at home.
The getData function makes sure that the json object is printed back to serial upon request.
The arduino code makes sure that every 10 seconds a new request is made. The json result is parsed via the ArduinoJson class.
It than updates the watt usage on the bigger 7segment and than on the 4 smaller one using the LedControl class.
[Update 2015-10]
The lua script now holds a function getData, that is fired upon receiving “getData()” as a string as input.
The command is now pointing to the 7segment route on my symfony2 Housedb project.
End result board 1
End result board 2
End result when connected
Ideas for the panel
I got some ideas to laser cut a nice panel out of plastic, my first drawing looks like this
Drawn in tinkercad https://www.tinkercad.com/things/j3swRbZ4hiz-seven-segment-surrounding
[Update 2015-09]
I got the panel lasercut by laserbeest.nl, now waiting for some small 7segment displays to implement in the bottom parts
[Update 2015-10]
After installing the panel and connecting the smaller seven segment displays it now looks like this:
TODO
Implement 4 small 7segment displays in the bottom, they will show
- Total kWh of today
- Total kWh of this week
- Total kWh of this month
- dono yet (you got suggestions?)
[Update 2015-10]
The 4 smaller 7segments are installed and depicting the following numbers:
- Total kWh of this week
- Total kWh of last week
- Total kWh of this month
- Total kWh of last month
Project costs in € or $
Object | Price |
---|---|
Arduino Pro Mini 5v | $ 1.92 |
ESP8266 | $ 2.89 |
4x TPIC6C595N | $ 8.72 |
4x 4″ 7-segment LED display | $ 23 |
LM1117T | $ 0.59 |
L7805CV | $ 0.14 |
2x MAX7219 8-Digit LED Display | $ 5.34 |
2x heat sink | $ 0.38 |
Other materials | $ 2 |
Total | $ 45.01 |
What could be better
- I found out that LUA takes much easier functions to receive commands from the Arduino, now I’m over enginering it with the amount of characters and splits (arghhh).
[Update 2015-10]
This change was implemented in the latest code commit - All the resistors next to the TPIC could be left out and a P16NF06 mosfet should be used. With this it would be made possible to dim the light programatically
- Change the arduino code to support pointers in the functions writeSmallSevenSegment and writeSevenSegment
Comments are closed.