Building an Utility consumption monitor
.
Dear All,
After looking into many available examples of monitoring your utility consumption (electricity, gas and water) many being DIY projects like the ones found on OpenEnergyMonitor (majority is using the Arduino as a bases) or commercially available sets, I decided to develop my own approach while trying to leverage the many good idea I found during my initial investigations.
My current build is based on following:
Design criteria
- Using the MBED LCP1768 or potentially the new LPC11U24 with an additional WiFi module
- Hitex Matrix (also RS Components) or Cool Components Workshop Development Board (Rev 2b)
- Light (power) and Hall (gas / water) sensors are used
- Interfacing to utility meters MUST be safe and fully isolated (none-invasive), easy to establish
- data gathering and calculation are based on metering data and their own internal calibrations, no need for current / voltage sensing and it's calculation to derive true watt's
- minimal component count
- easy to expand or update on functionality while leveraging existing library as to minimize development efforts
- low power usage, less than 2 Watt
- easy to build and reproduce
Warning Notice
- Working with electricity, gas and water can be potentially dangerous, great caution is needed here and in case of doubt a experienced person should be contacted.
Items needed to build
- 1pc MBED LPC1768
- HitexMatrix (also RS Components) (an additional 10/100 Base T port is needed) or Cool Components Workshop Development Board (Rev 2b)
- 1pc TSL257-LF light sensor
- 2pc A1120EUA Hall sensor
- 3pc 5pin connector pcb part with cable part
- 3 pin regulator (W78 3v3) as to avoid excessive loads on the internal MBED 3v3 regulator
- 6-12 Volt DC power adapter
additional item for V2.0
- 2pc XBee Pro Series 1
- 1pc XBee breakout board
- 1pc XBee breakout board with regulator
- 1pc LT1004 2.5V reference
- 5pc LM36 temp sensor
- LM358 OpAmp
- various resistors as per schematic
- 1pc 10 position terminal strip
Assumptions
- availability of a web server (apache)
- availability of an database server (MySQL)
Overview of schematic
- System overview
- Master unit with MBED and local sensors schematic
- Remote unit (XBee based) with sensors schematic
- gas and water sensor mechanical
In case of working with Hall sensor an excellent document can be found from the Allegro website http://www.allegromicro.com/Design-Center/Technical-Documents/Hall-Effect-Sensor-IC-Publications/Hall-Effect-IC-Application-Guide.aspx#Q19
Used coding examples
- MBED coding /media/uploads/pwheels/use_mon_v2.zip
- PHP coding /media/uploads/pwheels/use_mon_web_2.zip
- MySQL structure file /media/uploads/pwheels/pwr_mon_sql.zip
- The MBED directory holds an use_mon.ini file, content is:
SMP_INTERVAL = 300 FRM_INTERVAL = 1 NTP_INTERVAL = 720 MSR_SWITCH = 156 PWR_ASSERT = 0 PWR_DELAY = 20 GAS_ASSERT = 0 GAS_DELAY = 20 HTO_ASSERT = 1 HTO_DELAY = 20 MON_ID = 1 #PWR_MAX = 300 #PWR_AVG = 250 #GAS_MAX = 30 #GAS_AVG = 25 SMP_MAX = 1.5 SMP_AVG = 1.0 SMG_MAX = 0.5 SMG_AVG = 0.4 HTO_MAX = 50 HTO_AVG = 45 REM_SENSOR = 1
Client display
- Utility consumption example (local & remote (temp & %rh) data, based on conventional meter data)
Photo's of the MBED baseboard and it's sensors
- MBED prototype (V1.0, left side w/o XBee and P1 port, V2.0 right side, w/ Xbee and P1 port)
- Power light sensor on conventional meter (left side), Smart Meter with yellow M-Bus cable to gas (right side).
P1 port->Grey, M-Bus->yellow
- Gas hall sensor and it's temperature sensor
- Water hall sensor (yes, you are right, that's a drill, now acting as an magnetic concentrator -;))
Credits to various sources
OpenEnergyMonitor http://openenergymonitor.org/emon/home
Initial Graph example by Trystan Lea http://openenergymonitor.org/emon/node/88
Various MBED library contributors
Enhancements realized
- MySQL event script to totalize daily usage from raw data
- As per 23-Jan-2012 the PHP page(s) have been updated
- V2.0 - SMS alerts on high resource usage, mainly to avoid water spills
- V2.0 - xBee interface for remote units
- V2.0 - P1 Smart Metering interface & class driver (MT382 based) added. (Note: V2.0 enhancement not yet updated in coding examples, mainly due to being in testing phase)
- project currently frozen due to changed utility metering equipment (smart metering, this requires some adjustments and will be discussed in a followup project) (last update = interface build/tested with class driver for MT382)
- Updated coding as to capture V2.0 changes
Future plans
- Replacement of xBee by BT capability as remote link (addition of PV energy & remote sensor data using BT) (planned for early 2013))
1 comment on Building an Utility consumption monitor:
Please log in to post comments.
program for gas sensor in mbed board