Watt Eye has a simple purpose - monitor pulses that comes from the home electric meter, measure the interval between the pulses and compute the real-time energy being consumed, broadcast that onto the network using UDP packets so that CouchCalendar has something to do and display, and publish the data to a web server, where it can be used (graphed or placed into a db).

Dependencies:   IniManager mbed HTTPClient SWUpdate StatisticQueue mbed-rtos NTPClient Watchdog SW_HTTPServer EthernetInterface TimeInterface

Features:

  • Reads the time between pulses (which the home electric meter emits as IR for each Watt consumed).
  • Once every 5 seconds, it broadcasts this via UDP to the network, so other nodes can listen to this real-time data.
  • Once every 5 minutes, it posts statistics to a web server for logging.
  • Once a day, it checks the web server to see if there is a SW update (and if so it downloads, installs, and activates it).
  • It syncs to a configured NTP server, but doesn't actually use this information for anything.
  • It hosts a web server, but this is not being used at this time.

So, this is a rather expensive piece of hardware to monitor a single pulse, and yet it is easy to imagine enhancing this:

  • Read the water meter in a similar manner.
  • Read the gas meter in a similar manner.

And even then, there will be many left-over port pins for other uses.

Committer:
WiredHome
Date:
Sat Jul 26 19:51:33 2014 +0000
Revision:
0:a4887b672ac6
Made it more robust for timing to push data to the web server. ; Also increased the frequency that it checks for software updates from once per day to once per hour since most development is "remote".

Who changed what in which revision?

UserRevisionLine numberNew contents of line
WiredHome 0:a4887b672ac6 1 #include "mbed.h"
WiredHome 0:a4887b672ac6 2
WiredHome 0:a4887b672ac6 3
WiredHome 0:a4887b672ac6 4 // Reset_Handler
WiredHome 0:a4887b672ac6 5 // NMI_Handler
WiredHome 0:a4887b672ac6 6 // HardFault_Handler
WiredHome 0:a4887b672ac6 7 // MemManage_Handler
WiredHome 0:a4887b672ac6 8 // BusFault_Handler
WiredHome 0:a4887b672ac6 9 // UsageFault_Handler
WiredHome 0:a4887b672ac6 10 extern "C" void HardFault_Handler()
WiredHome 0:a4887b672ac6 11 {
WiredHome 0:a4887b672ac6 12 printf("Hard Fault!\r\n");
WiredHome 0:a4887b672ac6 13 wait_ms(500);
WiredHome 0:a4887b672ac6 14 NVIC_SystemReset();
WiredHome 0:a4887b672ac6 15 }
WiredHome 0:a4887b672ac6 16 extern "C" void NMI_Handler()
WiredHome 0:a4887b672ac6 17 {
WiredHome 0:a4887b672ac6 18 printf("NMI Fault!\r\n");
WiredHome 0:a4887b672ac6 19 wait_ms(500);
WiredHome 0:a4887b672ac6 20 NVIC_SystemReset();
WiredHome 0:a4887b672ac6 21 }
WiredHome 0:a4887b672ac6 22 extern "C" void MemManage_Handler()
WiredHome 0:a4887b672ac6 23 {
WiredHome 0:a4887b672ac6 24 printf("MemManage Fault!\r\n");
WiredHome 0:a4887b672ac6 25 wait_ms(500);
WiredHome 0:a4887b672ac6 26 NVIC_SystemReset();
WiredHome 0:a4887b672ac6 27 }
WiredHome 0:a4887b672ac6 28 extern "C" void BusFault_Handler()
WiredHome 0:a4887b672ac6 29 {
WiredHome 0:a4887b672ac6 30 printf("BusFault Fault!\r\n");
WiredHome 0:a4887b672ac6 31 wait_ms(500);
WiredHome 0:a4887b672ac6 32 NVIC_SystemReset();
WiredHome 0:a4887b672ac6 33 }
WiredHome 0:a4887b672ac6 34 extern "C" void UsageFault_Handler()
WiredHome 0:a4887b672ac6 35 {
WiredHome 0:a4887b672ac6 36 printf("UsageFault Fault!\r\n");
WiredHome 0:a4887b672ac6 37 wait_ms(500);
WiredHome 0:a4887b672ac6 38 NVIC_SystemReset();
WiredHome 0:a4887b672ac6 39 }