You are on page 1of 14

Arduino Based Home Energy Measurement

Iiips.11giiIul.com1Toollippc1Encrgy_Loggcr
iolic.norijcnaviias.co.za
Background
< This is my attempt to build a small home based energy logger.
< t is not unique but has an RF12 on board so it can integrate with
other systems, and it logs data to an OpenLog unit
< This makes changing SD cards and logging a breeze
< t is based on OpenEnergyMonitor
< Many of these projects have been done all around the world
< think what makes this one unique is the fact that the sensor unit
(the arduino with the CT) has a RF12 radio built in and also an
Openlog unit from Sparkfun
< The OpenLog unit is connected to the UART of the sensor unit. Full
control off the Openlog can be obtained via the remote unit
connected via RF12 radio
< This means that the sensor unit can keep on logging to the Openlog.
You can remotely initiate a session with the Openlog from the base
station, and make changes to the settings, before putting it back in
logging mode
$omc facis
< Small home built energy logger
< Based on Atmel ATMega 328 chip and arduino compatible
< Based on the OpenEnergyMonitor project
< Measure current only, Voltage assumed constant
< RF12 radio installed, this makes the system very expandable
< OpenLog from sparkfun installed
< Voltage assumed constant and only RMS current measured using
Emon.cc library from the OpenEnergyLogger project
cvicc $ciup
C
vLhon
ScrlpL
Ardulno
8emoLe unlL
8l12 8adlo
Sends commands
8ecelve power daLa
Loa CSv ower
uaLa Lo flle
Loa Lo achube
Ardulno
Sensor unlL
8l12 8adlo
Send power lnfo
8ecelve Commands
CpenLoa
Loas power lnfo
Can be remoLe conLrolled
C1
8l Llnk
loL LlfeCraph
$omc pIoios
ardulno
CpenLo
a
C1
8adlo and
C1 shleld
8emoLe unlL rx lnfo
loaalna
Sensor unlL C1 and
loaalna
ardulno
Su Card
8l12
onncciing iIc T
< Use blas reslstor s to blas CT voltage arouno 2.5v, slnce tbe controller cannot
reao tbe negatlve portlon ot tbe current wave
< We woulo bave to tllter out tbls DC voltage later on wltb a olgltal blgb pass tllter
reter to cooe ln emon.cc
< Tbe CT sensor proouces a current tbat ls proportlonal to tbe lnstantaneous
current tlowlng ln tbe malns wlre by:
< lsens = C7turnsot|o x l|nst
< Tbe reslstor ln parallel wltb tbe CT sensor ls calleo a buroen reslstor ano
converts tbe current |sens lnto a voltage:
< 'sensl = 8urden es|stonce x lsens
< Tbe two Rvo reslstors trom a voltage olvloer tbat outputs a voltage at balt tbe
Aroulno supply voltage ot 5v. Tbls voltage blases tbe AC voltage proouceo by tbe
CT sensor ano buroen reslstor by 2.5v, neeoeo because tbe Aroulno analog lnput
cbannel requlres a posltlve voltage.
< 'o|toge ot ono|og |nput = 8|os 'o|toge + 'sensl
< Tbe capacltor C1 stablllzes tbe DC blas as tbls can otten be a source ot
consloerable nolse.
< Sultable slzes tor reslstors Rvo are 10 to 100k. Hlgber reslstance lowers energy
consumptlon but also lncreases nolse.
< A sultable value tor C1 ls 10uF.
< Source - bttp://openenergymonltor.org/emon/nooe/59
casuring Powcr
varlable oeceleratlon ano setup
;o|d |oop(j
{
[or n=0 to num5er0[Somp|es
{
reod |n ;o|toge ond current somp|e
remo;e ;o|toge ond current somp|e o[[set w|th d|g|to| h|gh poss [||ter
correct current phose d|sp|ocement w|th ||neor |nterpo|ot|on coused 5,: AuC mu|t|p|ex|ng,
|nherent C7 ond power odopter phose d|sp|ocements.
occumu|ote souores o[ ;o|toge ond current [or rms co|cu|ot|on
occumu|ote product o[ ;o|toge ond current [or reo| power co|cu|ot|on
}
co|cu|ote ;o|ues [or reo| power, opporent power, power [octor, rms ;o|toge, rms current [rom occumu|otors
opp|, ;o|toge ond current co||5rot|on coe[[|c|ents.
pr|nt ;o|ues to US8 ser|o|
reset occumu|otors.
}
< bttp://openenergymonltor.org/emon/
Measurement of home hot water energy
kow Labe|s 5um of Lnergy
un11 111
un11 129
un11 9
9un11 112
1un11 12
11un11 94
12un11 1
13un11 2
14un11 1
rand 1ota| 950
Avetooe(kwb) 105 Avetooe kwb fot o Jov
Apptox losses 150 lets temove losses to see bow mocb we oseJ
O(jooles) l2147851 we oseJ tbls moov jooles fot wotet beotloo
11(Jeoteesc) 500 Cevset 5ettloo
12(Jeoteesc) 1000 lets ooess tbe lopot wotet tempetotote
Moss of wotet ose(llttes) 14119 Apptoxlmote wotet ose fot tbe boose (Omc Jelto 1)
Nombet of people (o) 250 now moov people lo tbe boosebobv 05
llttes of wotet oseJ pet petsoo 548 Avetooe wotet ose pet petsoo pet Jov
00
20
40
60
80
100
120
140

a||y Lnergy
1oblenorL[enavlLascoza
$pccific ay mcasurcmcni

1
1
2
2
3
3

1
1

1
4

4
1

1
9

3
3

2
2

1
3
1

2
4

3
4
1
1

3
1
2

2
9

2
9
1
3

3
2

3
1
4

3
4

4
2

2
4
1

1
9

4
9

4
4
2

2
1

2
2

4
1

J
Jed 8 Iune 2011
Load(W)
uad ShowerMom
aLh
abv aLh
uaddv aLh
Mom shower
ulshes
ulsh
es
ulsh
es
et some more loggeo oata at
bttps://gltbub.com/Toobllppe/Lnergy_Logger/tree/master/loggeooata
Logging daia io PacIulc wiiI PyiIon
< Log your realtlme oata to tbe clowo uslng Pacbube ano Pytbon
< Dowloao eeml - bttps://gltbub.com/petervlzl/pytbon-
eeml/tree/207et35b9c0oo64851249b83o91b5e0506c5ebbo
< CODL Lample
lmport eeml
lmport serlal
# parameters
AP|_KLY = 'YOUR PLRSONAL AP| KLY'
AP|_URL = 'YOUR PLRSONAL AP| URL, L|KL /apl/1275.ml'
serlal = serlal.Serlal('/oev/ttyUS80', 9600)
reaolngs = serlal.reaollne().strlp().spllt(' ') # tbe reaolngs are separateo by spaces
pac = eeml.Pacbube(AP|_URL, AP|_KLY)
pac.upoate([eeml.Data(0, reaolngs[0], unlt=eeml.Celslus()), eeml.Data(1, reaolngs[1],
unlt=eeml.RH())])
pac.put()
Projcci Info
< |T -bttps://gltbub.com/Toobllppe/Lnergy_Logger
< |T Wlkl - bttps://gltbub.com/Toobllppe/Lnergy_Logger#reaome
< Sparktun www.sparktun.com
< Aroulno www.aroulno.cc
< OpenLnergyMonltor - bttp://openenergymonltor.org/emon/
< My RF12 oata bub - bttps://gltbub.com/Toobllppe/Lnergy_Logger/wlkl/Tbe-
RF12-Raolo
< RF12 Raolo on lts carrler -
bttp://www.tllckr.com/pbotos/toobllppe/5665521708/
orc aloui mc
< www.navltas.co.za/toblenortje
Projcci liccncc
< Free as ln really tree... glve us a mentlon ano we are
bappy, but you oon't bave to.
pcnEncrgyoniior info
< OpenLnergyMonltor ls copyrlgbt 2009,2010,2011 tbe OpenLnergyMonltor researcbers (see oevelopers), ano otber
contrlbutors.
< Prlnclpal autbor:
< Trystan Lea
< Ogoronwy, Llantrotben, wyneoo, Nortb Wales, UK, LL48 6D[
< e-mall - trystan.lea@googlemall.com
< OpenLnergyMonltor ls tree: you can reolstrlbute lt ano/or moolty lt unoer tbe terms ot tbe NU eneral Publlc Llcence as
publlsbeo by tbe Free Sottware Founoatlon: eltber verslon 3 ot tbe Llcence, or (at your optlon) any later verslon.
< OpenLnergyMonltor ls olstrlbuteo ln tbe bope tbat lt wlll be usetul, but W|THOUT ANY WARRANTY: wltbout even tbe
lmplleo warranty ot MLRCHANTA8|L|TY or F|TNLSS FOR A PART|CULAR PURPOSL. See tbe NU eneral Publlc Llcence
tor more oetalls.
< For tbls purpose tbe woros "sottware" ano "llbrary" ln tbe NU eneral Publlc Llcence are taken to mean any ano all
computer programs computer tlles lmages oata results oocuments ano all otber copyrlgbt lntormatlon avallable trom tbe
OpenLnergyMonltor project.
< Tbe copyrlgbt covers tbe neologlsm "OpenLnergyMonltor" ln upper, lower, or any ml ot cases ln any typetace, also covereo
by tbe PL. Anyone can use tbem treely ln any way tbey cboose, but tbey may not be reglstereo as traoemarks or restrlcteo
ln any otber way.
< You can reao tbe NU eneral Publlc Llcence bere. Tbls page you are reaolng now lntroouces tbe llcence tor tbe entlre
OpenLnergyMonltor project: tbat llcence applles to all ot lt: lt tbe llnks to tbe llcence oo not work, wrlte to tbe Free Sottware
Founoatlon, |nc., 51 Franklln Street, 5tb Floor, 8oston, MA 02110 , or see
< bttp://www.gnu.org/copylett/gpl.btml
<
< Haroware oeslgns (scbematlcs ano CAD) tlles are llcenseo unoer tbe Creatlve Commons Attrlbutlon-SbareAllke 3.0
Unporteo Llcense ano tollow tbe terms ot tbe OSHW (Open-source baroware) Statement ot Prlnclples 1.0.
< All oocumentatlon on OpenLnergyMonltor ls subject to NU Free Documentatlon Llcense
< Overvlew ot open-source llcenses by Aoatrult bttp://www.aoatrult.com/blog/2009/03/28/open-source-baroware-overvlew-
slloes/
<

You might also like