tweet-a-watt calibration problem...

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

tweet-a-watt calibration problem...

Post by osbock »

Hi, Just built tweet-a-watt and I'm getting readings that are out of line with the panel reading on the kill-a-watt (by a lot). Do I have a wiring problem?
It was doing this with the script unmodified, so I tried the calibration method mentioned in teh webpage. I change vrefcalibration to 486 as it seemed to be the most common amp sample.
vrefcalibration = [486, # Calibration for sensor #0
486, # Calibration for sensor #1
489, # Calibration for sensor #2
492, # Calibration for sensor #3
501, # Calibration for sensor #4
493] # etc... approx ((2.4v * (10Ko/14.7Ko)) / 3

It goes up and down, but is all a lot more than I would expect, especially with nothing plugged in.
Here are some consecutive debug samples to demonstrate.
<xbee {app_id: 0x83, address_16: 1, rssi: 75, address_broadcast: False, pan_broadcast: False, total_samples: 22, digital: [[-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1]], analog: [[824, -1, -1, -1, 486, -1], [806, -1, -1, -1, 488, -1], [657, -1, -1, -1, 486, -1], [494, -1, -1, -1, 486, -1], [337, -1, -1, -1, 481, -1], [204, -1, -1, -1, 474, -1], [130, -1, -1, -1, 465, -1], [108, -1, -1, -1, 458, -1], [162, -1, -1, -1, 458, -1], [326, -1, -1, -1, 478, -1], [520, -1, -1, -1, 486, -1], [671, -1, -1, -1, 486, -1], [783, -1, -1, -1, 486, -1], [805, -1, -1, -1, 486, -1], [802, -1, -1, -1, 486, -1], [747, -1, -1, -1, 487, -1], [580, -1, -1, -1, 486, -1], [419, -1, -1, -1, 483, -1], [262, -1, -1, -1, 475, -1], [153, -1, -1, -1, 468, -1], [111, -1, -1, -1, 458, -1], [117, -1, -1, -1, 449, -1]]}>
ampdata: [488, 486, 486, 481, 474, 465, 458, 458, 478, 486, 486, 486, 486, 486, 487, 486, 483, 475, 468, 458, 449]
voltdata: [806, 657, 494, 337, 204, 130, 108, 162, 326, 520, 671, 783, 805, 802, 747, 580, 419, 262, 153, 111, 117]
1 Current draw, in amperes: 0.409867172676
Watt draw, in VA: 56.8690702087
Wh used in last 2.03200006485 seconds: 0.0320994317645
<xbee {app_id: 0x83, address_16: 1, rssi: 76, address_broadcast: False, pan_broadcast: False, total_samples: 22, digital: [[-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1]], analog: [[426, -1, -1, -1, 478, -1], [257, -1, -1, -1, 478, -1], [146, -1, -1, -1, 469, -1], [116, -1, -1, -1, 461, -1], [108, -1, -1, -1, 453, -1], [262, -1, -1, -1, 470, -1], [458, -1, -1, -1, 486, -1], [615, -1, -1, -1, 486, -1], [749, -1, -1, -1, 486, -1], [812, -1, -1, -1, 486, -1], [809, -1, -1, -1, 486, -1], [789, -1, -1, -1, 486, -1], [642, -1, -1, -1, 486, -1], [478, -1, -1, -1, 485, -1], [319, -1, -1, -1, 479, -1], [191, -1, -1, -1, 472, -1], [119, -1, -1, -1, 462, -1], [103, -1, -1, -1, 453, -1], [204, -1, -1, -1, 461, -1], [366, -1, -1, -1, 479, -1], [535, -1, -1, -1, 486, -1], [686, -1, -1, -1, 486, -1]]}>
ampdata: [478, 469, 461, 453, 470, 486, 486, 486, 486, 486, 486, 486, 485, 479, 472, 462, 453, 461, 479, 486, 486]
voltdata: [257, 146, 116, 108, 262, 458, 615, 749, 812, 809, 789, 642, 478, 319, 191, 119, 103, 204, 366, 535, 686]
1 Current draw, in amperes: 0.675521821632
Watt draw, in VA: 99.6546489564
Wh used in last 2.04600000381 seconds: 0.0566370589291
<xbee {app_id: 0x83, address_16: 1, rssi: 75, address_broadcast: False, pan_broadcast: False, total_samples: 22, digital: [[-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1]], analog: [[109, -1, -1, -1, 458, -1], [207, -1, -1, -1, 463, -1], [367, -1, -1, -1, 480, -1], [534, -1, -1, -1, 486, -1], [683, -1, -1, -1, 486, -1], [791, -1, -1, -1, 486, -1], [815, -1, -1, -1, 486, -1], [812, -1, -1, -1, 486, -1], [734, -1, -1, -1, 486, -1], [564, -1, -1, -1, 486, -1], [405, -1, -1, -1, 482, -1], [251, -1, -1, -1, 475, -1], [148, -1, -1, -1, 467, -1], [116, -1, -1, -1, 459, -1], [111, -1, -1, -1, 450, -1], [276, -1, -1, -1, 469, -1], [450, -1, -1, -1, 485, -1], [607, -1, -1, -1, 486, -1], [743, -1, -1, -1, 486, -1], [795, -1, -1, -1, 487, -1], [793, -1, -1, -1, 486, -1], [778, -1, -1, -1, 486, -1]]}>
ampdata: [463, 480, 486, 486, 486, 486, 486, 486, 486, 482, 475, 467, 459, 450, 469, 485, 486, 486, 487, 486, 486]
voltdata: [207, 367, 534, 683, 791, 815, 812, 734, 564, 405, 251, 148, 116, 111, 276, 450, 607, 743, 795, 793, 778]
1 Current draw, in amperes: 0.546489563567
Watt draw, in VA: 74.0037950664
Wh used in last 2.03200006485 seconds: 0.0417710323261
<xbee {app_id: 0x83, address_16: 1, rssi: 79, address_broadcast: False, pan_broadcast: False, total_samples: 22, digital: [[-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1]], analog: [[604, -1, -1, -1, 486, -1], [775, -1, -1, -1, 488, -1], [820, -1, -1, -1, 487, -1], [817, -1, -1, -1, 486, -1], [759, -1, -1, -1, 486, -1], [622, -1, -1, -1, 486, -1], [459, -1, -1, -1, 485, -1], [301, -1, -1, -1, 478, -1], [180, -1, -1, -1, 469, -1], [122, -1, -1, -1, 460, -1], [106, -1, -1, -1, 451, -1], [222, -1, -1, -1, 462, -1], [389, -1, -1, -1, 481, -1], [554, -1, -1, -1, 486, -1], [702, -1, -1, -1, 487, -1], [802, -1, -1, -1, 487, -1], [799, -1, -1, -1, 486, -1], [796, -1, -1, -1, 486, -1], [700, -1, -1, -1, 486, -1], [542, -1, -1, -1, 485, -1], [357, -1, -1, -1, 479, -1], [202, -1, -1, -1, 468, -1]]}>
ampdata: [488, 487, 486, 486, 486, 485, 478, 469, 460, 451, 462, 481, 486, 487, 487, 486, 486, 486, 485, 479, 468]
voltdata: [775, 820, 817, 759, 622, 459, 301, 180, 122, 106, 222, 389, 554, 702, 802, 799, 796, 700, 542, 357, 202]
1 Current draw, in amperes: 0.459203036053
Watt draw, in VA: 63.715370019
Wh used in last 2.03099989891 seconds: 0.0359460861299

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: tweet-a-watt calibration problem...

Post by adafruit »

are you doing anything thats different than the instructions? like a different model of k-a-w?
also check your wiring, sometimes people say they have this issue and then they mention that some soldering was loose and that fixed it

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

I checked everything, and it all seems fine.
My Kill-a-watt p3 model 4400 looks different inside from the instructions, but it has a DIP 2902.
I saw this thread, and so I pulled the xbee from the transmitter, and after some difficulty (sleep mode is a BANNED) I changed the sleep cycle to 5 sec. instead of 2, and used the defaults on your download page. (BTW, you should remind people to reset their own PAN-ID if they use that file.)

after running a while, It seems better, but still jumps around between 0.06 W and 9 W.
I haven't done all the python/google magic to graph things, but the shareware energy logger shows
a sinusoidal Voltage, but random amps with nothing connected.

I'll post photos to see if you can spot something. I have another kill-a-watt I can try, but it's similar vintage.

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

2902 attachment. Pin 4 looks a little sketchy, but voltmeter shows no bridging to Pin 3.
Here's the 2902 attachment. Pin 4 looks a little sketchy, but I checked it with my volt meter and there's no bridging to pin 3
Here's the 2902 attachment. Pin 4 looks a little sketchy, but I checked it with my volt meter and there's no bridging to pin 3
2902-attachment.jpg (385.32 KiB) Viewed 3445 times
Xbee board wiring.
Here's the xbee board
Here's the xbee board
xbee-board.jpg (678.17 KiB) Viewed 3445 times
The whole enchilada:
The whole enchilada
The whole enchilada
enchilada.jpg (608.49 KiB) Viewed 3445 times

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

Hooked it up to the other kill-a-watt, and now the variance is from 0 to 2.4 VA.

The kill-a-watt reads 0-1 (it did the same before I installed tweet-a-watt) nothing plugged in.

I think it's somewhat telling that I reprogrammed the sleep time to 2 sec and again it was reporting 50-65 watts. 5 sec back to 0-2.4. Changing it to 10 seconds didn't seem to improve it much more.
crappy power supply? If I hooked it up to an arduino 5v would that supply enough power to verify?

I went on to amazon, and saw a lot of bad reviews for the kill-a-watt itself, mostly quality control issues. People loved it, but had a high failure/return rate. If the answer is to get a new kill-a-watt, is there a strategy for finding a good one?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: tweet-a-watt calibration problem...

Post by adafruit »

if you dont insert the xbee, does it work?

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

adafruit wrote:if you dont insert the xbee, does it work?
Not sure I understand the question. The Kill-a-watt itself seems to behave the same way (working, though with a small variable 0-1 watt reading with nothing plugged in.) it did before installation. I can take the xbee out tonight when I get home, but I'm not sure I'll see any difference.

I seem to get the same behavior in both kill-a-watt's, though I am using the same transmitter setup, so it is possible that I screwed something else up.
Should I test the power supply theory? I don't have a bench supply but I could hook up an arduino or a minty-boost. I imagine I would have to tie the grounds together because the vref is relative to the kill-a-watt ground?

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

In looking at my own pictures, I noticed that I omitted C2 (power supply capacitor) (comes from reading instructions on my iphone)

I put that in, and checked the reset cap as well. Still the same behavior.

I noticed the Current draw in VA would suggest a voltage around 170? Is there something wrong on the voltage divider side of the input? is there another calibration I've missed?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: tweet-a-watt calibration problem...

Post by adafruit »

from all the other posts we've seen, it always seems to be a misconfiguration or a skipped step so of course we suggest going through the instructions and making sure you did everything properly

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

I've really gone over the whole thing with a magnifier, and checked my soldering, etc.
I did find that one error with the power supply, but fixed that. I still have to set the sleep time to 5 seconds to not get bogus readings. Now (with the 5 second time) I get between 0-2 Watts with nothing plugged in. Note the amp data seems pretty consistent, and right in line with what the instructions say. I didn't see a way to calibrate for voltage in the code.

One thought that occured to me, and I haven't fully grokked the code yet, is do I need to change something, because I've changed the sleep time? I would now have fewer samples for the same amount of time.

ampdata: [495, 492, 492, 492, 492, 492, 492, 492, 492, 495, 492, 492, 492, 492, 491, 492, 492, 492]
voltdata: [700, 522, 372, 246, 169, 155, 176, 299, 471, 642, 751, 814, 826, 770, 626, 449, 304, 205]
1 Current draw, in amperes: 0.0265654648956
Watt draw, in VA: 2.34155597723
ampdata: [494, 491, 492, 491, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492]
voltdata: [780, 821, 824, 726, 586, 432, 288, 193, 157, 159, 281, 429, 583, 717, 808, 824, 806, 684]
1 Current draw, in amperes: 0.0151802656546
Watt draw, in VA: 2.20872865275
ampdata: [494, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492]
voltdata: [655, 760, 815, 826, 748, 594, 440, 295, 199, 159, 154, 257, 400, 556, 706, 789, 821, 824]
1 Current draw, in amperes: 0.00759013282732
Watt draw, in VA: 0.629981024668
ampdata: [494, 492, 492, 492, 492, 492, 492, 491, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492]
voltdata: [475, 625, 741, 809, 824, 784, 663, 486, 320, 216, 164, 153, 221, 371, 547, 689, 784, 820]
1 Current draw, in amperes: 0.011385199241
Watt draw, in VA: 0.0607210626186
ampdata: [495, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492]
voltdata: [307, 480, 631, 745, 812, 825, 779, 656, 480, 314, 211, 162, 153, 226, 377, 553, 716, 789]
1 Current draw, in amperes: 0.011385199241
Watt draw, in VA: 1.05882352941

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: tweet-a-watt calibration problem...

Post by adafruit »

those numbers look good, sounds like youve got it working now
the sleep time is irellevant, the code keeps track of time

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

so it's normal for it to bounce so much? It's close enough for my purposes anyway (I want to monitor my son's TV, so I can turn it off remotely when I know he's not home.

thanks.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: tweet-a-watt calibration problem...

Post by adafruit »

yes, please see the instructions here http://www.ladyada.net/make/tweetawatt/software.html
Now you'll see that the Watt draw is 2W or less, instead of 40W (which was way off!) The reason its not 0W is that, first off, there's a little noise that we're reading in the A/D lines, secondly theres power draw by the Kill-a-Watt itself and fianlly, the XBee doesn't have a lot of samples to work with. However <2W is pretty good considering that the full sensing range is 0-1500W

User avatar
osbock
 
Posts: 151
Joined: Tue Jan 23, 2007 1:12 pm

Re: tweet-a-watt calibration problem...

Post by osbock »

Thanks, I did read that, but the instructions said 0-2, and I sometimes see it jump up to 5.
On the meter itself, it flickers +- 1-2 watts with a load, so they must be doing some smoothing.
I'll play around with the code to see what I can do.

Thanks again for your help. On to phase II. Integrating it with the router, and hooking up the x10 control...

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: tweet-a-watt calibration problem...

Post by adafruit »

forwards!!!

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”