1. The Purpose (Mission)

  • Monitor, archive and analyze energy consumption in the house
  • Visualize historical consumption data
  • Access data remotely from Web
  • Eventually include data from other sensors, like temperature, pressure, humidity, motion, light, security, etc.

 

2. Components

 

3. Progress Report

 

3.1. Measurement Box

To begin with, I looked at the electrical fuse box in my apartment and noticed that I have 10 or so circuit breakers leading to separate electrical house circuits. I thought that it would be nice to monitor these 10 output lines individually and independently. This way I could have detailed power data as well as compute total house consumption.

Electrical utility box

When I removed the plastic cover, I noticed that there is quite a lot of space under it, so I hoped I could nicely fit all required hardware inside and hide it from view.

 

3.1.1. Hardware

As far as I could see, the original EmonTx approach from OpenEnergyMonitor was to measure current at the input to the breakers. This could be the result of limited measurement speed and/or limited processing power or the Arduino Uno -based hardware. EmonTx has only three current probe inputs with 10-bit resolution. So, instead I decided that I'd need faster processor, more analog inputs and 12-bit ADC resolution. In other words, this Arduino Due board:

 Arduino Due

 

The next logical step was to test wireless communication between this sensor controller and whatever the base might be. For this I purchased a couple of RFM12B modules and a JeeLink from JeeLabs shop:

(NOTE: JeeLink was later replaced with JeeNodeUSB)

RF12B

JeeLink

 

3.1.2. RFM12B library for Arduino Due

As a starting point, I used a great port of RFM12B library to C++ by Felix of LowPowerLab.com

Turned out, this library was not compatible with my ARM-based Due board. So I spent the next few weeks on modifying this code and eventually made it to work on my Due. The files are below. Just unzip this into library folder of the Arduino IDE and don't forget to select Due before compiling ;)

https://github.com/icboredman/RFM12B/tree/arduino_due

Not all functionality has been implemented yet, like sleep mode, but overall it does work.

 

3.1.3. Current / Voltage Sensors

Once I had RF communication working properly between Due and JeeLink, I started working on setting up sensors.

I purchased 12 non-invasive current probes and 1 AC-AC voltage adapter:

SCT013 current probe AC-AC Voltage adapter

Here is a great explanation of Power measurement theory using these sensors.

You can download a complete schematic diagram of my energy monitor here:

EMS schematics

As you can see, I used 22 Ohm burden resistors, which gave me more than enough head room to measure currents up to full range of SCT013 (100A). In addition, to measure line voltage using AC-AC adapter, I adjusted resistive divider to 100K - 6.6K, which slightly reduced resultant voltage range at the Arduino to below 3.3V p-p.

I soldered all components onto this Proto Shield for Arduino MEGA, which also fits perfectly to Due.

 

UPDATE (Jan. 2016):

Following a suggestion to convert the original crude wire-solder design into something that could be easily duplicated and manufactured, I've taken on Fritzing. I must say, it is a pain-in-the-***. Nevertheless, here's the result, if anybody wants to try it:

http://fritzing.org/projects/emontx-shield-for-arduino-due

Warning, I have not tested this Fritzing design myself, so try at your own risk ;)

 

In order to utilize full 12-bit ADC resolution of Arduino Due, I reworked original EmonLib library of OpenEnergyProject. Here's my modified source code:

https://github.com/icboredman/EmonLib/tree/feature/12bit_3phase

This mod also contains 3-phase buffer-and-delay algorithm, since my CT inputs are connected to all three line phases, but my AC_AC voltage adapter is connected to only one of them (obviously).

And finally, here's the Arduino sketch that ties this all together:

EmonTxDue.zip

 

At the end, after adjusting calibration constants, I was able to see this raw dump of sensor data, occurring every 2 sec:

 raw sensor dump

NOTES:

1. The above formatted output was generated using this test sketch EmonRxUno.ino, not to be used in working system.

2. The Arduino sketch for a working RaspberryPi-based system is here: Software

 

3.1.4. Fitting it all inside my fuse box

Here I will let pictures tell the story...

Arduino Due and my EmonTx Shield

My EmonTx

 

EmonTx shield - Top

EmonTx Shield Top

EmonTx shield - Bottom

EmonTx Shield Bottom

 

Fuse box - Before

Fuse box - Before

Fuse box - After

Fuse box - After

 

 

3.2. Data Collection Box - Web Server

3.2.1. Hardware

Raspberry Pi connection setup

All the components above are powered from a single 5V-2A Adapter through the USB Hub, as explained here: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=9070&p=108006
Plus, I found a hub with a very convenient power switch.

I decided to use a Solid State Drive mainly because it is silent, after I got fed up with constant rattling of my old HDD.

I also added a small mod to JeeNodeUSB to measure RSSI from RFM12B when packets are received.

 

3.2.2. Software - JeeNodeUSB

  • Here's the sketch running inside this Arduino-based JeeNodeUSB: EmonRxRPi.ino.
  • The configuration of RF parameters in this sketch is hard-coded. Modifying config at run time through emonhub is not implemented, at this time.

 

3.2.3. Software - RaspberryPi

Individual Circuits dashboard

Daily Consumption dashboard

Live State dashboard

 

 

4. Next Steps

Something to think about...

 


 

 

Comments   

Radovan
+1 # Mr.Radovan 2014-02-11 15:48
Hi, Im folowing your step by creating multichannel energy meter based on Arduino Due. I just got in troubles. Having Arduino running your sketch and sending data via RF12B, Im unable to setup receiving arduino with other RF12B. The matter is, I have no sketch to that receiving site and I have no idea how to write correctly receiving commands. I need simply receive data sent by Due and print them via serial.print to serial monitor. Could you give me some hint, what is the correct syntax of data receiving commands set?
Thanks for any tip.
Radovan
boredman
+1 # RE: Mr.boredman 2014-02-11 18:31
Hi Radovan,
Since as a starting point I used RFM12B library from LowPowerLab, which I modified to work on Due, you would also need to use this library (unmodified version, for Uno) on the receiving end. Here's the link to LowPowerLab's library:
github.com/LowPowerLab/RFM12B
and here's my Uno sketch that uses this library:
boredomprojects.net/images/Articles/HomeEnergy/EmonRxUno.ino
I hope this helps!
Let me know your progress.
EddyBin
# Use of RFM69HW instead of RFM12BEddyBin 2016-11-05 15:30
While collecting the required components I was told that RFM69HW-443-S2 would be backwards compatible with the RMF12B. Would it be a good idea to use RFM69HW-443-S2 in the EmonTx shield?
boredman
# RE: Use of RFM69HW instead of RFM12Bboredman 2016-11-07 07:35
Yes, I've also heard that RFM69 should be backwards compatible. Unfortunately, as far as I know, the existing library will not work with 69 directly, without modifications. I didn't researched this topic enough to understand why. There exist 69 specific libraries, although probably not for Due. You would have to make the mod yourself. Shouldn't be too difficult. The only difference is SPI related stuff.
If you find a way to talk to 69 on Due, please share! :)
rjsc2000
# RE: Use of RFM69HW instead of RFM12Brjsc2000 2016-11-07 09:48
Quoting EddyBin:
While collecting the required components I was told that RFM69HW-443-S2 would be backwards compatible with the RMF12B. Would it be a good idea to use RFM69HW-443-S2 in the EmonTx shield?

I'm also trying to use the RFM69 with the due but i've stopped for lack of time. Maybe on year's end i'll resume it. We could talk more then. And if you find how to do it , please share .
jan
# phasecaljan 2014-07-31 13:37
Some time ago i made an emontx using an nanduino nano running at 3.3V to monitor my 3 phase main (3x CT + voltage monitor).
Since i wanted to monitor some more channels i bought another 4 CT (the nano has only 8 analog inputs, so 1x voltage and 7 times CT)
I used your code (ino from the zip) and changed it to output to serial (no rf) and copied the calib and phasecal for the voltage sensor and the 3 original CT connectors.
However, when calibrating the new ones, i found that phasecal for the new sensor connected to phase 1 was ok (1.00), but the ones connected to phase 2 had to be changed a lot: from 1.28 in the old setup to 16.5 in the new one.
I used old pcb with the voltage and 3old CT's and swapped the nanduino. the 4 new ct's are connecteed to a new pcb via a cat5e wire
Since the first 3 ct's are not easily removed, i cannot recalibrate them to check if the phasecal var is ok.
Do you have any idea why the phasecal changed so much for the new CTs?
boredman
-1 # RE: phasecalboredman 2014-08-01 05:44
Which library are you using? If my modified EmonLib for Due, than this could be the problem. I've never tested it on Nano. Due has a fast 32-bit ARM core. So the weird calibration values could be because of slower 8-bit AVR core in Nano. Try changing the lines 36, 37 and #define PHASE2 and PHASE3 with much lower constants, similar to original Arduino 3phase code.
I hope this helps. Let me know your progress.
Radovan Breuss
-2 # PhasecalRadovan Breuss 2014-08-01 11:13
I completely agree with boredman. I have tested his ino file including modified library at Due platform as well as Mega platform. Settings of correct Phasecal constants for phase 2 and 3 is absolutely crucial. Not only when you switch to different platform, but as well as when you modify anything in ino code, as speed of meassuring loop is very sensitive to some mods. What solved my problem - I have collected all meassured samples of one wave for voltage and current and I made a visualisation of it in MS Excel. Then I modified Phaseshift value 2 and 3 from current values 65 and 130 until both waves in graph were not shifted more. Without this "tuning" you will meassure moreless random numbers. But now, after tuning of phaseshift constants, measured values are very precise. I recommend to invest effort into this tunning
jan
-3 # RE: Home Energy Monitoring Systemjan 2014-08-01 11:52
i am using the library provided on this page (github link) and the ino file listed below (not the one on github wich gives errors)
I changed the values PHASE2 and PHASE3 back to the original 8 and 17, however this did not solve it...it got worse: my phase3 (the old ct) got reversed (negative usage)
@radovan: could you tell me how you did that? (and do you have any idea why the original one does not have this problem, or is it because of moving from 3CT to 7CT?
jan
+1 # RE: Home Energy Monitoring Systemjan 2014-08-01 11:59
one difference cought my eye: line 175: if(numberOfSamples==0) is in the original source ==1
any reason to change this?
boredman
+1 # RE: Home Energy Monitoring Systemboredman 2014-08-01 13:08
Quoting sennesael:
one difference cought my eye: line 175: if(numberOfSamples==0) is in the original source ==1
any reason to change this?

I thought it would make more sense to initialize lastVCross on the very first cycle, rather than on the second. Either way, this makes not much difference.
Radovan Breuss
# RE: Home Energy Monitoring SystemRadovan Breuss 2014-08-01 12:03
I would definitely start with easy check: Try to calculate, how many samples it collects during one cycle (one voltage wave). put in code simple counter, how many times main meassuring loop goes through during one wave. Then important check is, whether or not is that samples number stable in time. My problem was, it counted 400 samples in one cycle and 600 in another. Number of samples MUST be consistent in time. If it is stable, calculate one third and two third of sample amount and you have rough values for Phasecal 2 and 3.
jan
# RE: Home Energy Monitoring Systemjan 2014-08-02 09:07
I enabled the debugging lines in the CPP file (lines 186/187/188).
I am getting 434/408/408/407/436/407/407 samples per run. powersamples:364/338/338/338/3 65/339/339. Crosscount is always 16.. these with phase2=8 and phase3=17
With these numbers i am getting a negative value on fase3
Is this consistent enough? if so, what values of phase2 and phase3 should i use (1/3 and 2/3 of 408) locks up the atmega...
jan
# RE: Home Energy Monitoring Systemjan 2014-08-02 12:30
little update: i found out that by setting phase2= 16 and phase3 = 34 (the double of the original settings), i am getting a PF of 1.00 with the same phasecal's as the original coding. The calibration value for the new CT is also in the right environment.
However, is there a way of knowing if the settings are right? Radovan: you wrote something about putting values in excell? could you please explain a bit more?
Radovan Breuss
# ExcelRadovan Breuss 2014-08-04 07:02
Sure. Create two int arrays and save to them samples of voltage of phase 1 and current of Phase 2 or 3 (after phasecal correction) during main measuring loop. Then, after end of loop, send these values to serial.println and capture them with terminal (i know, its very primitiive solution, but it works :-)). And at the end, import captured values into Excel table and draw graphs with sin waves of Voltage and curent. If your Phasecal is correct, these two sin waves shlouldnt be shifted to each other. Thats it. And just to remind, you HAVE to use pure resistive load for this calibration!
jan
# Excelljan 2014-08-04 19:39
Am i correct to understand to store the following values from EmonLib_3PJ.cpp to arrays:
- voltage: filteredV from line 117 (this is befor the phase correction, but after the hight pass filters)
- phase 2 or 3: instP from line 158
boredman
# RE: Excellboredman 2014-08-04 20:31
I think Radovan probably meant to compare phaseShiftedV and filteredI (after phase calibration). You can save both after line 153. No need to store instP, I think.

Radovan, how many CT sensors were you able to successfully run on ATMega at the same time?
Radovan Breuss
# RE: ExcellRadovan Breuss 2014-08-05 06:54
Yes, exactly, Compare ShiftedV (for Phase 2 and Phase3 individualy) with filteredI. instP is no significant for this purpose. Line 153 seems to be a good place for buffering them. And then, after line 190, during post loop calculation is the right place for their Serial.println (to not slow down main loop).
Or you can collect directly raw samples (sample V and sample I) and to calculate phaseshift in Excel. Both is possible.
I tested at maximum 7 sensors (I had no more of them at that moment), but its not crucial. Your code has a good algorithm, its timing is controlled by voltage frequency. So it is independent on CPU speed. At slower platform it collects less samples, at faster more of them. ATMEGA speed is from my point of view more than enough even for 15 CTs+ 1 Voltage sensor. Advantage of Due is 12 bit AD resolution. Total measurement time is not related to platform CPU speed.
jan
+1 # RE: Excelljan 2014-08-06 13:21
I am getting the following result (picture) when i am omitting the first readings. The problem is that the arduino crashes after a few cycles, i suppose because of the 2 big (250) int arrays
Am i correct that this is a good result?
www.hetgrensland.be/.../
Radovan Breuss
# RE: ExcellRadovan Breuss 2014-08-06 13:28
From Phaseshift point of view is it good result. But what is suspisious is that first wave with sharp point. Next three waves are OK, but that first one is strange.
Try to change related phaseshift value now, whether or not sync of blue and red waves will be shifting too.
jan
# RE: Excelljan 2014-08-06 16:31
I found it strange that the first 70 orso values were always the same and rubbisch...
I used the varibalble numberofsamples to put the measurements in my arrays... when i used one of my own, i now get nice sin waves (see picture).
Should i still try to change the phaseshift values, of is it good like this?www.hetgrensland.be/graph fase22.jpg
jan
# RE: Excelljan 2014-08-06 16:36
now the correct picture:www.hetgrensland.be/gr aphfase3.jpg
jan
# RE: Excelljan 2014-08-06 16:46
I did the same for the 3th phase.
Here it seems that there is a small error: it does not cross through 0 at the same point. Any ideas how i should adjust phasecal3 of should i just experiment?
www.hetgrensland.be/.../
Radovan Breuss
# RE: ExcellRadovan Breuss 2014-08-07 05:44
Check data columns in Excel, for how many samples are zero crossings of both wave shifted to each other. And change related phasecal constant for this number. If this difference is less than one sample, let it be.
One hint for your further development - for fine tunning I used little serial OLED display instead of boring Excel procedure. I draw my sinewaves in real time then, with phasecal value changing slowly as a control variable of FOR cycle command. Then you can sit in your chair and watch your little TV :-) with two sinwaves shifting slowly to each other and you can catch the right value of phasecal...
Radovan Breuss
# RE: ExcellRadovan Breuss 2014-08-07 05:47
And one more hint - try to multiply red sinwave samples by some constant to get bigger amplitude. When amplitudes of both waves are comparable, you can get sharper image of crossings area...
rsiedl
# Code examplersiedl 2018-05-11 06:04
Quoting rbreuss:
Compare ShiftedV (for Phase 2 and Phase3 individualy) with filteredI. instP is no significant for this purpose. Line 153 seems to be a good place for buffering them. And then, after line 190, during post loop calculation is the right place for their Serial.println (to not slow down main loop).
Or you can collect directly raw samples (sample V and sample I) and to calculate phaseshift in Excel. Both is possible.


Hi, I am coming from a different programming language (PERL) and cant work out how to buffer (store in array/hash?) the phaseShiftedV an filteredI, for printing out after the main loop.
Would it be possible to provide any code to achieve this?
Cheers,
Reagen
boredman
# RE: Code exampleboredman 2018-05-14 17:37
Hi Reagen,
Here's one way to do that:

1. add at line 79:
//declare temporary arrays for storing raw data:
double storedShiftedV[PHASE3];
double storedFilteredI[PHASE3];

2. add at line 159:
//store V and I samples for dumping later:
storedShiftedV[numberOfPowerSa mples%PHASE3] = phaseShiftedV;
storedFilteredI[numberOfPowerS amples%PHASE3] = filteredI;

3. add at line 194:
//dump stored samples:
Serial.print("numberOfPowerSam ples="); Serial.println(numberOfPowerSa mples);
Serial.println("Shifted-V\tFil tered-I");
for(int i=0; i
boredman
# RE: Code exampleboredman 2018-05-14 17:53
Comment won't let me enter proper code :)
Here's a link to complete file:
boredomprojects.net/.../...
boredman
# RE: Code exampleboredman 2018-05-15 05:12
Oops! Just found and fixed a mistake in file :-)
rsiedl
# RE: Code examplersiedl 2018-05-18 02:09
Thank you very much.
I've just uploaded to the due and it works fine for a few samples and then starts getting odd results. Here is the output:

numberOfPowerSamples=3982
Count,Shifted-V,Filtered-I
0,1001.37,-0.76
1,1004.54,-0.76
2,995.04,0.24
3,989.07,-0.76
...[truncated for comment]
60,1038.93,0.22
61,1039.16,-0.78
62,1029.52,-0.77
63,1023.41,0.22
64,1025.79,-0.77
65,1012.83,-0.77
66,1013.26,0.23
67,1011.89,-0.77
68,-0.76,0.00
69,-0.76,0.00
70,0.24,ovf
71,-0.76,ovf
72,1.24,0.00
73,1.23,0.00
74,-0.77,ovf
75,-1.76,0.00
76,-0.76,0.00
77,0.24,nan
78,1.24,0.00
79,1.23,0.00
80,0.23,ovf
81,0.23,-0.00
82,-0.77,0.00
83,0.23,-0.00
84,-0.76,0.00
85,-0.76,-0.00
86,-0.76,0.00
87,1.24,ovf
... until the next cycle then repeat
Update: seems like it is always going odd on count 68 (each cycle)
rsiedl
# Memoryrsiedl 2018-06-08 07:33
I think my issue is lack of memory. I've seen it mentioned that others are getting around 400 power samples per cycle but I seem to be getting around 4000. Does this seem right?
boredman
# RE: Memoryboredman 2018-06-09 08:08
Hm... no, that doesn't seem right.
Are you using Due or some other board?
What are your PHASE2 and PHASE3 constants set to? For Due they should be around 65 and 130, which represent nr. of samples for 120° and 240° of a cycle. That's why 2 cycles of data should be around 400 samples.
Also, make sure you set ADC to 12 bits with analogReadResolution() call, as in the example sketch.
rsiedl
# Calibrationrsiedl 2019-12-04 09:12
Hi,
I've come back to this & have it all working but still trying to figure out calibration. How do you know which wire (red/white/blue) is which phase? I used this link: i.stack.imgur.com/HUD42.jpg (I'm in Australia) but my PH2 & 3 calibration numbers are quite large in order to achieve sensible numbers, and PH3 reports as negative. A0 is spot on, as is the voltage (which is connected to the same phase as A0/Red), using a 2000W kettle.

emon[0].voltage(11, 348.0, 1.6, 1);//RED
emon[0].current(0, 98.8);
emon[1].voltage(11, 348.0, 2.0, 2);//WHITE
emon[1].current(1, 820.0);
emon[2].voltage(11, 348.0, 3.0, 0);//BLUE
emon[2].current(2, 220.0);

emon.calcVI(16,2000);
EmonTx.voltage = (float)emon[0].Vrms;

Results:
V: 243.24
A0 rP: 1733.49
A1 rP: 1723.25
A2 rP: -1796.23

I used the same CT clamp for each calibration & ensured it was clipped on in the correct orientation.
rsiedl
# Power samplesrsiedl 2019-12-04 09:13
Also, after rebuilding my prototype board onto your Fritzing board, am still getting in the order of 4000-5000 power samples/cycle. As I've rebuilt it, I am ruling out a short anywhere which could be doing something funky.

Start: 613 millis
numberOfSamples=5438
numberOfPowerSamples=4332
crossCount=16
End: 773 millis
Start: 773 millis
numberOfSamples=5328
numberOfPowerSamples=4226
crossCount=16
End: 933 millis
Start: 942 millis
numberOfSamples=5378
numberOfPowerSamples=4270
crossCount=16
End: 1102 millis
I'm using a Due and have set 12 bit resolution. PHASE2 is set to 65 and PHASE3 is 130, but as my sample size is so large, perhaps these numbers are not right?

Do you have any ideas on what I should look into next? Maybe I need a script to test the resolution of my Due?

Any help would be greatly appreciated. Cheers!
rsiedl
# Clampsrsiedl 2019-12-04 09:18
the only other thing i can think of is I've got 30A CT clamps. Would that make a difference?
Sorry for so many posts! :)
xekon
# can you confirm that you added this line?xekon 2019-12-04 19:17
can you confirm that you added this line?

analogReadResolution(ADC_BITS);
rsiedl
# confirmation ADC_BITSrsiedl 2019-12-05 00:02
Hi, thanks. Yes I have:

analogReadResolution(ADC_BITS); // DUE can have up to 12 bits of ADC resolution

and have confirmed it is detecting the arm architecture and being set to 12, as per:

#if defined(__arm__)
#define ADC_BITS 12
#else
#define ADC_BITS 10
#endif
drinu16
# Powerdrinu16 2014-08-21 11:13
Hi, Could you please tell me why did you use Real Power and not Apparent Power ?

Thanks
boredman
# RE: Powerboredman 2014-08-22 05:51
Hi Darren,
Real Power, as I understand it, is a measure of power doing actual work. Whereas the Apparent Power also includes a component of Reactive Power in it, which produces no actual work. Besides, if I'm not mistaken, the utility company meters and bills us based on Real Power.
Here's a nice explanation about this topic: openenergymonitor.org/.../...
Cheers!
drinu16
# RE: Powerdrinu16 2014-08-22 16:35
Quoting boredman:
Hi Darren,
Real Power, as I understand it, is a measure of power doing actual work. Whereas the Apparent Power also includes a component of Reactive Power in it, which produces no actual work. Besides, if I'm not mistaken, the utility company meters and bills us based on Real Power.
Here's a nice explanation about this topic: openenergymonitor.org/.../...
Cheers!


Ahh yes that does make sense :)

Thanks for explaining and the extra info
drinu16
# Electricity Unitsdrinu16 2014-08-29 17:49
Hi, Could you please tell me how you calculated the kWh in your graph above ? Did you get a reading every second until 1 hr has passed and then take an average of the readings of that 1 hour and divide by 1000 ?
boredman
# RE: Electricity Unitsboredman 2014-08-31 07:08
Actually, this is a built-in function of EmonCMS software that is running on my server. Check it out here:
emoncms.org/.../inputsandfeeds
jdriesen
-1 # question about your fuseboxjdriesen 2014-09-11 15:47
hi boredman,

Are you in a 3 phase 110v location by any chance?

Jos
boredman
# RE: question about your fuseboxboredman 2014-09-11 20:44
No, 220v, actually.
Arnaud
# JeeLink 868 no more availableArnaud 2014-11-13 22:26
Thank you very much for this tutorial :-)

However, the JeeLink 868 is no more available in JeeLabs shops. Have you any clue for an ersatz ?

Thank you very much in advance,

Arnaud
boredman
# RE: JeeLink 868 no more availableboredman 2014-11-14 08:44
Hi Arnaud,
Right, JeeLink seems to be sold out, but, actually, I used JeeNode USB instead. It is very much the same thing, except without the case. digitalsmarties.net/.../...
Arnaud
# RE: JeeLink 868 no more availableArnaud 2014-11-17 08:54
Thank you very much for your answer :-)
Arnaud
# RE: JeeLink 868 no more availableArnaud 2014-11-17 08:58
By the way, for a simpler system with one sensor and 1 hour data logging and wireless display, there is the Chacon EcoWatt 850 (this is a belgian firm)
WalterIta
# Info for JEEnodeWalterIta 2014-11-27 16:43
Hi Boredman,
Thanks a lot for the project. I'm making.
I want to ask if I can takehttp://shop.seegel-systeme .de/Module/Raspberry-RFM-SMA.h tml this instead of Jeenode ( digitalsmarties.net/.../...)

Thanks a Lot
Walter
boredman
# RE: Info for JEEnodeboredman 2014-11-29 17:53
Hi Walter,
I'm sure it is possible. Although you will need to install a custom script to the Pi to get it to work. I have no experience with it, but you may try python script from the bottom of this page:
www.seegel-systeme.de/.../
WalterIta
# Thanks...WalterIta 2014-11-30 17:03
Thanks a lot for your answer... and for your project ..
great...
Walter
Smitha673
# JohnSmitha673 2015-01-12 05:47
Howdy! Would you mind if I share your weblog with my twitter group? Theres lots of people that I think would truly enjoy your content material. Please let me know. Thanks fadcedgfedkddbgb
boredman
# RE: Johnboredman 2015-01-12 06:33
Of course. I don't mind.
Thanks, John!
Ricardo
# RE: Home Energy Monitoring SystemRicardo 2015-02-04 16:58
Hi
Can you tell me if the ATmega2560-16AU Board and Mega 2560 R3 Module are compatible with your sketch?

Or can the due be replaced with a cheaper alternative?

Thanks
boredman
# RE: Home Energy Monitoring Systemboredman 2015-02-08 15:29
Hi Ricardo,
The sketch is probably compatible, however the RFM12 library is definitely not. You might need to use original library for uno from lowpowerlab. Also, the 3-phase current algorithm may need to be redone to work on uno board. See previous comments by Radovan on this subject.
dutuc
# RE: Home Energy Monitoring Systemdutuc 2015-02-12 10:16
Monitor the energy production of a wind turbine with GREEN POWER METER : instructables.com/.../...
Meijer
# RFM12B libraryMeijer 2015-02-17 13:36
Hello,
Hope that you can help with the following...
I'm not able to get the RF link running using the RFM12B library from lowpowerlabs on a Arduino Uno and the RFM12b_Due on the Arduino Due board. I'm using the Jeenode USB on a windows PC together with Python to "Listen". WHen I use the Arduino Uno together with the Jeelib library, I receive data fine on the windows PC. The example test sketches supplied with the Jeelib libraries work. As soon as I switch to the RFM12B libraries from Lowpowerlabs, and use one of the test sketches here, then I receive nothing on the windows PC. The RFM12B sketches compile normally and on the serial output it shows it is transmitting data. What could be wrong?
boredman
+1 # RE: RFM12B libraryboredman 2015-02-17 16:24
Hi Gerard,
There could be numerous things that go wrong. I would try to isolate the problem by putting original lowpowerlab library on both JeeLink and Uno. If that works, the receiving end is not the problem. Then, I would replace the transmitter with Due and the modded library, leaving receiver untouched.
Please try it and let me know what you find.
Meijer
# RFM12B libraryMeijer 2015-02-17 18:32
Thank you very much. I did not know the two libraries were incompatible. You have put me in the right direction... I uploaded the lowpower receive sketch in the Jeelink and it receives fine.
Meijer
# scrambled outputMeijer 2015-02-17 21:27
Hello once more,
After testing the RFM12B link with the send and receive sketches, which worked fine, I tried the EmonTxDue.
On the receiving side, I recognise the node nr. but the rest seems scrambled. Please see the screenshot.
Could you give me another pointer in the right direction please?
Kind regards, Gerard.
D:\Users\Gerard\Documents\Arduino\libraries\EmonTxDue\screendump.jpg
boredman
+1 # RE: scrambled outputboredman 2015-02-18 09:56
The fact that the messages are coming through indicates that they are being received correctly. Internal CRC check is verified. I would look into problems in displaying the messages on receiving end (SCI baud rate?) or encoding them on the transmitting end. Try sending over very simple messages, like one character long. What do you see then?
Meijer
# scrambled outputMeijer 2015-02-18 15:50
When I change in the receive.ino from lowpowerlabs char to float, then I get numeric characters.
Serial.print((char)radio.Data);
But per 10 sensors I get much more data, than 10* power plus one time voltage plus timer.
I'm very much a newbie to software... Can you please let me know what sketch you are using on the receiver side or perhaps send me a copy?
boredman
+1 # RE: scrambled outputboredman 2015-02-21 16:35
Hi Gerard,
Here's my receiving sketch: boredomprojects.net/images/Articles/HomeEnergy/EmonRxUno.ino
If you still have problems send me your sketch and we will take a look.
PVi1
# RE: scrambled outputPVi1 2015-03-01 21:47
Hello Boredman,

please, can you post nodes section of your emonhub.conf? I have a problem to define datacodes.

I have used receive section of your EmonRxUno.ino.

My emonhub.log contains these errors:
2015-03-01 21:40:36,239 DEBUG Setting RFM2Pi frequency: 868 (8b)
2015-03-01 21:40:37,243 DEBUG Setting RFM2Pi group: 210 (210g)
2015-03-01 21:40:38,247 DEBUG Setting RFM2Pi baseid: 1 (1i)
2015-03-01 21:40:39,269 DEBUG 1 NEW FRAME : 1425246039.27 [20] time: 10517
2015-03-01 21:40:39,272 WARNING 1 Discarded RX frame 'non-numerical content' : ['[20]', 'time:', '', '', '', '10517']
2015-03-01 21:40:39,478 DEBUG 2 NEW FRAME : 1425246039.48 Voltage: 1.55
2015-03-01 21:40:39,481 WARNING 2 Discarded RX frame 'non-numerical content' : ['Voltage:', '1.55']
...

Thank you for your response in advance.
boredman
# RE: scrambled outputboredman 2015-03-02 19:44
Hi,
Sorry, I guess I wasn't clear which sketch is meant for what purpose. The above sketch EmonRxUno.ino was only meant to be used for debugging purposes. In a working system based on emonhub, you will need a different sketch. Here it is: boredomprojects.net/images/Articles/HomeEnergy/EmonRxRPi.ino
I updated the main article now to make this point clear.
I think this should work now. Let me know.
PVi1
# RE: scrambled outputPVi1 2015-03-02 23:16
Hi boredman,

thank you for your response.
I have edited my receiving sketch - have to remove radio.getrssid and radio.getgroup, because they are not in original lowpowerlabs rfp12b lib.
My sketch is here:
pastebin.com/fi8PXGM9

I have set emonhub.conf nodes section this way:
datacode = h

Now I can see 21 inputs in emoncms. First one is Mains voltage I hope, but it is getting me numbers around 23-33. Should I do any conversion? I am getting about 1,63V according to my multimeter on A11 input of my due.

Thank you for your help.
boredman
# RE: scrambled outputboredman 2015-03-03 14:16
Yes, on line 179 of your sketch, the voltage is multiplied by 10, before being sent over to EmonCMS. I did that to get rid of decimal point. So, in your Input processing section of emoncms you should multiply it by 0.1, then you should get your correct voltage. In the example you gave it will be 233.3V.
PVi1
# RE: scrambled outputPVi1 2015-03-03 23:03
Hi boredman,

thank you for your support.
Two changes I have made recently were to change the number of sensors to 11 and change AC-AC input PIN(mine is on analog9) in Due setup section. Now it works fine!

Thank you very much.

Peter
boredman
# RE: scrambled outputboredman 2015-03-04 06:53
Thanks, Peter.
I'm glad to hear that!
Meijer
# Scrambled outputMeijer 2015-02-22 00:56
Thank you! hesketch is very helpfull!
gfndms
# web servergfndms 2015-03-12 10:51
sir the picture showing data collection bus have the all setup using resberry pi. i am confused about emonTx shield. it is used for collecting inputs from the CT. then where u have placed the wireless connection In ARDUINO setup to send that data to the cloud
boredman
# RE: web serverboredman 2015-03-13 08:06
Hi. I'm confused about your question. The emonTx shield contains RFM12B module, which is used to transmit data to JeeNodeUSB, attached to RaspberryPi. Look at the picture of emonTx shield bottom. You can see the module there.
I hope this helps.
jiyojolly
# 12 bit resolution and Using spark core instead of arduinojiyojolly 2015-03-12 13:21
I wanted to use 12 bit resolution in my implementation in which i used Spark core(arduino compatible wifi enabled board) but cant get the code to compile..it gives me "energy_monitoring_only.cpp: In function 'void setup()':
energy_monitoring_only.cpp:9:32: error: 'analogReadResolution' was not declared in this scope"
error... Please help
Spark core has 12 bit adc...i checked
boredman
# RE: 12 bit resolution and Using spark core instead of arduinoboredman 2015-03-13 08:19
Hi jiyojolly,
Interesting device! I've never heard of Sparc core before, but now reading about it, it looks very cool. I'm afraid I'm unable to help here. Perhaps people who have experience could answer your question?
I will study the docs, in any case. If I think of anything I will post here.
gfndms
# web servergfndms 2015-03-17 13:24
hmmmm. yes i got the point.thanq very much :lol: :lol: :lol: :lol: :lol:
gfndms
# EmonTx shieldgfndms 2015-03-17 13:39
hii sir, the emonTx showing above in the images can support 12 CT sensors, but in your shop , only 4 CT sensor supporting emonTx are available. i want to detect the data from 10 different connections. how i can do it with the emonTx having only 4 ports for CT?? :-| :-|
gfndms
# Resberry Pigfndms 2015-03-19 05:00
Can you tell me which Model of Raspberry Pi is in this Image??
boredman
# RE: Resberry Piboredman 2015-03-19 06:52
Raspberry Pi (original) Model B Revision 2.0
Radovan Breuss
# RE: Home Energy Monitoring SystemRadovan Breuss 2015-04-06 11:50
Hi Boredman,

I like you dashboards, you created in EMONCMS. But Im probably blind. How you made that third dashboard, kind of schematics with lines (wires), their nodes and with schematic pictures of house equipment? Did you created it in EMONCMS or with some other tool? Im unable to find those lines, nodes and pictures in EMONCMS menu. Could you share with me your know how, please? :-)

Thanks

Radovan
boredman
# RE: Home Energy Monitoring Systemboredman 2015-04-09 05:55
Hi Radek,
It was real pain in the ass, actually. It is just a picture: boredomprojects.net/images/Articles/HomeEnergy/plan4_2.png. And the light bulbs are LED elements. The difficult part was to align everything. For this I took a capture of dotted background and drew my lines according to it, using MS Paint. LED colors are controlled from EVENT commands, depending of values of various power feeds.
I hope this helps.
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-05-27 14:03
Bonjour Boredman,

Excellent projet!
J'ai 3 sensors CT différents (YHDC) :
TA17-08
TA12-100
SCT013-030
Que je veux d'abord tester.
Je veux les mettre sur la MEME PHASE! (vérification-étalonnage!)
1-Dans exemple" ArduinoDue_3phase" peut-on utiliser un Arduino Mege 2560?
2-Dans "ArduinoDue_3phase ligne 19:
Message error: analogReadResolution(ADC_BITS) ; no
identify in the scope. (avec Mega 2560!)
Merci beaucoup de me répondre.
Georges
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-05-27 14:12
Ich kann besser Deutsch... sollte es nicht klar...
Danke!
boredman
# RE: Home Energy Monitoring Systemboredman 2015-05-27 16:52
Bonjour Georges!
2. The function AnalogReadResolution() is only available on Due, not on Mega 2560. arduino.cc/.../...
So, try commenting out this line and the code should default to 10 bits ADC resolution. It is not ideal, but it should work.
1. The RFM12 library is also not compatible with Mega, so you might need to use original library from lowpowerlabs. See some earlier comments by Radovan.
Sorry for English :)
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-05-29 08:44
Vielen Dank fûr die Erklärungen!
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-05-29 13:59
Hallo,

Bei ArduinoDue_3pase.ino:

emon[0].voltage(11, 334.0, 2.0, 2); // Voltage: pin, calib, phasecal, line phase.
Verstehe ich nicht:
11=A11=ok!
334.0= calibration=eichung=ok!
2.0=phasecal=??
2=line phase=phase Nummer in einem 3phasen system??
Vielen Dank für die Antwort!
Georges
boredman
# RE: Home Energy Monitoring Systemboredman 2015-05-30 09:05
Hallo Georges,
> 2.0=phasecal=??
openenergymonitor.org/.../...
> 2=line phase=phase Nummer in einem 3phasen system??
Genau! 1. phase muss der mit Spannungsadapter sein.
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-06-02 04:09
Hallo boredman,

Kleine Frage fûr die CT hast Du die SCT-013-000 (100A) ohne Rburden oder SCT-013-030 (30A) mit Rburden?
Vielen Dank!
Aus La Reunion
Georges
boredman
# RE: Home Energy Monitoring Systemboredman 2015-06-02 19:20
Die erste, 100A, ohne R burden.
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-06-05 12:25
Hallo boredman,

Meine Strommesung scheinen mir falsch!
Im hauptprogram steht:
emon[0].current(0, 97.7); Ich habe meine Eichung mit einer Kaffemaschine (1000W) I=4,13A U=222V
durchgeführt.so musste ich die Eichung auf 89 einstellen.
Bishir alles Ok. Aber stelle ich die KMaschine ab, Strom aus, messe ich immer noch I=0,24A !!
Wie kommt das?warum nicht 0?
Habe die "OpenEnergieM.."gelesen aber keine Spurr!
Habe alles gleichgebaut wie vorgeschrieben (Schaltugen, SCT013-000 (Rl=22 Ohms-U=3,3V) ausser Arduino mega 2560.
Bei der "Voltage" Messung ist alles OK! (Eichung=343)
Ich brauche Hilfe,
Vielen Danke im voraus, und noch bravo!
gruss.
Georges
boredman
# RE: Home Energy Monitoring Systemboredman 2015-06-07 08:19
Hi Georges,
Are you measuring 0.24A with or without Koffee machine connected? If with - the machine may still draw some current in OFF state. What do you measure with CT disconnected? If without - the problem may come from the fact the the library may not be compatible with Mega. To fix this, you may need to adjust constants PHASE2 and PHASE3 in EmonLib_3PH.h file. The values 16 and 34 might be a good start, Look at some earlier discussions in this thread.
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-06-12 13:47
Ich habe versucht aber nichts.
Ich habe mir ein ArduinoDUE zugelegt und alte Lampen angeschlossen (Widerstand)=cos phi=1+ arduinoDue und das "ArduinoDue_3phase" probiert.
1 Lampe: I=0.27A cos phi= 0.76 (L=60W).
2xLampen (>60W) I=0.56A cos phi= 0.76
1lampe+1x ecowattlampe I=0.40A cos=0.64 (nimmt ab ist ok!)
So bleibt also cos phi auf dem högsten Punkt= 0.77
Schalte ich die Lampen aus I=0A so stellt sich der cos auf 0 ein=stimmt auch

Fragen: Meine Haus liegt auf einem Monophasensystem, spielt dass eine Rolle 3phasen?
Also warum nicht cos phi=1?
Georges974
# RE: Home Energy Monitoring SystemGeorges974 2015-06-16 05:32
Hallo,
Soweit so gut es ist alles gut.
Ich habe wieder alles von vorn angefangen, so habe ich gemerkt das ich der Fehler war.
Also es funktioniert!
Ich möchte mich entschuldigen...
Und noch Vielen Dank fûr dein Projekt!
Gruß
Georges
boredman
# RE: Home Energy Monitoring Systemboredman 2015-06-17 07:55
Es freut mich sehr, Georges.
Viel Spaß! :)
hemertje
# RE: Home Energy Monitoring Systemhemertje 2015-07-21 21:47
Hi Boredman,

i have the same setup as you, a fusebox with 10 pieces of 230V circuits...

i have very little space in my fusebox, so i want to use the Honeywell CSLT6B100 5mm current sensors (solid).

sensing.honeywell.com/.../

Is this possible?
What needs to be adapted to the electric Arduino board (resistors etc) for normal functionality...?

Greetings...
boredman
# RE: Home Energy Monitoring Systemboredman 2015-07-24 18:25
Hi Hemertje,
I think it might be possible. The only two things I can think of is: 1) since it is not a clip on, you will need to disconnect your line, thread it through this sensor and reconnect it. Not that easy. 2) you need a separate 5V supply for it, if you are using a 3V Arduino.
The circuit may look like that:
hemertje
# RE: Home Energy Monitoring Systemhemertje 2016-01-29 20:09
Quoting boredman:
Hi Hemertje,
I think it might be possible. The only two things I can think of is: 1) since it is not a clip on, you will need to disconnect your line, thread it through this sensor and reconnect it. Not that easy. 2) you need a separate 5V supply for it, if you are using a 3V Arduino.
The circuit may look like that:


can your current Fritzing board be used with above CSLT components as we discussed earlier?
boredman
# RE: Home Energy Monitoring Systemboredman 2016-01-30 08:49
Not as it is. You would need to rework the design. For example, each input circuit might look like this:

Arduino Due also has 5V supply on one of its pins.
hemertje
# RE: Home Energy Monitoring Systemhemertje 2015-07-24 21:30
thx for your reply!

disconnecting and connecting the 230V lines isn't a problem, i'm a 230/400V electric engineer but designing electronics isn't my speciality ;-)

just found the Brultech CT's, these are "ready to use", so no need to build them myself. can i use the same capacitor 10uF & resistances 100k/100k ratio for these Brutech CT's as for the Honeywell CT's?

brultech.com/.../...
boredman
# RE: Home Energy Monitoring Systemboredman 2015-07-25 07:03
Ah, these are Current Transformers, so you'll need to use the normal connection circuit (cap to GND). I couldn't find detailed datasheets on the brultech site, so I don't know if they have burden resistor built in or not. Also, it is unclear if they have over voltage protection. Be careful if you decide to use them. The burden resistor for 40A type can be in a range of 42 Ohm, or so.
hemertje
# RE: Home Energy Monitoring Systemhemertje 2015-07-25 18:56
Quoting boredman:
Ah, these are Current Transformers, so you'll need to use the normal connection circuit (cap to GND). I couldn't find detailed datasheets on the brultech site, so I don't know if they have burden resistor built in or not. Also, it is unclear if they have over voltage protection. Be careful if you decide to use them. The burden resistor for 40A type can be in a range of 42 Ohm, or so.


are you referring to Honeywell or Brultech ;)
boredman
# RE: Home Energy Monitoring Systemboredman 2015-07-26 05:53
Honeywell are Hall effect sensors with built in conditioner circuit. The only thing needed is level shifter to 3.3V, so you need to use the new connection circuit I recommended (series connected cap).
The Brultech are Current Transformer type, so you need to use standard connection circuit (cap to gnd) with burden resistor of about 42ohm.
I would not recommend Brultech. Detailed description is missing.
Radovan
# RE: Home Energy Monitoring SystemRadovan 2015-07-26 07:47
Hi together, guys. I have also started my project with this great solution from Boredman. And I confirm, it works great. But I used it just for measuring consumption of heat pump, so I used only three inputs (three phases wiring). After sometime I found on Aliexpress great device SDM630M - complete three phase energy meter under $100 including shipping. It has standard MODBUS interface and measures alot of consumed energy parameters. It is available also in single phase variant and I bought already 5 of them for various projects. When you read data from SDM630 with MODBUS by mini arduino (or DUE for larger projects) equiped with ESP8266 chip, you get a great device, which is sending data from energy meter directly via WiFi to Emoncms. You can eliminate this way RF12 link and whole system landscape and its communication is very transparent and standardized then.
hemertje
# RE: Home Energy Monitoring Systemhemertje 2015-07-26 18:38
another question, regarding measuring my water consumption, on my existing watermeter a pulssensor Falcon PR6 can be added, see

elster.nl/.../...

do you see possibilities to to connect it to the arduino due and get it working measuring and registration together?
boredman
# RE: Home Energy Monitoring Systemboredman 2015-07-27 06:35
I am not familiar with pulse counting, so I can not answer your question. I recommend reading openenergymonitor.org/.../....
Good luck!
hemertje
# RE: Home Energy Monitoring Systemhemertje 2015-07-28 20:05
thx, for your help so far, wil have a look for this project after the holiday season ;-)
Ricardo
# Calibration valuesRicardo 2015-09-21 11:31
Hi

How did you do the calibration? Had to do in the fuse box with everything installed? and so how do you know the values are correct?
Or did you calibrated outside with some power meter ?

Thanks
boredman
# RE: Calibration valuesboredman 2015-09-22 06:31
Hi Ricardo,
I calibrated each input separately, before intalling the system into the fuse box. I used a 1000W electric kettle (purely resistive load) and a multimeter (voltmeter + ampermeter). You can find detailed description of the procedure here:
openenergymonitor.org/.../...
Ricardo
# RE: Calibration valuesRicardo 2015-09-22 13:05
I've calibrated all at the same time and all connected to the same wire . The load was a series of 60W incadescent lamps so that the power factor was 1. I used a kill-a-watt like device to measure the current and the voltage.

But when i put them connected on a TV and a cable box, the values were all wrong.
boredman
# RE: Calibration valuesboredman 2015-09-26 15:40
I wonder if perhaps your series of 60W bulbs is still not enough. It is desirable to calibrate using a high power load, since the measurement errors are largest at the lowest load power. That's why I used 1000W kettle.
Also, what do you mean TV and cable box values are wrong? As you know, such loads are very reactive (factor < 1.0).
Ricardo
# RE: Home Energy Monitoring SystemRicardo 2015-09-28 08:52
I tested with about 240 W worth of incandescent .lamps. The values weren't exact and i attribute that to the error at low power. So i put the best i could and connected the sensors to the fuse box and started the measurements.
The numbers look good.
I've realised we can't have a high degree of accuracy, and the diference is in some watts. When you spend several Kws per day, it won't matter much,
Meijer
# power factor for phase 2 and 3Meijer 2015-11-27 01:40
Hello Boredman,
When I load phase 1 with a resistive load, the power factor goes perfectly to 1. If I put the same load on phase 2, and I adjust the Phase 2 sample delay to maximise the power factor, I only get to a maximum of 0,97.
If I put the same load on phase 3, and I adjust the Phase 3 sample delay to maximise the power factor, I only get to a maximum of 0,95. How can I get the power factor to 1 for pure resistive loads on phase 2 and phase 3?
I do find the phase 2 and phase 3 delay quite different from the original 65 and 130. I have 213, 426. I am using the Arduino due and 11 sensors.
boredman
# RE: power factor for phase 2 and 3boredman 2015-11-27 17:05
Hi Gerard,
Considering normal measurement error, I wouldn't worry about these differences. To me, 0,95 0,97 and 1,00 look very much the same. I'd say these results are pretty good.

As far as your delay constants, could it be that you have them 2x or even 3x what is necessary? In this case, the system will still function normally. Other than that, I can't think of any other reason why they would be so much more than mine.

Good luck!
rsiedl
# RFM12B Communicationrsiedl 2015-12-01 08:29
Hi boredman,
Great project! I am trying to recreate this and am having issues with RFM12B communication. I have confirmed the Jeelink can see random 433MHz data using the preinstalled RF12demo. I then installed the RFM12B Receive.ino sketch from lowpowerlabs. I have installed EmonTxDue.ino onto my Due and when it tries to transmit, the LED turns on and doesnt turn off. I have added some debug code (ouput below) and it gets to the RFM12B:SendWait subroutine and rxstate stays on 6, never changing. Are you able to offer any ideas on where I should be looking next to solve this?
Thanks in advance,
Reagen
rsiedl
# DEBUG OUTPUTrsiedl 2015-12-01 08:31
DEBUG OUTPUT:
Initializing...
RFM12B::Initialize
rxstate 0
RFM12B::InteruptHandler
rxstate 4

Transmitting...
RFM12B::Send
rxstate 4
RFM12B:CanSend
rxstate 4
RFM12B::ReceiveComplete
rxstate 4
RFM12B::ReceiveStart
rxstate 4
rxstate 5
RFM12B::CanSend
rxstate 5
rxstate 7
RFM12B::SendStart
rxstate 7
RFM12B::SendStart
rxstate 7
RFM12B::SendWait
rxstate 6
rjsc2000
# RE: DEBUG OUTPUTrjsc2000 2016-01-31 20:01
Quoting Reagen Siedl:
DEBUG OUTPUT:
Initializing...
RFM12B::Initialize
rxstate 0
RFM12B::InteruptHandler
rxstate 4

Transmitting...
RFM12B::Send
rxstate 4
RFM12B:CanSend
rxstate 4
RFM12B::ReceiveComplete
rxstate 4
RFM12B::ReceiveStart
rxstate 4
rxstate 5
RFM12B::CanSend
rxstate 5
rxstate 7
RFM12B::SendStart
rxstate 7
RFM12B::SendStart
rxstate 7
RFM12B::SendWait
rxstate 6


Hi

Have you solved this problem? My board resets after about 8 seconds because of the rfm12b. If i comment the send rf comand the led blinks normally

Thanks
rsiedl
# Solvedrsiedl 2016-02-12 05:04
Hi,
Yes I did solve my issue. It was a bad RFM chip. I switched it out with another and everything started working normally.
Cheers.
boredman
# RE: RFM12B Communicationboredman 2015-12-02 06:56
Hi Reagen,
Sounds like the problem might be with SPI somehow. The state machine is trying to send, but gets stuck after the first preamble byte. Which version of Arduino software are you running? I know this is obvious, but have you selected Due as the target?
Can't think of anything else at the moment. :(
rsiedl
# RE: RFM12B Communicationrsiedl 2015-12-02 10:27
Hi Boredman,

I'm running version 1.6.6 on linux and have selected the Due "Programming port" as the board.

Is there a way to throw a multimeter onto the FM12B radio to see if all the pins are connected correctly? I've confirmed 3.3VDC to the VCC and GND pins, but dont know how to confirm the others are definitely correct.

Cheers,
Reagen
boredman
# RE: RFM12B Communicationboredman 2015-12-03 06:17
Hi Reagen,
You may try to look at MOSI, MISO and SCK pins with a scope. If you don't have one, a multimeter might show a normally 0 volts with small changes when SPI transfer is going through. Pin D10 (SS) should show normally high with small deviations towards zero during transfer.
Good luck!
gtanev
# RFM12B Help ?gtanev 2015-12-28 11:19
Hello
When compiling EmonRxRPi.ino gives me an error: "error: 'class RFM12B' has no member named 'GetRssi'"
Can you tell me where I'm wrong?
boredman
# RE: RFM12B Help ?boredman 2015-12-29 06:46
Hi Georgi,
You are not wrong. The RFM12B library does not have function GetRssi. You'll need to put one in, as explained here: forum.jeelabs.net/comment/6203.html#comment-6203. If you run into difficulties, let me know and I'll post complete code here.
Good luck!
gtanev
# RE: RFM12B Help ?gtanev 2015-12-29 09:18
Thanks for the quick response.
I'm not very familiar, so I ask if you could explain to me in detail and code / libraries that should be added?
boredman
# RE: RFM12B Help ?boredman 2015-12-31 08:01
Hi Georgi,
here's the modified RFM12B library that includes RSSI reporting: boredomprojects.net/images/Articles/HomeEnergy/RFM12B_rssi.zip
Happy New Year!
endi
# Design Proto shieldendi 2016-01-17 06:39
hi,
i really wont to make this but im not enginier so its hard to follow how you connect all these current probes so do you maybee have some design of emon in software like fritzing or any it will be very hellpful. or you make me some directions howe to soldier all these elements. i will be very greatfull!!
boredman
# RE: Design Proto shieldboredman 2016-01-17 09:43
Hi Endi,
To be honest, I've heard the name Fritzing, but didn't know much about it before. Thanks for pointing me to it. I think this is a good idea. I will look into creating a board design using Fritzing and will post it back here soon.
endi
# RE: Design Proto shieldendi 2016-01-17 10:00
it will be vey nice for as who are not enginiers. i have the same box as you and whant to make this i understud everithing except soldering and sorting all the staff of emontx. cant wait to see your design. thanks you very much.
hemertje
# RE: Design Proto shieldhemertje 2016-01-19 22:09
Quoting boredman:
Hi Endi,
To be honest, I've heard the name Fritzing, but didn't know much about it before. Thanks for pointing me to it. I think this is a good idea. I will look into creating a board design using Fritzing and will post it back here soon.


yes would indeed be a great support if you can supply us a Fritzing PCB, thx!
endi
# hiendi 2016-01-20 00:03
if i understud it well. you can chuse Proto Shield for Arduino MEGA board in fritzing and put all jacks and components design all the wiring. i didnt think to make my own pcb. i understud shematics for emontx but i dont know how to wire them on proto shield. i suggest fritzing beacouse you can chose proto shield and library have all the components to put on. but if there some easier software i would like if someone have shematics to send me beacouse otherwise i dont understud hov to make it.
endi
# Is it possibleendi 2016-01-17 16:51
Is it possible directly from fuse box send data to home wifi and process that data on some application or software on home pc without rasppi. if is which hardware to use. bacouse in my country arduino is expensive, arduino uno coast app:60euro, ard duo doesent even has,not to mention rasspi. with shipping is pointless so i whant go chepper without rasspi with some other conf. of transporting data to pc. so i think if i could with one more connected hardware to fusse box conf directly send data to pc. thanks for any help suggestions
endi
# is it possibleendi 2016-01-17 20:41
i meent on Arduino Due and my EmonTx Shield inside fuse box direct to pc
boredman
# RE: is it possibleboredman 2016-01-18 19:45
I have heard a lot of people use ENC28J60 ethernet module, which supposedly is cheap and very easy to interface to any Arduino. Or you may search for info on this WiFi module: ESP8266.
I have never tried it myself, though, so can't give any specific advice. Good luck!
xekon
# RE: is it possiblexekon 2019-10-19 19:37
Quoting boredman:
I have heard a lot of people use ENC28J60 ethernet module, which supposedly is cheap and very easy to interface to any Arduino. Or you may search for info on this WiFi module: ESP8266.
I have never tried it myself, though, so can't give any specific advice. Good luck!


The actively maintained library for the ENC28J60 is "EtherCard" and it does not support the Due according to their page. I have read however that the w5500 works with the due using the arduino Ethernet library.

www.arduino.cc/.../ethernet
rjsc2000
# RFM12B board dead?rjsc2000 2016-01-27 10:43
Hi

I was wondering if the RFM12B board has given you any problems. My emontx board is reseting after 8 seconds or so. But if i disable the comand rf12_sendWait in the code it doesn't reset
boredman
# RE: RFM12B board dead?boredman 2016-01-28 06:52
Hi Ricardo,
What code are we talking about? File name and line number would be helpful.
But, no, I don't remember RFM12 giving me these problems.
boredman
# RE: Home Energy Monitoring Systemboredman 2016-01-28 17:16
Quoting Hemertje:

yes would indeed be a great support if you can supply us a Fritzing PCB, thx!

Ok, I did it! sort of...
fritzing.org/projects/emontx-shield-for-arduino-due
There are still 6 lines which I could not route, so they need to be completed using wires.
I'd appreciate any comments and reports on whether this design works as expected.
mack
# RE: Home Energy Monitoring Systemmack 2016-02-20 06:36
Hi, after following the OEM project for the past few years, and being frustrated by lack of inputs per device, I'm stoked to not only see your work, but the turnkey fabbed format via Fritzing; I'll be ordering one. Any notes/suggestions for this, esp in giving you useful feedback?

I have no existing hardware, but am looking to monitor at a main panel, and a branched subpanel, for per-circuit measurements. Probably a 3-4 month project before I have this live. Also not sure which CT connectors would be ideal for accuracy, without breaking the bank.
boredman
# RE: Home Energy Monitoring Systemboredman 2016-02-20 10:32
Hi Mack,
I'm glad to hear that! Really looking forward to your review of the board.
I found a bunch of these connectors on Amazon, for example, 20pcs for 4eur, or so. Just search for: "5 pin 3.5mm socket pcb".
Good luck!
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-01-28 17:17
Sorry.

File: etmontx_lib
Line 9
boredman
# RE: Home Energy Monitoring Systemboredman 2016-01-28 17:51
Ah, I think you are talking about original library from OpenEnergyMonitor. In this case I have no experience with it and can not help you. I suggest you try asking there: [http://openenergymonitor.org/emon/forum.
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-02-12 13:24
Quoting boredman:
Ah, I think you are talking about original library from OpenEnergyMonitor. In this case I have no experience with it and can not help you. I suggest you try asking there: [http://openenergymonitor.org/emon/forum.

I think my RFM12B is toasted. Do you know if the RFM69 is compatible with the due?
boredman
# RE: Home Energy Monitoring Systemboredman 2016-02-12 21:18
Sure, RFM69 is compatible with Due, just like with any other board that has SPI. As far as software, I don't know, you would have to do some research.
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-02-13 00:22
Quoting boredman:
Sure, RFM69 is compatible with Due, just like with any other board that has SPI. As far as software, I don't know, you would have to do some research.

That's why i was asking, If you had to change the rfm12B to be compatible, this one probably has too.
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-01-28 18:43
I did.

When you say 'original' do you mean there's another?
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-01-30 21:22
I've bought a due board and would like to give it a try. But i have only a single phase and not 3 phases. I haven't seen the code yet, but can you tell me if it's easy to change it to single phase?

Thanks
boredman
# RE: Home Energy Monitoring Systemboredman 2016-02-09 08:04
Yes, very easy. All you have to do is to use the same phase constant 1 in all instantiations of emon object.
Ex.: emon[0].voltage(..., ..., ..., 1);
adrianc
# High calibration constantsadrianc 2016-02-10 09:16
Hello,

Thankyou for sharing this project. It has inspired me to learn more about electronics.

I am partway through building a similar system , and have recently completed calibration for the AC-AC transformer and my first CT clamp.

The calculated Real Power matches the power measured by a commercial power meter, and the power factor is 1.00 when under load with the default PhaseCal of 1.7 (I took a guess that my wall outlet was on phase 1).

My voltage calibration constant (1458) and Current calibration constant (420) are a lot higher than those in your sketch (and on the openenergymonitor website) though.

Do the high calibration values indicate that I've made a mistake somewhere?

Thanks.
adrianc
# RE: High calibration constantsadrianc 2016-02-11 12:14
I worked out the problem - user error.

In case anyone makes the same mistake - In the setup() function of the sketch, I had accidentally commented out the line:

analogReadResolution(ADC_BITS);

With that line uncommented, I could set the calibration constants to more reasonable values, and I'm not seeing any more intermittent NaN values.

Not sure if it means anything but (like Gerard above) I'm also using the Arduino Due, and also had to change the phase 2 and phase 3 delay in EmonLib_3PH.h from the original 65 and 130.

PHASE2=16 and PHASE3=34 resulted in power factor values:

Phase 1 = 1.00
Phase 2 = 0.97
Phase 3 = 0.95

..with the default phase angle calibration values (1.7, 2.0, and 3.0).

It could use some more tweaking, but at least I feel back on the right track.

Thanks again to Boredman for sharing your experience with the world. This is a great project to learn on!
boredman
# RE: High calibration constantsboredman 2016-02-11 12:33
Glad to hear that, Adrian!
The line analogReadResolution(ADC_BITS) sets 12-bit resolution, instead of the default 10-bit. To be honest, I can not see why this would cause high calibration constants, but, as long as it works now, it's all good! :)
Thanks a lot for kind words!
gtanev
# Atmospheric Pressure ?gtanev 2016-02-17 10:45
Hello again
I do not know if I dabble or anything else there, but graphics with atmospheric pressure is negative. If it can "fix" somehow?
boredman
# RE: Atmospheric Pressure ?boredman 2016-02-18 07:12
Quoting Georgi Tanev:
Hello again
I do not know if I dabble or anything else there, but graphics with atmospheric pressure is negative. If it can "fix" somehow?


COMMENT MOVED TO: boredomprojects.net/index.php/projects/sensors-for-hems
Michael
# 15bit A/D < 3USDMichael 2016-02-29 19:56
Hi there,
just wondering: what do you think of the ADS1115 (e.g. de.aliexpress.com/.../...) offering 4 independent A/Ds with 15bit precision for less than 3USD for the arduino.
Any feedback is highly appreciated.
Sensibelchen
boredman
# RE: 15bit A/D < 3USDboredman 2016-03-02 09:05
Hi Sensibelchen,
This device looks indeed very interesting. Can work from 3.3V or from 5V supplies, high resolution, 4 inputs, should be fast enough for energy monitoring. From reading the docs, it looks like one can attach up to 4 of these devices to a single I2C bus, which would create 16 additional analog inputs! Not bad.
I guess you are thinking about increasing number of CT connections? This might be a good way!
If you do get to use it in your system, please let us all know about your experiences.
Michael
# so far not too happy with ADS1115Michael 2016-03-03 09:14
I received my ADS1115 and started some low level tests.
Data sheet tells me to get up to 860 samples/sec but all I receive is:
500samples/sec using 1 channel
250samples/sec using 2 channels
170samples/sec using 3 channels
125samples/sec using 4 channels
with one ADS1115 connected to my nano just reading input without any calculations and serial.print. Using the ordinary A0 on my nano I receive up to 9000samples/sec!
I guess I have to wait for my Due to touchdown from china.
xekon
# ADS1115 results.xekon 2019-07-30 04:21
Did you end up using the ADS1115 with your Arduino Due?
adrianc
# Proto Shield - manual reset?adrianc 2016-03-01 13:34
Hello,

I'm powering the Arduino Due via the micro USB programming port, which wasn't an issue until the proto shield was mounted.

Without the proto shield, the Due starts running the Sketch immediately when the USB cable is connected.
With the proto shield attached, the Due powers up OK but I see no LED or Serial activity - like it's waiting for something before executing the sketch. Leaving it for a while makes no difference.

If I press the reset switch on the Proto shield, the Due resets and immediately starts executing the Sketch, green LED's flashing and outputting values to Serial as expected.

Have I done something wrong? Or is there a way of changing this behaviour so the manual reset is not required? I'd prefer if it didn't need manual intervention every time it loses power.

Thanks,
Adrian
boredman
# RE: Proto Shield - manual reset?boredman 2016-03-02 20:50
Hi Adrian,
I can't remember having this problem, but after some research, these guys seem to have it figured out:
forum.arduino.cc/.../
Georges974
# Sensors A0 bis A10Georges974 2016-04-03 14:42
Hallo,

Bin erst jetzt dazu gekommen!
Auf dem Proto sieht man A0 bis A11
also A0 bis A9 = Strom und A11 Spannung aber kann man nicht auch A10 einsetzen?
Und mit emon[9] hört es auf.
Kann man auf Platz11 define NSENSORS 10 auf 11 stellen?
Danke.
boredman
# RE: Sensors A0 bis A10boredman 2016-04-04 06:52
Hi Georges,
I propose we converse here in English, so that everybody could follow?
There are 11 CT inputs and 1 voltage input. 12 in total.
Inputs #0 to #10 are all the same and all can be used for current measurements. Input #11 is special, to be used only for voltage measurement. In my system I only have 10 CT inputs (not 11), that's why I used data structures only up to emon[9].
I hope this helps.
electrotwelve
# Quick question on EmonLib.cppelectrotwelve 2016-04-24 13:42
Hi, First of all thank your for putting this out here. Its quite fascinating to see how AC power measurement is done right. Instead of the current transformer and an AC to AC voltage transformer, I'm using voltage dividers and a bunch of opamps to measure the AC voltage and current. My processor is TI's CC3200 MCU based on the ARM Cortex M4 processor. I have a couple of quick Qs on EmonLib.cpp file in the zip file you've listed here.

My ADC tolerates upto 1.5V input and the listed reference voltage is 1.467V. It has a 12-bit ADC and then the counts would be 4096. Since my ADC tolerates upto 1.5V this means every count corresponds to 1.5/4096? Which is 366.21 uV. Is this right?

On line 85: What range is this? Also how is the 0.55 and 0.45 derived?

On line 109-112: If I'm using a 12 bit ADC wouldn't the offset extraction divisor change from 1024 to 2048? My offset is 0.7V.
boredman
# RE: Quick question on EmonLib.cppboredman 2016-04-25 08:49
Thanks, electrotwelve!

I'm curious about your design of the voltage dividers. Do you think you could post your schematic diagram? If you didn't use CTs, how did you manage galvanic isolation between AC lines and your circuit?

To answer your question, yes, 366uV per count is correct.

I didn't understand which zip file you're referring to. Please look at github.com/.../12bit_3phase and let me know line numbers from files over there.
electrotwelve
# RE: Quick question on EmonLib.cppelectrotwelve 2016-04-25 10:23
Here is the schematic which is essentially a smart plug reference from TI - www.ti.com/.../tidrfq8.pdf. Look at the Metrology section on page 1.

There is no galvanic isolation as such. The opamps act as an instrumentation amplifier whose outputs are finally single-ended and fed to the MCU. I'm guessing these serve as some form of isolation between the MCU and the AC mains.

Coming back to the code, I needed only the single phase measurement mechanisms which you've listed here in the EmonTxDue.zip file in the description (under "Update Jan 2016" section).

Here is where I'm stumped:

Line 114 and 118 (from the github 3phase code lib): How does this work? Why is there a 0.996 multiplier?
boredman
# RE: Quick question on EmonLib.cppboredman 2016-04-26 18:52
Thanks for the schematics. Very interesting!

As for your question, 0.996 is just a ratio, taken from original EmonLib, part of the high pass filter implementation, in order to remove DC component. Here's some explanation: openenergymonitor.org/.../...
electrotwelve
# RE: Quick question on EmonLib.cppelectrotwelve 2016-04-27 11:21
Got it. Thank you for that.
electrotwelve
# RE: Quick question on EmonLib.cppelectrotwelve 2016-04-30 05:53
Another quick Q: How did you calculate the phasecal value as 1.7? I read through OEM's phase error correction but I did not quite understand that (and the explanation on this towards the end of the CT and AC power adaptor calibration theory).
boredman
# RE: Quick question on EmonLib.cppboredman 2016-05-03 06:30
I arrived to these values mostly through experimentation, while monitoring measurement results with a resistive load. But here is a nice tool that can help you get the right values: openenergymonitor.org/.../2054
electrotwelve
# RE: Quick question on EmonLib.cppelectrotwelve 2016-05-04 19:35
Ah got it. Thanks again.
Remix
# Use 9v transformerRemix 2016-05-13 13:36
Hey, thank you for the great tutorial.
Can i swap the 9v AC/AC adapter with
9v pcb mounted transformer (store.comet.bg/.../) ? In this case, do i have to do add more components ?
boredman
# RE: Use 9v transformerboredman 2016-05-13 20:42
That's a neat little transformer. Sure, it can work just like AC-AC adapter and no, you wouldn't need any other components. Except, having live AC traces right there on your board might be dangerous.
electrotwelve
# Seeing a voltage value with the mains switched offelectrotwelve 2016-07-04 14:02
Hi, thank you for all your help with my earlier comments. I finally built this and here are a few observations. I see voltage values of around 51 even with the mains switched off. I also see that the power factor values are negative and the phasecal param seems to have no effect on the output values I see. I'm using a CC3200 MCU which has a 12-bit ADC which can tolerate only upto 1.467V on its ADC inputs. This would mean that the entire 12-bit range covers 1467mV and hence I changed the SUPPLYVOLTAGE values to 1467 in the source files. Am I correct to infer this? Also any thoughts on the voltage even with no mains and the negative power factor values? The load is a 40W incandescent bulb. A measurement file with the values is here.
boredman
# RE: Seeing a voltage value with the mains switched offboredman 2016-07-11 13:50
Hmm, I'm not familiar with CC3200, so can't really help there. But you are correct to modify SUPPLYVOLTAGE to 1467.
A few things to watch for:
* EmonLib_3PH.h defines ADC_COUNTS constant. Make sure it is set correctly to 4096 (for 12-bit).
* PHASE2 and PHASE3 constants are highly dependent of CPU speed, so you may need to modify them dramatically.
* Since your ADC range is only 1.467V, you have to adjust resistors in conditioning circuits for all current and voltage inputs, to center the signals in the ADC range as well as to ensure no signal clipping.
electrotwelve
# RE: Seeing a voltage value with the mains switched offelectrotwelve 2016-07-11 20:12
Yep I updated the ADC_BITS to 12 which automatically updated the ADC_COUNTS. I think I've finally figured this out. In my test rig, there is a 40W lamp load connected to the mains with a switch on the neutral line. This is plugged into a mains socket which is controlled by yet another switch. I was getting those strange values when both the switches were open. Since the measurements are neutral line referenced, with the switches open, there is no reference for measurements. When its just the mains switch everything works great and I see voltage values in the range of 0-2V.
rjsc2000
# No Serial outputrjsc2000 2016-08-13 14:07
Hi
I started again with the project and tried to use the due. I got the led to blink and tried your sketch with a breadboard and without the radio board.

I've disabled the radio calls in the code, but the led should blink. When it didn't i've put some Serial.println to debug but they don't appear in the seria monitor.

Out of the blue do you have any idea why? Maybe some settings on the board? I use the programming port.

Thanks
rjsc2000
# RE: No Serial outputrjsc2000 2016-08-13 16:17
I solved it. Had to put Serial.begin(9600) :)
rjsc2000
# Nan Valuerjsc2000 2016-08-13 21:56
Hi again

I've tried to do some quick connections and get a reading but the realPower variable gives Nan in the serial output. I copied the calibration and other values from the emontx board i had, and i didn't connect the AC-AC adapter yet.

Is the Adapter necessary ? or it should be giving a value and i'm doing something else wrong?

Thanks
boredman
# RE: Nan Valueboredman 2016-08-15 11:48
Hi rjsc2000,
Yes, AC-AC adapter is necessary to calculate realPower and other things. Remember, power = current * voltage !
Check out these guides: openenergymonitor.org/.../...
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-08-15 20:57
I was thinking more like it would give zero or something. I'll connect it and try again. BTW,

What kind of power for the board? A USB 5v charger is good? or i need a transformer?

thanks
boredman
# RE: Home Energy Monitoring Systemboredman 2016-08-17 07:28
You can find all info at:
arduino.cc/.../...
ProjectNoob
# RE: Home Energy Monitoring SystemProjectNoob 2016-08-16 06:50
Hi, thank you very much for the tutorial~!

I would like to ask if it is possible to make this project with a bluetooth module which sends all the readings to Android phone instead of making the Data Collection Box above? On tight budget here...

Thank you (Please excuse my poor English)
boredman
# RE: Home Energy Monitoring Systemboredman 2016-08-17 07:32
Hi!
Yes, it should definitely be possible. There are many BT modules available. You should be able to replace RFM12B code with one for your BT module. However, I have never done this myself and can not help with specifics, nor with how to handle the data on Android.
If you do get it to work, please share!
jan
# max ct sensorsjan 2016-08-16 20:45
I am running the code on an arduino nano with 7ct + voltage for some time now.
I was wondering how many ct sensors you can connect to a mega? It has 16 analog inputs but there are mux shields available. This way you can connect 48 analog inputs, but would the mega be able to process them?
boredman
# RE: max ct sensorsboredman 2016-08-17 07:45
7 CTs + voltage sounds pretty good to me for a 8-bit controller. However, rbreuss seems to think that you can run up to 15 CTs on ATMega
boredomprojects.net/.../...
Hard for me to say. You will have a reduction in timing resolution, though, and as a result in measurement accuracy.
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-09-14 00:37
Hi

My power factor and real power values are all wrong. the current, volt and apparent power are good.

Here some of the code

emon[0].voltage(1, 321.0, 0, 1);
emon[0].current(0, 216.0);

emon.calcVI(16,2000);

and the output
Current pin 0->0.74
Volt pin 0->227.47
realPower pin 0->-0.22
apparentPower pin 0->169.33
powerFactor pin 0->-0.00

Volt pin 1->229.24

Can you give some help?

Thanks
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-09-15 22:52
And here is some more output.

I hope you can make some sense of it
Thanks

startV=2003
startV=2039
SUPPLYVOLTAGE=3300
serialprint : 0.00 40.73 147.57 0.30 0.00
boredman
# RE: Home Energy Monitoring Systemboredman 2016-09-25 10:11
Hi,
I would take a look at the third parameter to voltage() function - PHASECAL. It should not be zero. This parameter compensates phase error between sampling voltage and current for each phase. It is important to properly calibrate this parameter: openenergymonitor.org/.../...
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-09-25 21:36
I was able to put the voltage and the current with correct values. But the power factor is not correct. But i wonder if i need it...

I want the energy monitor to tell me how much each line is spending in watts. The real value the electricity companies charge is the power=voltagexcurrent, right? If so, then i can forget the power factor.

Is this correct?
boredman
# RE: Home Energy Monitoring Systemboredman 2016-10-01 06:20
I suppose it should be ok.
rjsc2000
# RE: Home Energy Monitoring Systemrjsc2000 2016-09-27 11:22
One other thing.

I remember somewhere that the ac-ac adapter was connected to the washing machine line. But it has to be alone, right? I mean you can't have the ac-ac and the washing machine line in the same input, do you?

thanks
boredman
# RE: Home Energy Monitoring Systemboredman 2016-10-01 06:45
Ac-ac adapter measures line voltage, so it should be connected to one of the three phases. Any one. Even the one with washing machine :-)
I suggest you to read on explanation of the theory here: openenergymonitor.org/.../...
flywire
# Peacefair PZEM-004T and NodeMcu V3 ESP8266flywire 2016-12-05 11:24
I've been planning to try a Wireless Peacefair PZEM-004T Energy Monitor which has on-board data storage but I now realise there are a lot of safety issues with the PZEM-004t module design.
sharuvman
# Buy for own usesharuvman 2017-03-18 03:32
Hi,
I am interested to try out the Home Energy Monitoring system. Could you please let me know how I can order one.

Thanks,
Sharath
boredman
# RE: Buy for own useboredman 2017-03-18 15:45
mabo
# Everything on Raspberry ?mabo 2017-08-25 13:04
Hi,

As I am looking to do a similar hobby project, I wondered if it would be possible to only use a raspberry pi, equipped with a analog hat, so why did you decide to use a raspberry + an arduino.
Is this because you know the arduino and the libraries to read out the adc, or is it because of some raspberry performance issue making it impossible to only use a raspberry ?
boredman
# RE: Everything on Raspberry ?boredman 2017-08-25 18:42
Hi mabo,
You're right. There's no reason not to use RPi instead of Arduino to do the measurements. There are plenty analog input add-on boards exist for Raspberry to do the job. We just have a to a distinction between measurement box and the data collection box. You need both. And both can be Raspberrys, I suppose.
I used Arduino Due board because it was good enough to do the job on its own, as a single piece, since it has built in analog inputs, so no extra add-ons needed.
jegnner
# please helpjegnner 2017-11-03 18:15
Could you please provide me the AC / AC adapter features, input and output values
boredman
# RE: please helpboredman 2017-11-04 07:11
You can use pretty much any AC-AC adapter producing about 9 to 12 V AC on its output. Input will depend, of course, on power voltage in your area. 220V, for example.
gtanev
# Please helpgtanev 2018-01-17 11:09
Hello,
I apologize in advance for the stupid question, but:
If we plug in an electric kettle with 2 kilowatts and the voltage is 230 volts, how much should the value of Real Power and Power Factor (what gives the EmonTxDue) as a single-phase power supply?
boredman
# RE: Please helpboredman 2018-01-17 20:51
Hi,
An electric kettle is a purely resistive load, so, by definition, it's power factor would be 1. Therefore, the real power is calculated simply as voltage * current, in this case = 2 kW.
Here's a good guide: learn.openenergymonitor.org/.. ./...
Cheers!
gtanev
# RE: Please helpgtanev 2018-01-18 10:56
Did I understand well: the power consumption = the real power * the power factor?
For EmonTxDue, the exits are:
1 - voltage,
2 - real power of A0
3 - power factor of A0
4 - real power of A1
5 - power factor of A1
....
22 - rssi
the power consumption for A0 = the real power on A0 * power factor on A0?
Is that correct ?
Thanks, Cheers to you too! :-)
boredman
# RE: Please helpboredman 2018-01-20 10:54
Not quite.
Real power = apparent power x power factor.
Apparent power = V(rms) x I(rms)
Power consumption = real power. This is what utility company is charging us for.
So, you can directly take the real power produced by the software as the measure for power consumption. Power factor is just an indication of how reactive (or resistive) your loads are.
gtanev
# RE: Please helpgtanev 2018-01-20 12:45
Thank you very much for the clear explanation!
Good luck.
gtanev
# One more question ?gtanev 2018-02-02 12:02
Hello again, it says on the electric kettle, that it operates with 2000 W. But when i measure it with a tool with U=229V and I=8A => P=1832W. Do you have any idea where those 168W could be lost?
boredman
# RE: One more question ?boredman 2018-02-03 12:13
Hi!
I would guess you have not performed calibration yet. Here's a nice guide how to do that: learn.openenergymonitor.org/.. ./...
In general, we cannot be sure that the kettle is indeed exactly 2000W, that's why we need an external multimeter. Also, electronics inside eMon have uncertainties and need to be calibrated against what multimeter shows.
barrosinsanus
# Problem with measuresbarrosinsanus 2018-10-11 10:01
Hello everyone.

I'm trying to implement this project but i'm bumping into a problem.

I understand the concepts of Real Power and the Potency Factor but i don't understand how they can be measured. How is the coil's Voltage output related with these parameters? And what's the best way to calibrate my coils? I'm using the yhdc sct 013 100mA:50mA coils as well.

Thanks!
boredman
# RE: Problem with measuresboredman 2018-10-11 23:21
Hi!
Openenergymonitor.org site has many useful guides on these topic. Here's one of them on Voltage adapters: learn.openenergymonitor.org/.. ./...
And on calibration: learn.openenergymonitor.org/.. ./...
mabo
# Problem with measures — barrosinsanusmabo 2018-10-12 08:37
Voltage and current are measured via the analog inputs of the system.
Depending on the country, the frequency of AC voltage is 50 or 60 Hz, the analog inputs measure this at a higher frequency, perhaps 200 times per seconds or more, so the system is able to calculate mean or effective voltage and current from these measurement samples.
Power = voltage x current x power factor.
The power factor is the cosinus of the phase shift angle between voltage and current.
So when comparing the voltage and current measurements, the software is also able to calculate the phase angle between voltage and current, which gives us the power factor.
barrosinsanus
# Problem with measuresbarrosinsanus 2018-10-12 09:37
Thanks for the replies.

Maybe I should specify my problem. I'm trying to use a multiplixer to increase the number of analg inputs of my microcontroller. With the multiplexer, all coils are connected to one analog input so i can't calibrate each one of the inputs separately.

So my idea was to understand how the libraries work so I could implement all the calibrations, via code, on the output of the multiplexer.

Does that makes any sense? Thanks again.
boredman
# RE: Problem with measuresboredman 2018-10-13 15:45
The library calculates power by taking near-simultaneous measurements of voltage (ac-ac adapter) and current (ct coil). So, I would recommend to use at least two analog inputs on your micro, one for voltage and another for multiplexed current inputs.
You would have to rework the library accordingly to insert commands to the multiplexer in the right moments. For example, before each call to calcVI() function.
Renato_E
# Using ESP32Renato_E 2019-01-07 01:53
Hi, first of all I would like to congratulate you on the project!
I used it on the Uno Arduino and it worked everything!
Now I am trying on ESP32 and I can not get a satisfactory result, I made the modifications in Lib for 12 bits and still I have failed.

Have any tips to run this project on ESP32?

Thank you.
boredman
+1 # RE: Using ESP32boredman 2019-01-07 12:54
Hi Renato. Thanks for good words about the project! :)
Unfortunately, I'm not at all familiar with ESP32, so cannot really give any suggestions. But you would at least need to look at the following things:
* incompatible Analog-to-Digital converter code
* Radio interface might need to be different (not RFM12B)
* PHASE2 and PHASE3 constants are highly dependent of CPU speed, so you may need to modify them dramatically.
In general, it might be a lot of work to adapt to ESP32.
Renato_E
# Using ESP32Renato_E 2019-01-07 14:34
Thank you very much.
I'm going to try something different, in case I come and inform you and share the solution.

Thank you :)
kde5fan
# List of parts needed?kde5fan 2019-04-04 04:23
Is there a list of parts needed to complete this project? A "BOM".

Also, is there any other way to open the FZZ file, because it just won't install on my system.
kde5fan
# What wattage resistors are needed for this?kde5fan 2019-04-04 15:40
I found the BOM and so people don't have to try to run Fritzing. What wattage resistor is needed and is 6.3v cap fine?

BOM

1 Ceramic Capacitor package 100 mil [THT, multilayer]; voltage 6.3V; capacitance 100nF
12 Electrolytic Capacitor package 100 mil [THT, electrolytic]; voltage 6.3V; capacitance 10µF
1 10kΩ Resistor package THT; pin spacing 400 mil; bands 4; tolerance ±5%; resistance 10kΩ
1 6.8kΩ Resistor package THT; pin spacing 400 mil; bands 4; tolerance ±5%; resistance 6.8kΩ
25 100kΩ Resistor package THT; pin spacing 400 mil; bands 4; tolerance ±5%; resistance 100kΩ
11 22Ω Resistor package THT; pin spacing 400 mil; bands 4; tolerance ±5%; resistance 22Ω
1 RFM12b HopeRF Transceiver
1 Generic double row female header - 6 pins package THT; pin spacing 0.1in (2.54mm); hole size 1.0mm,0.508mm; form ♀ (female); row double; pins 6
12 Audio Jack (TRS) 3.5mm package 4Ucon 08780 [THT]; size 3.5 mm; channels Stereo (TRS)
boredman
# RE: What wattage resistors are needed for this?boredman 2019-04-04 18:01
All components are THT. Resistors are standard 1/4watt, 5%, 6mm long, but obviously smaller 3.3mm long could be used as well.
6.3V caps are fine.
xekon
# parts list helpxekon 2019-07-29 07:51
Ive ordered the arduino due, mega shield, ENC28J60, audio jacks, 6 pin double row female header.

that just leaves the capacitors and resistors, are there any brands in particular I should look for? how much strain are these put under? I know from my limited electronics experience that some capacitors can be really awful.

this one seems to be really hard to find in particular:

1 Ceramic Capacitor package 100 mil [THT, multilayer]; voltage 6.3V; capacitance 100nF

EDIT: Fritzing did not load correctly on linux, so i checked it out in my Windows VM, the 100nf ceramic capacitor is for the Wireless Radio, and since I am going to be using ENC28J60 isntead, I can skip that one! yay!

Also for the 22ohm resistor, higher up I seen you called it a burden resistor? is that somehow different from a regular resistor?

EDIT: dont use ENC28J60 the ethercard library does not support it, if your planning to use ethernet use w5500 instead.
boredman
# RE: parts list helpboredman 2019-07-30 11:33
The brand of capacitors and resistors does not matter at all.

The only "strain" the parts are under is the max dissipating power for resistors and max DC voltage for capacitors. The types listed in BOM are more than capable of withstanding the strain in this application.

The 22ohm resistor is called burden because of how it is used in the circuit, not because of its type. Its purpose in the circuit is to conduct and "burden itself" with current generated by the current probe.
xekon
# Awesome! Thank you!xekon 2019-07-30 17:31
Thank you so much for clarifying that for me. I was hoping you would say something along those lines for the "burden" term because I could not find any difference between it and the other resistors in the BOM.

I have the rest of the parts ordered and cant wait to put it all together.

It is really great that you shared this because more people really should be aware of the power they are consuming! I really appreciate it! It is hard to believe I have not invested in setting something like this up sooner than now!

I live in the United States, my electric panels only have 110 (single wire to breaker) or 220 (two wires to double throw breaker). I am not certain what this means for the different phases in the code, I do not have any 440. Is there anything that is going to need to be changed with the code because of this?

I am atleast a month away from being able to work on this because of ebay shipping speed.
boredman
# RE: Awesome! Thank you!boredman 2019-08-01 15:10
Thanks for good words about this project!
Since it seems you only have single phase power in your home, I'd suggest to use the original EmonLib software from here:
github.com/.../EmonLib
Best of luck!
barrosinsanus
# Problem with Power Factorsbarrosinsanus 2019-04-09 11:33
Hello guys! Thanks again for this amazing project.

I've made simple adaptations to the project but the measurements are not correct. I get the right values of current and voltage but I can't get the right PF values (apparent current seems right but real power is not).

I'm using 2 Analog Pins, one for voltage measurements and one for current measurements. Since these values are right (compared with a certificated and expensive Network analyzer), I assume that my circuits are also rightly implemented. Instead of DUE, I'm using an Arduino Mega 2560 and the circuit for the CT is powered from the 5V power line. For measuring voltage, I'm using a voltage sensor.

Can the Arduino Mega be the problem to the error of PF?

Thanks guys. Best regards!
barrosinsanus
# UPDATEbarrosinsanus 2019-04-10 09:29
Hi again guys,

By changing the value of Phasecal I manage to get the right PF and the right Real Power values.

I'm working with a Phasecal = -1.9. Only a negative value allowed me to get the right PF and RP values. Does that represent a problem?

Thanks again ;)
xekon
# North America uses three-wire single-phase, so on 220 circuit (2 pole) I should be able to use a single CT correct?xekon 2019-08-02 17:45
I was reading the article here: ctlsys.com/.../...

So for instance my Clothes Dryer and Water heaters both use 220V they are wired to a double pole double throw breaker with 2 hot wires.

I should be able to place the CT clamp around both the wires going to this breaker and be able to measure that 220V circuit with a single CT clamp, correct?

So long as the CT clamp is properly rated, I have read you want to choose a CT clamp that is rated for about 100% of your expected current measured. (I have oredered an inexpensive Clamp meter so I can verify amps under load.)
boredman
+1 # RE: North America uses three-wire single-phase, so on 220 circuit (2 pole) I should be able to use a single CT correct?boredman 2019-08-02 23:06
I'm not sure about that. It might be that your 220v lines are actually a split-phase connection, where the currents in the two wires are 180° out of phase. In this case, a single CT would not measure anything at all.
Check this out:
en.m.wikipedia.org/.../...
xekon
# RE: North America uses three-wire single-phase, so on 220 circuit (2 pole) I should be able to use a single CT correct?xekon 2019-08-05 17:43
You are correct, my clamp meter came in today, and if I clamp around 2 wires on the same 110 pole then it shows cumulative amps.

but if I clamp around 2 wires that go to the different 110 poles, as with my water heater and dryer then the two cancel each other out.

Thanks!
xekon
# What gauge wire did you use to make all the connections on the bottom of your Arduino shield?xekon 2019-08-05 17:45
I cannot tell for sure but it looks like you used solid core wire for the connections on the bottom of the arduino shield?

I also cannot tell what guage it is, thank you.

EDIT: did some reading about breadboard wiring, etc. Seems solid core ethernet wire is a good choice for this type of work.
Robotica72
# 6 Extra WiresRobotica72 2019-09-04 17:08
Hi - Just finished the PCB soldering and noticed that you mentioned the 6 extra wires for the install - Im not sure If I missed somethiing but Im not sure if the connections that need to be added or documented on here??

Thanks! and Great work on this!
boredman
# RE: 6 Extra Wiresboredman 2019-09-05 13:18
Hi
If you open the design file in Fritzing, in PCB view you should see the six dotted lines representing connections that must be completed by soldering wires. Probably it is easier to wire those on the bottom side of the board.
Let me know how this works out.
xekon
# How about ESP32 for more inputs?xekon 2019-10-25 18:09
The ESP32 has 18 12bit analog inputs, its got a 160MHz dual core processor as well. I actually found a couple energy projects using it.

After a bit of reading im not sure the esp32 is a good idea, seems its less reliable readings than some ADCs

edit: I am thinking for the panels were i need more than 11 CTs I could possible add a MCP3208 to the arduino. I will have to read up on this some more.
xekon
# the audio jacks I bought didnt fit in the shield pcb holes.xekon 2019-10-27 01:26
the audio jacks I bought didnt fit in the shield pcb holes, but you can use a 1/16 drill bit and drill out the ones for the audio jacks.

BAH! I will also note that I should have looked more closely at the audio jack style. You want to use audio jack that elevates the audio jack plug away from the PCB, if the audio jack you use has the hole for the plug practically flush with the PCB, then it does not really work that well. The ones used by boredman look similar the replacements I just ordered.
xekon
# Almost There, got it working, but the 9V AC-AC adapter is not providing a very stable voltage reading.xekon 2019-11-23 23:24
Almost There, got it all working, but the 9V AC-AC adapter is not providing a very stable voltage reading.

I am now waiting on a ZMPT101B for the voltage sensor instead of using the AC-AC adapter. I understand this is not as safe, I am willing to accept that and will be sure that the module and wires going to it are secured and insulated well. I will also make sure there is a fire alarm right by the panel.

I also ordered a cheap DSO150 Oscilloscope to help with calibrating the ZMPT101B

i.imgur.com/cIPcmNn.jpg
i.imgur.com/UddK2yK.jpg
i.imgur.com/WJBYR7W.jpg
i.imgur.com/HdGP9su.jpg
i.imgur.com/xZrw58M.jpg
i.imgur.com/NLrCYgX.jpg
i.imgur.com/epTiXaY.jpg
rsiedl
# Fritzing designrsiedl 2019-11-28 12:24
Hi, I've used your fritzing design to print out some boards and have stumbled upon an issue that I thought I would post here, in case anyone else has the same problem.

It appears the 3.3v to the RFM12B module is not routed through on the board. I've solved it by running another wire from the 3.3v to the positive of the capacitor for the RFM module.

Cheers
Reagen
rsiedl
# 3.3vrsiedl 2019-11-28 13:39
oh, just learnt about the ioref pin :)
boredman
# RE: Fritzing designboredman 2019-12-01 06:51
Hi, it appears you are right. 3.3V to RFM12B seems to be not connected. I wonder why fritzing tool did not highlight this error...
Thanks for pointing this out!

Please login or register to post comments