Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

A little Arduino and Kill-a-Watt assistance, please. :)
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

A little Arduino and Kill-a-Watt assistance, please. :)

by nrvale0 on Mon May 11, 2009 1:38 pm

Hi,

I'm an IT guy and not an Electrical Engineer. I'm going to do my best but please excuse any mistakes of jargon etc. :)

I'm hacking on a Kill-a-Watt in a fashion similar to what was done here:

http://www.ladyada.net/make/tweetawatt/solder.html

The main difference being that rather than wiring pins 1 and 14 on the LM2902N to an Xbee I have connected loose wires and would like to collect readings using the A/D ports on an Arduino Duemilanove of recent vintage (last 3 months).

The above link states the following about the Xbee unit:

"The XBee's Analog/Digital converter is set up to take a 'snapshot' of one sine-cycle at a time. Each double-sample (voltage and current) is taken 1ms apart and it takes 17 of them. That translates to a 17ms long train of samples. One cycle of power-usage is 1/60Hz long which is 16.6ms. So it works pretty well!"

Question #1)

Is the 'snapshot'ting functionality unique to the Xbee or should I expect that the A/D converter on the Duemilanove works the same way? If so, it would seem that I can reuse the code in the wattcher scripts to calculate true voltage?

Question #2)

In another thread, which I can't seem to find right now, someone mentioned that it was unwise to wire the Kill-a-Watt to the A/D ports on the Arduino while the Arduio was powered over a USB connection. Someone about this not providing sufficient grounding and possibly resulting in frying the Arduino and possibly the laptop. Could someone please elaborate?

Thanks so much for any help that you can provide. :)
nrvale0
 
Posts: 3
Joined: Mon Apr 27, 2009 11:46 pm

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by adafruit on Mon May 11, 2009 3:17 pm

i strongly discourage this project.

if you're not already comfortable with how grounding in computers, power supplies, and the kill-a-watt works, you can very very easily destroy your computer, arduino, killawatt and possibly self (approximately in that order).

i suggest you built a tweet-a-watt like thing and then read the data from the xbee using your arduino. at least that way you can use earth ground.

if you're still fixated on using your arduino directly, you MUST use full optoisolation to read from the to read from the opamp. this is not easy because the power supply in the kill-a-watt is very weak.

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

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by nrvale0 on Mon May 11, 2009 3:45 pm

Wow, thanks for the quick reply.

In regard to moving to a design where the KaW is wired directly to the Xbee, I would like to be able to send a signal from a centralized web-based control panel to toggle the power state of the outlet on the KaW. The KaW has already been modified with a relay for performing this action. So the Xbee has sufficient pins for reading the A/D data for voltage and current. In your opinion does it also have sufficient pins for toggling the relay? Sorry, I don't have the relay in front of me at the moment but it has three inputs that must be twiddled to toggle its state.

Thanks so much for any additional information that you can provide.
nrvale0
 
Posts: 3
Joined: Mon Apr 27, 2009 11:46 pm

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by adafruit on Mon May 11, 2009 4:29 pm

there isnt enough power form the killawatt to power a relay
relays are isolated mechanically which is why they are 'safe' to use with external control

there may be a tutorial on adding a relay to the tweetawatt in the future
however, when that may be is not clear.

i strongly suggest using a purchasable solution or finding an EE to assist you

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

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by team3 on Tue Jun 30, 2009 3:56 pm

Hey I am working on a similar project. I am trying to connect the Kill-A-Watt with my Arduino BT. I have tapped into the LM2902N chip Pins 1 and 14 to get the voltage and current values. I am trying to extract these values using the Analog Pins of the Arduino BT. I am receiving random values at the moment but nothing stable. How can I calibrate these values?
team3
 
Posts: 2
Joined: Tue Jun 30, 2009 3:47 pm

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by nrvale0 on Tue Jun 30, 2009 7:47 pm

I've actually found an EE to work with on my project. We are meeting on Wednesday to determine the safety of the current design based on the above reservations from the board moderator. Once we've resolved that issue, the very next thing to do is to sit down and figure out the format of the data coming from pins 1 & 4. I'll let you know what we discover.
nrvale0
 
Posts: 3
Joined: Mon Apr 27, 2009 11:46 pm

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by adafruit on Tue Jun 30, 2009 11:31 pm

the "format of the data" is an analog voltage

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

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by team3 on Tue Jul 07, 2009 1:44 pm

yes, I know that. We are transmitting data using the arduino bt via bluetooth however the values are random and inconsistent. Let me know if you have any ideas on how to calibrate the data into correct power measurement that we transmit from the kill-a-watt meter.
team3
 
Posts: 2
Joined: Tue Jun 30, 2009 3:47 pm

Re: A little Arduino and Kill-a-Watt assistance, please. :)

by adafruit on Sun Jul 12, 2009 6:37 pm

no flamewars please

all information is at www.ladyada.net/make/tweetawatt

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

Please be positive and constructive with your questions and comments.