How much!?

I’ve just got back off of holiday, so I haven’t had a chance to read comments and things until now. Andy commented on my previous post and wondered how much the power monitoring project was going to cost me all tolled. So I started to think about it, from the beginning I’d always excepted it was always going to be slightly more expensive then buying a off the shelf solution to just “monitor” my power… but didn’t want to just monitor… I want to record and trend.

So how much are all the other monitors out there? From “ethicalsuperstore.com” they appear as follows:
Efergy Energy Saving Meter - £39.95
OWL Wireless Energy Monitor - £29.95
Wattson Home Energy Meter - £99.95 (Unfair to include this one really, it’s more a style statement then a monitor ;)
Eco-Eye Elite - £49.99 (Interestingly from the pictures appears to be using a CR Magnetics CR-3110 current transformer, hadn’t seen this one until today.)

So if I arrive inside of £29.95 to £49.99 I’m doing okey. Now until I decided to start on this project I had no tools or components in stock, when I lived with my parents I’d just use my fathers, but alas I haven’t lived there for three years and until this had the need for them. I wont include tools in this, they are things I should have had a long time ago. :)

The initial project was envisaged to have a current transformer, micro controller and a blue tooth dongle to provide remote telemetry. Of course as I continued to work on it I found I wanted more. So I added on an I2C RTC and an I2C EEPROM to store historical information when I couldn’t manually poll.

My project still isn’t fully built and is in various bits because I’m testing different aspects, it’s got components on it that it wont need in the long run (like TTL to RS232 line drivers). I’ve also done a few extra things like using DIP/DIL sockets wherever a chip is concerned so that I don’t ruin a chip while soldering.

So what’s it cost? Main components first:
PIC16F767 - Free (Microchip Direct Sample) - Closest on CPC is about £5
24AA102S (1mbit flash) - Free (Microchip Direct Sample) - Closest on CPC is about £3
OWL “Spare” Current Transformer - £6
Phillips Compat RTC - £3.50
Resistors (x8) - £0.10 (Brought in bulk from CPC)
Capacitors (x6) - £0.22 (Brought in bulk from CPC)
Diodes (x4) - £1.00 (Low voltage drop needed)
Veroboard - £1 (Brought and cut from CPC)
SparkFun Bluetooth Module - $59.95 or ~£32.50

Yes I know… it’s the last item you’ll gawp at. But really why bother doing it another way? A USB bluetooth dongle is a couple of dollars, and laptops have it built in. It’s range isn’t bad, and on most OS it emulates a serial port which makes writing software easy. Most of all, it’s two way communication. I did look at using a 433Mhz transmitter/receiver pair, but there’s to much in my house on 433Mhz already and it’s only one way.

So how else do a plan to push the total cost up for me? Well one thing you have to look at is power, you might be lucky and be able to feed the power to the board from the inside via a hole in the wall, that isn’t an option for me for a couple of reasons. I dislike throw away batteries and I don’t want to have to go out every few weeks/months.

A lead acid battery and a solar panel where my chosen (and currently untested solution), the 12V battery was £5 and the solar panel “designed” to trickle charge 12V batteries was around £12, both from eBay. From what I’ve worked out, I will still be okey to recharge used current from the night/day, even if during the day the solar panel is only working at 20% efficiency (which hey in the British summer we’ll be lucky ;).

Other things I’d like to do to make it more fun would be a digital potentiometer so that I could dynamically change the burden resistor as the current changes to get the best range at high current and most accuracy at low current. I’m having issues finding an I2C digital pot in DIP format, so I might have to resort to an SPI chip for that, which introduces more complexity in the I2C/SPI lines. I really want to use I2C though. That would be about £3, or free via samples.

So if you were going to pay for it all, I guess the entire project would be: ~ £71… youch we are over budget. But then again, I’d probably ask you to find one with a bluetooth interface for less, with historical, dynamic resolution and solar power. If you removed solar panel/battery it’d drop by £17, which is down to £54 which is closer, but not as easy for you and probably worse for the environment. I haven’t paid for my PIC or EEPROM so it’s more like £63 for me.

Let’s not even think how much my time writing the micro controller firmware would cost if I was charging eh? ;) But I’m making this because it’s a lot of fun. So Andy, I hope that answers your question and doesn’t scare you off!

D.

Comments (1)

Ack! Not just a voltage drop!

Okey, so my battery and solar panel have arrived. I’m just waiting on a 12V 300ma battery charger to arrive so that I can actually properly charge the battery for the first time before it begins it’s life of being floated. I gave them both a quick go to make sure they wernt DOA. The solar panel has already been modified to remove a silly blinking blue LED which was eating up 2.5mA on a 50% duty cycle while the panel was on. Baring in mind that I’ve seen it only do 12mA in overcast conditions every little helps. Maximum I’ve seen so far is 54mA in direct sun, although at the end of the day.

So I decided to look at why I’m “loosing” voltage when converting from AC to DC, I accepted that there would be a drop from the diodes in the full wave rectifier. Estimates suggests this would be around 0.7V for a diode and with two facing towards the positive rail this added up to 1.4V. Turns out that I had a voltage drop that was not quite consistent across the range of voltages I was expecting.

AC DC Diff
1.56 0.38 1.18
2.5 1.06 1.44
5.7 3.96 1.74
6.58 4.76 1.82

Hmmm, so not quite right and certainly this didn’t explain a 1.4V drop for the first result. After a bit more digging I read up that the reading my volt meter was giving me was most likly RMS. So by using:

AC * (2 * SQRT(2)/PI()) = DC

I got figures that always seemed to be around 1.2V above where they should be. I’ve surmised so far that in fact the drop across my two diodes is totaling around 1.2V. As the calculation to work out current from the voltage requires the AC voltage I think I need to reverse this in order to obtain correct readings.

However having since played and discovered that I’ve already received a voltage above the 5VAC that I had initially anticipated, I suspect I need to alter my burden resistor to bring this around a suitable value, although the 6.58VAC was with virtually every electrical thing in the house turned on although it suggests a total pull of around 20A. Which is possible I’m sure.

I need to have a good think about this tomorrow to actually work out what I really need.

Edit: Looking at the data sheet for the CR Magnetics split core current transformer the calculation is for VAC RMS and IAC RMS, so that answers that question. I suspect I need to tweak the burden resistor to cope with 32A which is the maximum of any of the house circuits, although the incomer more.

D.

Comments (1)

It’s almost alive!

Okey, so it’s been several months since I first started playing around with PIC microcontrollers, I’ve got a couple of projects in mind but my first one is a home energy monitor. Our house is full of tech that drinks a significant amount of electricity, so I wanted to start monitoring it. We could have got an OWL monitor but they are relatively expensive and there’s no real learning experience. Besides I want to be able to record the statistics, not just have them on a LCD display somewhere (which is plugged into the mains…).

So what’s the solution? A PIC16F7X7 with 14 ADC channels (of which I will need three in the end), supports I2C for talking to a Phillips RTC (keeps the date/time and also provides a regular interrupt), a Microchip I2C 1Mbit EEPROM for temporary data storage and UART for talking to a serial device. So far so good, however deviating from what is out there at the moment I wanted to be different on several levels.

First I needed to put this project outside in the electricity cabinet, it’s not my house so I can’t route wires or drill holes. This presents two obvious issues first of all there is no usable power out there (although that’s what it’s monitoring) and I can’t easily get a data connection outside. The first solution is to use a 12V battery and a solar panel which even at 25% efficiency can charge up the nights power usage, although not arrived yet a grand total of £16 from eBay. The second problem is easily solved although at a price. There were two options to use a 433Mhz TX/RX pair which provides a one way feed from the project, the problem with this is that a significant number of other applications use the same technology.

The other option, although more expensive, is to use a serial driven Bluetooth module with the SIP profile. This can be paired with any Bluetooth device and supports encryption and authentication and also bidirectional communication, allowing us to query the device as well as simply receive data. I highly recommend looking at SparkFun for any electronics geek, it’s heaven. The module I want to use is around £35 with P&P.

My biggest issue by far has been finding a cheap current transformer to actually clamp around the main incomer to the house. I can find numerous places in the US who will sell a CR Magnetics CR 3110, however any company shipping to the UK charges a fortune for postage making the units between £15-20 each. A co-worker of mine pointed out that you could get an entire unit (sold under OWL Energy Meter in the UK) for doing what I want (ex-PC integration) for £35 including a current transformer. After some digging we discovered that you could order the transformers separately for just over £5 each direct from the company.

For those who haven’t seen them, they look like this:
owl-clamp-whole.jpg

And are clamped on like this, (Warning: I have removed the mechanical shielding to get to the live wire, this was done for testing only and would be dangerous for regular use. The 4-gang in question is not used for anything else.):
owl-clamped.jpg

Once I received the transformer I set about trying to identify how I would be able to use it in my project, looking for model numbers and other identifying marks which might enable me to find a datasheet:
owl-clamp-inside-up.jpg
owl-clamp-inside-down.jpg

Sadly there where none, on the underside of the transformer (last picture above) I discovered a 100Ohm resistor which after looking at the implementation notes for the CR 3110 I believed to be a burden resistor. I tried putting several amps of current through the live wire and found minor voltages appearing (on the scale of 0-100mV). I took several readings and found that all but one (in the middle) lined up relatively well. Taking the equation from the CR 3110 data sheet of R = (T x V) / I it was possible to get a rough figure of the number of turns on the transformer, this all came out to around near 3200 turns.

Using the same equation I worked out what resistance I would need in order to generate near 5V for 13A, it came to ~1230 Ohms, knocking this down to a on hand value of 1kOhm gave me 5V for 16A. I proceeded to remove the burden resistor from the transformers mount, due to the layout of the PCB I could leave the resistor to the other end of the lead and close the transformer back up. Allowing me to experiment if need be. After further testing I found all these values to be very closely in tune with those that I had worked out. Only having a Kill-a-watt to help test my calibrations I can only assume it’s “accurate-enough”.

I had previously done a lot of reading at http://board.homeseer.com/showthread.php?p=627341 with reference to wiring up a CT. After wiring up the CT to my PIC development board and implementing a full wave rectifier I was left with an odd cycling of reasonable readings to wrong readings. It appeared that the timing of the ADC conversations was drifting in time with the 0V cycles of the rectifier. I had included a 1nF capacitor as the HomeSeer site had suggested, it turned out after talking to a co-worker it simply wasn’t big enough so instead this was replaced with a 47uF electrolytic. Bingo it started behaving as I expected, there was a three bit wobble in the least significant bits from the ADC but this may well just have been changes in current usage in my test object (read: girlfriends hairdryer).

I additionally had a test meter also wired in so that I could confirm the ADC readings:
testing-with-meter.jpg

I have noted a 0.2V drop on the DC side which I suspect is due to my diode rectifier, I need to explore this issue further and identify how to work around it or if I can just straight discount it. Finally an overview of my dev board:
dev-board.jpg

If you have any questions to do with the project let me know, I’m a little way off of it being completely finished but it can certainly begin it’s testing now.

Comments (1)

Broken Tooth! Filling! Root Canal! Dentistry!

Okey, so I haven’t been to a dentist in about six years. I haven’t needed to, at least that’s what I think, and still believe, however I should probably get all my teeth checked out.

Four weeks ago we all went to take part in a “Battlefield Sports” event in Chorley, dress up like military bods, get given laser weapons and you have to run about and shoot people tactically. All was going fine until I tripped up, mouth first into the butt of my gun and broke my front left big “bunny rabbit” teeth. That day I went to A&E and they checked me out to make sure that I hadn’t hurt my gum or lip.

They didn’t mention that there was a facility to see a dentist on an emergency dentist that day, so essentially three days later I found out and got to see a dentist who seemed initially offhand. She put a dressing on the exposed dentin and said I had to wait three weeks before anything proper was done. So I came back three weeks later, I have to admit I was a little worried, I’d never had any form of major dental work done before. No fillings, nothing requiring injections, etc.

So I went in and it was the same dentist as last time, she talked to me explain what she was going to do. Inject into the gum and pallet make them numb, then drill off the dressing and then slowly rebuild the tooth with filling. I was a little worried about it all, but in the end it worked out absolutely fine. I didn’t feel pain once during the procedure, and then not initially afterwards. Great I thought.

So that evening I felt some pain, it wasn’t to bad, I just shrugged it off to being due to having it done, took some paracetamol and ibuprofen after remembering you could take both at once, I got a good night sleep and everything felt fine again in the morning. Went to work and by 1pm I was in agony again, I could feel my pulse so strongly in my tooth my jaw was aching. I took more drugs, it went away a little bit and eventually I got another nights sleep.

Last night when I came home I was getting the throbbing and my cheek bone was aching etc, pain killers helped so far but it wasn’t right, I eventually got to sleep then this morning while getting ready I found a small lump in the flesh between my gum and lip which hurt like hell in my tooth when pressure was applied to it. So I decided to call the dental help line again and managed to get an appointment for the same morning, which was impressive.

I turned up kind worried that I was wasting their time because all the pain killers had kicked in, however the same dentist had a look and feel and she said it was likely that the nerve had died and needed to be removed. So I agreed to have root canal. I’d heard really bad things about pain and just being a horrible procedure… maybe it more is if it’s a back tooth. The procedure didn’t hurt, at some point I could feel a slight pressure spike as she “cleaned” the canal out, but all in all it wasn’t painful. Now the local is starting to wear off so I might be saying something different in an hour.

Although I’m now eating and managing, will avoid the tooth until all the pain killers have worn off, then we’ll see.

Anyway, foooood! I’m so hungry!

D.

I don’t have a fear of dentists now, I’m not sure I really did, but I’m pretty sure that root canal is probably one of the worst things you might need, and maybe I’ve just found a really good dentist but I felt reassured and the trust I placed in them was deserved.

Comments

A Year Has Passed!

So a little over a year has passed since I last wrote in this blog, a lot has happened. I never followed up being chucked out of our old house, we did get chucked, but we found a bigger place which is closer to work. We’re happy there apart from having a little overly “intrusive” land lord (nothing major, just “notices” the grass hasn’t been cut in four weeks, etc.). I can’t remember if I said I’d moved into my new job before I stopped writing but I have, and I’ve already been promoted which should be effective very soon.

I do mean to post more regularly on this blog, however I thought I’d just do a very quick round up before blogging about what I wanted to blog about.

Comments

« Previous entries