Jump to content
Sign in to follow this  
GeekDoc

Electricity monitor - need some help

Recommended Posts

Any new updates on this? :D

Funny you should ask...

 

I went to a tire store and got an old trash inner tube for free. I cut a strip of rubber, cleaned it, and super-glued it into a loop to fit around the meter. I punched a hole with a nail and fed the wire from an old mouse through; it fits water-tight. I decided I might as well use both of the IR phototransistors in the unit, so I soldered three wires to it and super-glued it in place at the right distance from the edge. It fits pretty well!:

IMAG0106_thumb.jpgIMAG0107_thumb.jpg

 

Today, I bought a PVC conduit corner piece similar to the larger ones connecting to my meter and feeding into my house. I cut the back connection off, and sealed the back hole with scrap rubber and super-glue. I also made a two-piece rubber "curtain" over the bottom opening to feed the wires through. I put a small strip of 1/4" plywood inside, super-glued a terminal strip to it, and ran screws through the terminal strip, plywood, and rubber and out the back hole to mount to the house.

 

IMAG0108_thumb.jpgIMAG0109_thumb.jpg

 

I ran a piece of CAT-5 cable through an existing hole in the side of the house and into my basement, where the microcontroller and computer will be. The CAT-5 and the terminal strip give me eight conductors in case (when) I run more sensors outside.

 

My current problem is that the terminal strip screws are made to bite into crimp-on terminals. Whenever I tighten one on the CAT-5 wires, it cuts right through. I bought some washers, but they are too small. So, until I get out to get some #6 washers, the hardware is at a standstill.

 

I should work on the software. Anyone got any great ideas on how to store minute-by-minute readings in a database? That's a lot of records! I'm thinking hourly records with fields for each minute's reading (and whatever other readings I add). Storing should be okay, but querying is going to be a bear!

 

-Doc

Share this post


Link to post
Share on other sites

Wow! Your close. Thanks for the update.

I should work on the software. Anyone got any great ideas on how to store minute-by-minute readings in a database? That's a lot of records! I'm thinking hourly records with fields for each minute's reading (and whatever other readings I add). Storing should be okay, but querying is going to be a bear!

 

Few handy links, found by querying Arduino and Kill-A-Watt

http://www.mcqn.com/weblog/mazzini_moni ... _appliance

http://jarv.org/pwrmon.shtml

http://www.gekgasifier.com/2010/04/powe ... n-arduino/

http://pluggy.is-a-geek.com/arduino/index.html

 

HTH.

Share this post


Link to post
Share on other sites

Doc,

 

Do you mean in software on the computer? After the data is sent to the PC somehow? (over serial?) If you are sending the data to your computer over serial you might have some problems as your wire becomes long. Or do you want to store it in the memory on the MSP430?

 

Either way, I might have a few hints to throw your way. I'm just a little confused as to what you want to accomplish. If you want to just store streamed data on a computer, it is super easy to write a program in C# or Java, or any language really to store and analyze data. It's even easy to write a program to output data for you in a nice happy .xml file, or .xml, or any other format you choose.

 

Hope I'm not too confused, sorry if I missed something.

 

NJC

_________________________

http://msp430launchpad.com

Share this post


Link to post
Share on other sites
Do you mean in software on the computer?

Yes, I want to send the data from the MSP430 to the computer about every minute. The MSP430 will (on the meter sensor) count the flashes for the minute, then report the total to the computer and reset for the next minute's count. This way, the computer can take care of time/date logging for the reports. This will keep the data valid if the MSP430 stops reporting for a period (though I will use the WDT for its intended purpose).

 

I want to store the data on the computer and write an inteface program to display the data in meaningful ways (graphs, tables, current status, etc.). I'll likely use C#, as that's where have a little experience. I'm just not sure where I want to store the data. I'm thinking a mySQL, or SQL Server DB so I can add a web interface easily at some point.

 

After the data is sent to the PC somehow? (over serial?)

Actually, I was planning on being lazy and using the LaunchPad example's software UART (which you broke down so nicely) over the USB/VC port. I'm thinking 3 bytes for each sensor: a two-character identifier, and a value. I'll have to add a start and stop to the data so that I can expand the transmission easily as I add sensors. The longest distance will be sensor(s) to the LaunchPad. The LaunchPad will be within 10 feet of its host computer.

 

Either way, I might have a few hints to throw your way.

Your hints are always awesome, and always welcome! :D Thanks!

 

-Doc

Share this post


Link to post
Share on other sites

Doc,

 

As for a serial interface with the MSP430, thats coming in my next blog post, with the C# source code (not sure yet how I will share the whole project). It was really easy to get the serial communication working with C# so I recommend just diving in when you get time, its quite easy. I don't know much about web interfaces or SQL, it might be the best option though. Personally I would use XML, and have a separate file for each month, or week. XML is surprisingly easy to work with in C#, the only problem is that they have so many different ways to work with it; it took me almost 2 days to figure out which method was best for my purposes.

 

I'm thinking 3 bytes for each sensor: a two-character identifier, and a value. I'll have to add a start and stop to the data so that I can expand the transmission easily as I add sensors. The longest distance will be sensor(s) to the LaunchPad. The LaunchPad will be within 10 feet of its host computer.

 

You could probably get away with 2 bytes if you compress your data to 1 byte values. You would only really need 1 character identifier unless you plan on having more than 255 sensors. Remember that if you send an ADC value, its 10 bits, but with most applications you would not be hurt by using only 8 of those bits. Things get a bit complicated if you have multiple device using the same serial bus. Especially since the software UARTs are Half Duplex. If it was full duplex you could easily daisy chain as many as you want and have no problems. I would recommend coming up with a master slave system of your own using the serial communication in order to keep messages from getting garbled. Too many cooks in the kitchen so to speak. Also, using TTL (Transistor

Share this post


Link to post
Share on other sites
It was really easy to get the serial communication working with C#

Yeah, I found that out. I did a quick proof-of-concept app in C# to be sure I could read from serial.

 

Things get a bit complicated if you have multiple device using the same serial bus.

Just one device: single LaunchPad with several sensors attached. The launchpad will sample the data over a 1 minute period, then send a single data burst through the UART/USB/VCP path.

 

Also, using TTL (Transistor

Share this post


Link to post
Share on other sites

Doc,

 

There are a few ways you can solve the distance problem. The first is to just try a simple buffer. The way to do this is hook up a voltage follower to your outputs and hope that the low impedance output of the amp will reduce any noise it picks up, the major problem is not the noise though it is the parasitic capacitance. It is just like putting a square wave through a low pass filter. A simple way to force a workaround is to lower your transmission speed, but sometimes that is not an option. Another easy way it to build repeaters and scatter them along the line making sure they are at about the range that problems happen; this is quite hard to do efficiently without an oscilloscope to see how the waveform changes. The repeaters can be built a ton of ways, the easiest is with a comparator, the next is with an operational amplifier, the last way is with another MSP430 (I do not recommend this way though).

 

Good luck with the job hunting!

 

NJC

Share this post


Link to post
Share on other sites
Have you decided on the PC side software?

Definitely .Net (C#) to start out. I think there are a few free graphing libraries out there. I'm still figuring out exactly what I want it to do. I'll probably store data in a MySQL database.

 

I'd like to do a web interface in PHP at some point; that would make it cross-platform. Gotta learn some more PHP first, though. ;)

 

-Doc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×