Thursday, December 27, 2012

Exploitation

Every year at Christmas my wife and I donate to Samaritan's Purse, a Christ-centered emergency relief and development organization.  The group puts out a gift catalog, highlighting specific projects that donors can participate in: water development projects, emergency surgery for those without access to medical care, bicycles for traveling pastors, et cetera.  The donations are most easily done through the organization's website and this year I noticed something funny when I popped over to start browsing the online catalog.


The web address for this pages ends in "gift_catalog_exploitation".

This is not reassuring, to say the least.

Thursday, December 13, 2012

Workout Schedules

A Plant Fitness gym opened up near our house recently and, tempted by the five minute walk from our house and the $10/month membership fee, my wife and I decided to join.  So far, we have both made regular use of the facility and are easily getting our money's worth.

The last time I was in there was a flyer at the main desk showing the average number of members in the gym for every hour of every day (the gym is open 24/7) for what I assume is the entire length of time this particular facility was open (about a month).  This big table of numbers had the most popular times shaded with the tacit advice to all members that working out during less busy times would be a good idea.

Being the data nerd that I am, I was pretty excited to see the facility publish this. Admittedly, with only a few weeks in operation, each entry in the table was probably only averaged over four or five data points but its better than nothing.  To help make the data more easily interpreted, I made a graph.


The data clearly shows the after-work time slots are the most popular with the before-work time periods also being commonly used.  Weekends tend to not be busy and of course, the dead of night is a good time to have the gym to yourself.

I'm hoping they update the data and republish in a few months.  I'd be interested to see if a larger data set produces any significant change in the data and/or trends.

Thursday, December 06, 2012

I'm Famous (Again)

The commentator in one of the podcasts I listen to, John Siracusa of Hypercritical, has a regular section at the beginning of each show where he further addresses issues brought up in previous shows.  This follow-up is usually prompted by listeners writing in and offering further insight, often based on previous experience.

During last week's episode, John was speaking about a rumored deal between Apple and the semiconductor manufacturer TSMC and expressed a little bit of confusion about why the particular deal would be arranged in a particular way.  Based on my time at Micron, the deal made perfect sense to me and so I took ten minutes to email in my thoughts.

As I'm listening to this week's episode, I hear John begin the follow-up section and my brain snaps to attention: if my comments are going to get on the air, it will probably be on this show.  I listen carefully and the follow-up begins to wander toward the Apple/TSMC deal.  John begins to provide context for the story, reminding the audience what was a little confusing about this rumor.  My breathing is quickening and I can feel the nervous energy beginning to course through my body.  This is the same anxiety I've felt when presenting my work in front of other like when playing a musical solo or presenting my master's thesis.  My fingers seem unable to stay completely under my control, I have an incessant urge to wiggle my toes.  Externally these are the only signs but my mind is singular in attention and body seems to know this and wants to run wild.

By the cadence and tone of John's voice it is clear that the moment of truth is quickly approaching. In just a few words he will reveal to the world the comments sent in by a listener and judge them as worthy or not.  The set-up seems so focused, so inevitable, like his words are leading the audience down the path, to the stage where my contribution will be shown.  But will they be mine?  Perhaps another wrote in with the same experience but expressed it in more concise and insightful way?  I'm all but certain that the past sixty seconds of John's voice are for me and I simultaneously fear I have deluded myself, that I have heard this all with rose-colored ears and reality will disappoint.

Here is what actually transpired.  (Starting around 6:45).

Unlike my last claim to fame, this one actually involves me being named.

Saturday, December 01, 2012

Replacing Windows

Apparently the University reads my blog. I posted my dire warning showing the flexing of the Engineering Building upper hallway windows in a storm and now the windows are being replaced.



Two years later.

I'm taking credit.

Friday, November 30, 2012

Dead Bicycle Tire

After a ride to school and back with an annoying rhythmic sound and very minor damage to my bike, I identified a tumor of the sidewall of my real tire (always the rear one, the harder one to get on and off).  I feared the tire was failing and that I was going to have to replace it.

I was right.




This is the interior of the tire after I turned it inside out for inspection. I don't know what caused this but the damage is done and there is no repair that I know of.

New tires are on order but I suspect my riding to school won't resume before the end of the semester.

Save Icon

I recently was able to upgrade my Mac version of Office to 2011, the latest version.  Today I used it for one of the first times and in opening Excel I saw this:


A floppy disk (or disc?) being used for a save icon.  I was alive and computer-aware enough when the transition to those rigid discs took place and it was decades ago.  When was the last time you held one of those discs?  Its been at least five years for me, maybe even close to ten.  There are students in college now who are very computer literal and have never used one of these.  I'm sure they are aware that it means save and might even know that it is a floppy disk.

 I vote that we find a new image for saving. And I'm not the only one who is talking about this.  Always easier said than done.

Sunday, November 25, 2012

Secret Project Revealed: The DIY Digital Picture Frame

If you've been following this blog, then you know I've been writing cryptic snippets about a secret project. The secrecy was necessitated by the fact that this project was a gift for my wife and posting your plans for her gift to internet is not a good way to keep a secret.  Her birthday is now passed, she is in possession of said item, and the secrecy can be diffused.

The gift: a DIY digital picture frame.

The project got its' start when my mother-in-law turned over to me a dead laptop, one that had died of a video card failure which was not economical to repair.  This was quite unfortunate for her as the laptop had a 17" screen which I knew to be working perfectly fine.  My response: do nothing with it for six years.

It was during a recent cleaning spree that I disassembled the laptop, scavenging for parts, and was able to completely remove the LCD panel from its' frame.  I held in my hands a perfectly good panel and wondered, what would it take to make this into something useful?

I Googled around, talked to a friend, and thus was born my ambition to make a digital picture frame.

Problem one: I needed a way to plug a VGA, DVI, or HDMI signal into this panel. All I had was a mystery connector running out of the back of the pannel and that wasn't getting me anywhere.  Upon advice from my friend, I found a place in China with an eBay store that sells a kit which plugs into the panel and provides a VGA and DVI port as input.  Update 1 was made as a test of the kit shortly after I received it.  I took the VGA out from my wife's computer and plugged it into the kit now connected to the panel.  It worked; I was happy.

Problem two: I needed something to actually push the images up to the display, something like a really small computer.  You know what? They make those.  They go by the name "Raspberry Pi" (one of many products but this quite popular right now) and for not much money, I could have a computer slightly larger than a deck of cards with an HDMI output I could use to put images up on the display.  The Pi's default OS is a Linux variant and I would need a way to make it display images from a folder of my choice on the screen in a slide-show fashion.  The command-line program fbi fits the bill perfectly. Update 2 was my testing of the Raspberry Pi running fbi on a folder of test images.  The display being used was our TV; the Pi has an HDMI and composite video output but no DVI or VGA.

Which brings us to problem three: putting the pieces together.  The Raspberry Pi runs off of 5V, the display driver kit runs off of 12V. I needed to covert the HDMI output of the Pi to DVI or VGA.  I wanted to add wireless network connectivity to the Pi but that required using a powered USB port as the power available on the Pi was widely documented to be inadequate for such an application.  This is systems integration and the devil is in the details.  How does this signal get there?  What voltage needs to be here?  What type of connector is needed here?  Will this piece communicate with that?  I spent several hours playing with different configurations and wirings and paper and when I physically put the pieces together, I ended up with this: Update 4.

In addition to the wireless network connectivity (which allows my wife to add and remove pictures from the pool the frame will display), I had the ambition to include a motion sensor that would turn the display on and off based on the presence of people.  Again, more design decisions and playing around to try to figure out what would work best.  Update 3 was a test of how low a voltage could be used on the display driver kit; it says it needs 12V but it worked at 9V and I'm pretty sure the voltage I'm using right now is a bit below 8V.

My plan was to write a little bit of code for the Pi that would read the sensor, keep track of how long it was since motion had been detected, and after a pre-programmed time, kill power to the display driver kit and effectively shut the display off.  All of this required a bit of external hardware and Update 5 was the completed circuit I constructed to facilitate this.  (This is the blank brown board in Update 4 now filled-in.)  Oh, and the wonderful frame, I didn't make that.  I took the display into Hobby Lobby and had them make a custom-sized shadow box frame.

There were glitches, set-backs, unexpected complications along with way that I'll fill in when I write about the full technical details in a forthcoming post, but the system is up and working as I write this.  My wife loves it and is duly impressed. She thinks there is a market for something like this and so do I; my ambitions go beyond what I've built here.  Maybe down the road I'll upgrade the system and see if I can make some of these other ideas a reality.  Always more to do than I have time or money to try.

Portal 2 Cooperative: The Greatest Game Ever

I do enjoy me some video games.  The demands of a responsible life means my time playing is limited and often in relatively small chunks.  One of the games that has fit this lifestyle well is  Portal and its' sequel, Portal 2.  The strength of both of these is a truly creative game-play mechanic: the ability to connect two points in space with a portal.  Rather than trying to explain any more than this, I'll let the video below do the talking.

(The humor demonstrated in this video also persists throughout the game, adding to the enjoyment).

Portal 2 added more of the same in all departments as well as expanding on the repertoire of mechanics with fluids that allow your character to run faster and jump higher, bridges made of light, and catapults that throw you across the room.  I loved it all from the humor filled introduction sequence to the difficult (for me) final showdown with the test-obsessed robot overlord.

Except I didn't get to play it all.  There is a whole second half to the game which you must play with a friend, each of you controlling a character with a portal gun to solve puzzles that couldn't be solved otherwise.  Until recently, I had no friends....

.... who had played Portal 2 and could join me on this mission.  That changed a few weeks ago and though our time playing together has been limited, it has been a fantastic experience. I can't highly recommend enough playing the co-operative test chambers with a good friend. I look forward to every minute of it, even though those minutes are often weeks apart.  One of these days we will finish all those test chambers and the satisfaction will be high.

(This will only leave all the community created test chambers, both single-player and cooperative.  I just discovered these when I started playing cooperatively with my friend.  The software developers have provided the tools for game players to become game creators by developing there own test chambers and posting them online for others to play. There are over 200,000 of these, more than I will ever play.)

Tuesday, November 06, 2012

Secret Project - Update 5

I've had to rework part of the design a few times but what you see below has been tested and is working 100%.  The software to use the board has also been written and tested and the board has been integrated into the system as a whole.


The project is nearly complete and I'm waiting on one more item that should be coming in soon.  Plug it in, make a few more software changes and it will be done.

Sunday, November 04, 2012

Daylight Savings Time


This is the effect that the time change had on my home temperature measurement system; look at the green and red traces between 1am and 2am.

Everything's Working (Mostly)

As I wrote a few days ago, this week was off to a sub-par start in the Hardy household: our furnace broke and my computer hard drive crashed.  The good news is that both are up and running again (for the most part).
We had a lucky break regarding the furnace in that the cold snap was only a snap and the weather warmed up enough that we didn't need it much past the weekend.  Our electric and kerosene heaters helped us limp along and by the time the repair people came out Wednesday, we were back into the 70s.

The furnace guys confirmed my suspicion that the gas valve was the problem.  This is the main valve that allows gas to flow from the house's gas line into the burner tray where the heat gets made. Our furnace has a pilot light and as a safety measure, a temperature sensor is installed close to the pilot light to detect its combustion and ignition ability. If the light is out, the gas valve won't allow gas to flow into the burner tray or to the pilot light.  When lighting the pilot light, holding down a switch on the gas valve allows a manual override of this sense and gas can flow just to the pilot light.  Holding the switch down and lighting the pilot light allows the temperature sensor to warm up and once its hot, the switch can be released and the pilot light will stay lit; the temperature sensor has given the thumbs up to the gas valve that the gas being released to the pilot light will get burned. In our case, releasing the switch extinguished the pilot light indicating that the gas valve was under the impression that the pilot light was not heating the temperature sensor.

When replacing the temperature sensor didn't solve my problems I suspected the gas valve would need replacing; it did. The furnace guys spent a bit over an hour cleaning the furnace and replacing that valve. They said our furnace was in good shape and that our particular brand had a reputation for longevity (though not efficiency).  A few hundred dollars to the nice repair men and we had a working furnace.

The computer repair has been more laborious. When your hard drive dies, all the data on it dies as well; hard drives die all the time and to the extent that data is valued, a robust backup strategy is a good idea.  Much to my surprise, I ended up using three of the four backup strategies we have in place during this repair process.  As I write this, I'm still working out a few of the details but I suspect everything will be back to normal shortly.

Strategy 1: Superduper!
Superduper! does one things extremely well: make a complete copy of your hard drive onto an external drive.  The most beautiful, wonderful thing about having a exact copy of your formerly working drive is that you can immediately pick up where you left off when your main drive dies.  This is exactly what I did: when I realized that Apple's oddly prescient email had come true, I booted from my cloned drive, did a few last minute house-keeping items for school on it, and then shut the computer down to take it in for repair.  Having the cloned drive gave me peace of mind that all was well and that I could safely send the computer in. (I clone our drives every night so at most, we should be out a day of data).

When I got my computer back from the shop, Superduper! also made the restore process easy: I simply used my clone as the source for the data and copied it all back onto the internal hard drive.  Six hours later (!) I rebooted my mac using the new internal drive and all was exactly as I left it a week ago.

Except for iTunes.

Though all the data was still on my drive: iTunes had some serious memory problems.  I suspect this had to do with the program being in the middle of downloading podcasts when the drive died.  It had forgotten all of the podcasts I had subscribed to and almost all of the applications and data on our iPad. When I plugged in the iPad yesterday evening (after getting my computer back up), it "backed up" the iPad and removed most of the apps that I no longer had listed in iTunes.

To be clear, we still had all the applications and data for the iPad on my computer; the iPad just didn't know it.  So how to get my iPad looking like it did a week ago?  iTunes only keeps one latest backup and that one was missing all applications and data.  If only there was a way to get iTunes to use an older version of the backup...

Strategy 2: Time Machine
Time Machine specializes in keeping historical records of files.  Superduper! remembers nothing but the most recent state of the entire drive; Time Machine keeps track of previous versions of your files and makes it pretty easy to copy an old version from its' archive back onto the main drive. (The big disadvantage of Time Machine is that you can't start your computer up from it.  Once your computer is running and you have a working hard drive installed, you can use it to restore your data but there is no painless, up-and-running-again like Superduper!).

I found where iTunes keeps its backup of the iPad, activated Time Machine, went back a week to right before my hard drive failed, and restored that larger, complete backup of the iPad. Then using iTunes I restored the iPad from this complete backup and in ten minutes, my iPad was back to its original state.

As far as the podcasts go, I decided to resubscribe to them manually.  I still have the files for any of the historical episodes I like to keep, and the resubscription process took only a few minutes.

Strategy 2: Crashplan
We use Crashplan as our doomsday, online backup. In the event our house burns down or a tornado takes all our computers to Oz, our most valuable data (photographs, legal documents...) are all stored off-site in the "cloud" and can be retrieved once our lives get back in order.   Though I didn't need to use Crashplan to restore any lost data, I did use it to get access to my resume while my computer was being repaired.  Crashplan provides a browser to all of the files it has stored and if you known where to find the file in question, it can be restored to whatever computer you're using at the time.  Though I don't recommend using this as a primary "cloud" file storage solution due to the laborious interface, it allowed me access to my files when and where I needed them and that is very handy.

Thursday, November 01, 2012

The Library, Its Full of Books

I have been unsure about my career in higher education since before it began. In fact, I let my ignorant fears and misunderstanding of the typical university professor job description scare me away since finishing my undergrad. Now that I'm on this path I my ignorance is decreasing but the uncertainty is receding much more slowly. I enjoy teaching so much that I have been fearful the other demands of the professorial life will hinder me from this task and turn the work into drudgery.  More specifically put, being a university professor is more than being an excellent teacher, particularly at bigger schools where research is most highly valued.

To better understand what I would be facing, I undertook the reading of "Balancing Acts: the Scholarship of Teaching and Learning in Academic Careers" by Huber. (Micro review: Outlines four professors who found ways to make teaching a priority despite working at research-oriented schools.  Good read but definitely thickly written in the ways of academics.) As is common in academic works, this book cited many sources including "Advice for New Faculty Members" by Boice.  This title was so highly recommend that I began to hunt for a copy.  Amazon had it and for $40 would let me own my own copy.  Wichita Public Library had not heard of it; no surprise.  I felt I had run out of options until I remembered, Wichita State has a big library, they might just have this title.

They did.

And many, many others, all on this seemingly obscure topic of managing an academic career.  Literal shelves stacked with books covering topics from the failings of universities to finishing a dissertation topic to being a mentor.  More books on the topic of university life than I could read even if that's all I did for the six years of my PhD.

I shouldn't be surprised, though; academics writing books about the academy.  It seems obvious in retrospect.  "Publish or perish" and all that.


Wednesday, October 31, 2012

#1 Halloween Fan

One of my favorite podcasts is 99% Invisible a show about design and its unseen power to make or break our experience with the objects around us.  At the end of each show the host, Roman Mars, gives his thanks to the supporters of the show, often corporate sponsors.  It is at this point that is son, Maslow, gets his 30 seconds of fame and often steals the show; steals is outright during what can safely be described as commercials.

Case in point: Series of Tubes.  The whole show is great but to hear the little man in action, skip forward to 15:37.

"Hall-a-ween"
"Hall-a-ween"

Cute even on radio.

Tuesday, October 30, 2012

Everything's Broken

I found out our furnace had a problem after the weather did thus to us:


Almost a 30 'F drop in three hours.  When we went to bed Thursday night it was 73 'F and when I went to school the next morning it was 43 'F.  I spent Saturday trying to get the pilot light lit with no luck; a repair man is coming by tomorrow.

Also, about two weeks ago I got the following message from Apple regarding my computer:

Apple has determined that certain Seagate 1TB hard drives used in 21.5-inch and 27-inch iMac systems may fail. These systems were sold between October 2009 and July 2011. Apple or an Apple Authorized Service Provider (AASP) will replace affected hard drives free of charge.

Apple is contacting affected iMac owners who provided a valid email address during the product registration process to let them know about this program. If you have not been contacted, but think you have a 1TB Seagate hard drive, you can enter your serial number below to see if it's part of this program.

My serial number was in the selected range and, to confirm this, my hard drive failed last night.  I tried using Apple's built in disk utility but it was not able to repair the drive so I'm without a computer until I can get it taken in to the local "Apple Authorized Service Provider".  My overkill backup scheme is paying off right now as I've lost virtually no data; at most a day's worth of podcasts. Maybe by the end of the week I'll have a working furnace and computer.

Tuesday, October 16, 2012

Air Conditioner Thermostat Strategy

If you are a frequent reader of my infrequent writing, you'll know that last summer (2011) I installed a system to measure the temperature in and around our house as well as keep track of when the central fan is running (when the air conditioner or furnace is on). Last summer I ran two experiments
  1. What is the effect on the attic temperature due to installing additional attic ventilation?
  2. What is the effect on the amount of time the air conditioner runs during the day based on whether I turn it off or leave it on while the house is unoccupied?
The data from the first experiment showed about nine degrees of cooling after adding the extra ventilation determined simply by comparing the average temperatures before and after making the change.  The second experiment was far less conclusive and as I said at that time, a more complex statistical analysis would probably be necessary to make a determination.

That was a little over a year ago and I now have another season of data and the desire to jump into the statistics. You science nerds ready to rumble and see where this leads?

I made the choice this past summer to throw in another variable: rather than just measuring the effect of turning the air conditioner off during the day, I also investigated the effect of changing the thermostat set-point.  Every week on Monday morning I would re-program our thermostat with a different set-point and then each day of the week decide whether to bypass the schedule and leave it on all day or let the schedule run, cooling the house in the evening to the set-point I had chosen.  The three set-points I chose were 77, 78, and 79 degrees Farenheit; sadly, the 79 degree data set turned out smaller than I would have liked so I won't be able to use it for this analysis; hopefully by the end of next summer this will not be the case.  

I threw two summers of data into the statistics machine and hoped to answer a few questions:

Question 1 - Is it more energy efficient to turn off your air conditioner during the day (or when the house is unoccupied)?

This questions has been asked for many decades and the technical term I've found describing the strategy is "thermostat setback".  Much of the research seems focused on using this strategy during the winter for saving energy on heating and the internet is full of opinions.  I haven't looked very hard but I did find one academic paper from 1978 ("Energy Savings Through Thermostat Setbacks" by Nelson and MacArthur) in which the researchers used a computer simulation to try to answer the question.  Their general conclusions support the use of thermostat setback with an unsurprising caveat: the effect of the setback is most noticeable when the degree of the setback is large and the length of the setback is long.  The lower the change in thermostat setpoint and/or the shorter the duration of the change, the less significant the effect. In scenario at our house, both of these conditions are satisfied (roughly): the setback period is at least 8 hours and the change in temperature is high enough that the air conditioner does not run at all when setback.

To do the analysis on the data I had collected, I split the dataset into three parts based on the thermostat setpoint when it ran during the evening.  Each subset contained data showing the daytime state of the thermostat (cooling or not), the evening thermostat setpoint, the 2-hour average peak temperature of the day, and the number of hours the air conditioner ran that day.  I then ran a multi-regression analysis using the air-conditioner run-time as the dependent variable and the outdoor temperature and day-time state as independent variables. (For those of you who don't know, multi-regression analysis tries to determine the mathematical relationship between variables based on a set of data.  More importantly for our purposes, it will also calculate whether a given input variable has a significant impact on the stated output variable. Specifically, it will tell us whether the daytime state of the air conditioner has a statistically significant effect on the air conditioner runtime.)

Answer 1
  • Thermostat setpoint = 77'F: Daytime state does have an effect on how long the air conditioner runs for the day.
  • Thermostat setpoint = 78'F: Daytime state does not have an effect on how long the air conditioner runs for the day.
It looks like I just happened to stumble across the turning point.  The statistics imply that if I set the thermostat at 78'F, I will not experience longer run time if I just leave the air conditioner on all day rather than turning it off when I leave in the morning.  If I set the thermostat at 77'F and do choose the turn the air conditioner off during the day, the statistical model predicts a reduction in air conditioner runtime of almost 2.5 hours if I choose to do this. 



Question 2 - Does the thermostat setpoint have a significant effect on how long the air conditioner runs for the day?  If so, how much?

I haven't done the research on this one to have an informed opinion so I'm just going to jump to my analysis. Dataset was the same as above but this time was split into two datasets, one in which the AC was running all day and one in which it was off during the day.  I then ran the same statistical analysis to build a model of that would allow me to predict how long the air conditioner would run given the two-hour average peak outdoor temperature and the thermostat setpoint.

Answer 2 - The thermostat setpoint is statistically significant in determining how long the air conditioner will run each day regardless of whether the air conditioner is off or on during the day.
  • Air conditioner off during day:  Each degree Farhenheit the thermostat is reduces saves 0.65 hours of air conditioner run time that day.
  • Air conditioner on during day: Each degree Farhenheit the thermostat is reduces saves 0.80 hours of air conditioner run time that day.


Question 3 - How much money can be saved by using thermostat setback or increasing the thermostat set?

Answer 3I recently was able to measure the power of my air conditioner: 4kW when its running. Let's use the ballpark value of  $0.10/kWh for energy.  This means I'm charged $0.40 for every hour my air conditioner runs.

  • Thermostat setback - If I choose to set my thermostat to 77'F and turn it off during the day (rather than leaving it running), I'll save almost 2.5 hours of air conditioner runtime which translates into $1.00 of savings per day.  Over a 30 day month this is $30 in savings.
  • Thermostat setpoint increase - We can save $0.26 to $0.32 each day per degree the thermostat is increased.  This doesn't sound like much and over a 30 day month, this is a total reduction in the cooling costs of $8-$10 per degree.

All of the statistical models were linear in nature and we know from Newton's Law of Cooling that the heat loss rate of a house is non-linear; the hotter it is outside, the faster the house heats up. It should take much more cooling effort to keep a house 20 degrees cooler than the outside than just 10 degrees.  A linear model predicts it will take exactly half and this is not correct.  The model predicts the same amount of reduction in air conditioner runtime by moving the thermostat setpoint down one degree Farenheit whether it is 85'F outside or 110'F outside.  A non-linear model would work better here but until I figure out how to make the magic statistical software do this, we'll have to stick to the linear model.

That's what I've go for now.  Until next summer when I've got more data, this is what I know.

Sunday, October 07, 2012

Secret Project - Update 4

I'm getting close.  I've got a few more parts on the way and then some final assembly still to do.  I should be done in time.


Tuesday, September 25, 2012

Secret Project - Update 3


It works lower than I expected. (Its measuring volts, by the way.)  This will make my life easier.

Saturday, September 22, 2012

Secret Project - Update 2

I've been able to test another aspect of the secret project and it looks like its working as advertised. Here's the proof:


More to come.

Friday, August 24, 2012

Secret Project - Update 1

Here's a very early look at another nerd project I've started working on.  No hints, I'll leave it to your imagination as to what I'm up to.  More to follow in the coming weeks and months.


Wednesday, August 15, 2012

Air Conditioner Power

In writing yesterday about evaluating the cost effectiveness of our fancy whole-house fan I mentioned that I only had a way of measuring how much air-conditioner run time was saved by using the fan, not the actual dollars and cents difference.  If I knew how much power the air-conditioner used I could make a rough guess on reduction in the energy bill due to the fan use.

Today, I found a way to measure the power and can now fill-in that gap. The number: ~4kW. (You have no idea how long I've wanted to know this number. This made my day.)

This is an astoundingly high number but I don't know how it compares to other air conditioners. Obviously power consumption depends on size; the window units are rated between 1 and 1.5kW. Our air conditioner is old and I bet its efficiency is not that great but I have so little documentation on it that I can't compare it to other more modern units of equivalent size.  Maybe that will be my next bit of research.

Now for some math: Even with a power bill, it can be hard to figure out the $/kWh we all pay.  Let's assume somewhere around $0.1/kWh, a ballpark number that makes the math easy. Using  $0.1/KWh and looking back over this summer's usage of ~8/day, the energy cost just for cooling is $3.20/day; 30 days in a month brings the total to $96/month.

As far as the cost effectiveness of the fan goes, well, there's still a few more complications.  The easiest one to address is the energy consumption of the fan itself.  Looking this up in the manual shows the fan is rated at 292W on high (which we most often use) .  This is a 1:13 energy consumption ratio between the fan and the air-conditioner.  For ballpark analysis purposes, we could probably just consider the energy consumption of the fan as negligible.  Its a bit of a stretch but my work so far has been just as imprecise and I can live with this.

The second issue is very much related to what I discussed yesterday: how many hours over the course of the summer am I using the fan when I would normally be using the air-conditioner?  The results of the experiment I wrote about yesterday show a 25% reduction (using awful experimental techniques) in air-conditioner usage when I use the fan.  Many days of the summer, though,  I can't use the fan at all as the overnight low is still above the indoor temperature.  If I get really committed I might go back through my temperature data and try to make some kind of estimate; that's more work that I want to mess with right now.  For tonight, I'm once again going to table this.

Tuesday, August 14, 2012

Effectiveness of Whole-House Fan

As I've written before, two years ago we installed a whole-house fan in an attempt to make better use of the sometimes-colder outdoor air to cool the inside of our house.  The fan has been great but I've been wondering if it was a good economical choice.  Would we have been better off just spending the money on air conditioning rather than this fancy fan?

To answer this question I would need to compare how long the air conditioner runs on days when we use it versus days when we don't.  Oh, and the days would have to be identical. Since I don't control the weather, doing a direct comparison is pretty much not going to happen.  The next best strategy is to find days with similar weather, use the fan one day and not the other, and do this a bunch of times to average out all the actual differences in the weather.  This is a better strategy but has two problems:

  1. The decision on whether to use the fan or not must be made without knowing the upcoming weather for the day.  Obviously weather forecasts solve this somewhat but it may be hard to decide if the predicted weather for the day is equal enough to the weather in some arbitrary previous day (where I've already collected your data) to make the comparison worthwhile.
  2. By definition, there will be days when I could use the fan but choose not to (so I can collect data for the air-conditioner-only case).  I bought this big fancy fan and I don't get to use it? And I'm doing this so that I somewhat scientifically determine if using this big fancy fan I already bought is doing what it should?  
In light of these two complications it became obvious to me that to do this experiment well requires more commitment to good scientific principles than I can bear right now.  Instead, I did the smallest experiment possible: two days that are vaguely similar in weather one using the fan and one not, measuring the amount of time the air conditioner runs on each day.



This graph shows the outdoor temperature on the two days I ran this experiment. The days are far from identical but do have a similar daytime highs and general temperature trends throughout the day.

The measured air-conditioner runs times are as follows: fan + AC: 3.8 hrs, AC only: 5.1 hrs.  That's a time savings of 24% when running only the fan.  The real question is how much money this saves me and for that I need to know how much energy my air-conditioner uses.  I don't have a way of measuring that at the moment but I've got one in the works. For now I'm going to have to be satisfied with run-time.

UPDATE: I've got a partial follow-up where I get an estimate of the air conditioners power consumption.


Friday, August 10, 2012

Memorization

At the beginning of the summer one of the pastor's of my church challenged the congregation as a whole to memorize a particular book of the Bible, James 1.  Memorization is not my strong suit but I am not one to turn down a challenge so I dug in.  Well, at least for the first month or so during which time I got about half way there. During a sleepless night last night a thought came to me: my Mac can convert text into speech and I bet those spoken words could be saved as an audio file.

It can.

Here's the workflow to download if you feel frightened by the idea of building it yourself in Automator.  The file needs to be placed in your ~/Library/Services/ folder, that is, the Library found in your home directory. (If you want to make it available for all users of your computer, just place it in the global library folder /Library/Services/).  If you don't have a Services folder in your library just create one and drop it in.

To use the service just highlight the desired text, go to the menu of that application, select "Services" and then "Text to AAC".  The workflow will create an AAC audio file out of that text and save it in your iTunes folder as a song called "Text to AAC Output". Not only is this a neato demonstration of a built in feature on all Macs, but it has been actually useful in helping me with my memorization.

Saturday, July 14, 2012

Home Power Monitor - Arduino ADC Speed

An important part of my home power monitor is the ability to measure the instantaneous power for a given circuit; this will allow me to calculate other important nerdy things like the power factor and reactive power.  This approach requires frequent sampling of the voltage and current waveforms so that the average power over many 60Hz cycles can be found.  There are two important points in making this work well:

  • The voltage and current should be measured (ideally) simultaneously so that the power at that specific point in time can be determined.
  • The rate at which new voltage and current measurements are made needs to be high enough that the accumulated samples form an accurate representation of the source waveform.  This is especially true if the current waveform has transients and nonlinearities (due to non-linear loads caused by power electronics).
Both of these factors are highly dependent on the speed of the analog-to-digital converter (ADC).  Assuming that multiple-channel simultaneous ADCs are not being used (which is the case for my system), separation in time between the voltage and current measurements will be entirely a function of the conversion time.  The measurement of the current can't start until the measurement of the voltage is complete.  Similarly, the rate at which the 60Hz voltage and current waveforms can be sampled is determined by how long it takes one voltage-current measurement pair to be made.

For the sake of simplicity, this prototype system I'm building now is going to use the Arduino's on-board ADC.  This ADC has a built-in multiplexer which has a reputation for not being very fast but since I am planning on using an external multiplexer to accommodate all the power circuits I want to measure (the Arduino can only mux in 8 channels, my plan calls for 13-16), I can get away with only using a single channel for the on-board ADC. 

The question that remains, then, is how fast the on-board ADC can do a conversion.  My prowling of the internet found some very experienced people who found a way to adjust the clock that the ADC uses when converting.  The ADC clock runs at a scaled down rate (prescaler) of the main system clock and the scaling rate can be changed programmatically.  A part of the documentation for the microprocessor used in my Arduino states:

The ADC accuracy also depends on the ADC clock. The recommended maximum ADC clock frequency is limited by the internal DAC in the conversion circuitry. For optimum performance, the ADC clock should not exceed 200 kHz. However, frequencies up to 1 MHz do not reduce the ADC resolution significantly.

Operating the ADC with frequencies greater than 1 MHz is not characterized.
Ignoring the actual results from the conversion, I decided to characterize the time it takes for the ADC to complete a given number of conversions.  The results from this test are below showing the conversion time for a varying number of conversions.  The last column is the difference in the 1 million conversions time as compared to the previous prescaler value.

Prescaler Value     1k conv.   10k conv.   100k conv.   1M conv.   Difference
2                     7.52us     7.43us      7.42us       7.42us    -
4                     9.53us     9.32us      9.30us       9.30us    1.88us
8                    12.78us    12.57us     12.55us      12.55us    3.25us
16                   19.15us    19.04us     19.04us      19.03us    6.48us
32                   32.19us    32.02us     32.00us      32.00us   13.00us
64                   60.28us    60.24us     60.24us      60.24us   28.24us
128                 112.24us   112.02us    112.00us     112.00us   51.76us


There are two reasons to feel confident in this data:

  1. The conversion time is reasonably consistent across the various number of conversions.  There is not a dramatic difference in the calculated conversion time when the loop contained 1 thousand conversion and 1 million conversions.
  2. The difference in conversion times scales very nearly linearly with the prescaler value.
Based on these results and the documentation's note that the ADC should operate reasonably well up to 1 MHz, I am planning on setting the prescaler to 16 giving me that 1 MHz conversion rate.  Doing the math: 16 channels at a conversion time of 19us per channel gives me a total of 304us to sample all channels.  With a 60 Hz waveform this allows 54 samples across all channels in one cycle.  This is maximum conversion rate I should expect; the test above does nothing with the conversion results except store them.  The arithmetic I need to do will slow the process down; characterizing that will be another test I'll have to do once the hardware is complete and I have a fuller start on the hardware.

Sunday, July 08, 2012

Home Power System - Hardware Build - Part 2

Here's the latest developments in the home power system monitor:




The black rails down the side are the connectors for the current sensor connector modules. Yes, that makes it a connector for a connector. This is what happens when you buy connectors that you can't solder directly to the board. I've also decided to provide connectors for (and thus modulize) the analog mux I'm going to be using to read all these signals into a signal ADC port on the Arduino, the Arduino itself, and the radio I'll be using to send the information on to a computer for reporting.

The two sockets towards the top are the amplification modules for the current sensors. Each socket will hold two MCP6002 op-amp DIPs giving me a total of four channels per socket. I would have used the correct sized socket (one DIP per socket) but I forgot to order more and my supply here at home is almost gone.

I've completed four channels so far with four more to go before I get done creating channels for all of the circuits in my house that use both sides of the split-phase wiring. This makes eight current sensor channels to read four appliances here at home: mains, air-conditioner, oven, and clothes dryer. For now I'm only going to add three more channels (for a nice, even 11 channels total): refrigerator, entertainment center, and downstairs utilities like a chest freezer and clothes washer. Assuming this all works fine, I have room for three more channels in my current design.

Tuesday, July 03, 2012

Home Power System - Radio Assembly


Each one of those green things is a radio capable of transmitting and receiving data when hooked up to an Arduino.  You'll notice the there are actually two boards soldered together for each module.  My good friend Keith did the layout and legwork in getting the "motherboard" PCBs produced and last night hand-soldered all the components except the radio itself. Note the impossibly small size of the chip on the backside of the board (labelled "TXB0108").  Did I mention that Keith really enjoys doing detailed work like this?  I picked the boards up from him this afternoon and soldered on the radio "daughterboards" this evening.  My work is the messier of the two; forgive me, Keith.

The radios are quite impressive little beasts that provide a large amount of functionality in a very small package. For $7 I got everything I'll need to transmit my power measurements from one Arduino up to the Arduino I'm using right now for my home temperature monitor. I'll be able to use those existing scripts and data presentation methods to generate all the graphs I'll need. There is a lot of information out there on using this radio and I am hoping/expecting it won't be too difficult to get working. The only thing missing now from these modules is the antenna which will simply be a few-foot-long piece of wire.


The tiny chip on the back is a relatively expensive level shifter to convert my +5VDC Arduino signals down to a +3.3VDC that the radio is expecting. Other's have done this level shifting with resistors on signals headed to the radio (and nothing for the signals coming from). This seems to work just fine but technically such a plan doesn't quite meet Vih/Voh requirements; there is a small chance that some batch of chips will barely meet their specs but not work in this application. To avoid this possibility (and try out a new chip), Keith and I decided to go with the level-shifter and see how it works. I probably won't be testing the radios for a while as I'm focussing on getting the other hardware assembled.

Monday, July 02, 2012

Home Power System - Hardware Build - Part 1

For the past few months, in my voluminous spare time, I've been working on developing a system similar to my home temperature monitor that would monitor and record electrical power consumption.  The system will  measure the total power consumption of the house as well as that of a select few circuits (air-conditioner, oven, microwave, ...). The design has been almost entirely on paper until yesterday, when I started soldering and testing the first pieces of the design.  Below is what I've accomplished so far:



The two blue blocks on the left and right is where the two phases will be plugged in and the big white, brown and yellow blocks are transformers that will change the voltage from 120VAC (RMS) to 8VAC (RMS).  Most of the components along the top use one of the outputs from the transformer to make a +5VDC power supply; there is also a precision +2.5VDC reference (and capacitor) at the very left of the row of components.  Below that row of components are two op-amps (my new favorites, the MCP6002): one buffers the precision reference and the other (not quite complete) is used to scaling down the voltage supply from each phase to be sampled and used in power calculation.

I've been testing as I've built and so far everything works great.  I learned that the precision reference I'm using (MCP1525) REQUIRES a capacitor on the output and that its important to take your time and get the wires soldered in the right spot.  The later is a bit tricky when you're constantly laying the parts out on top but having the solder the connections on the underside. I'm considering this a prototype version and, assuming it works well, may at some point turn this into a more professional design by making a PCB.

For those interested in the theory, in broad strokes, here is how I plan on measuring power consumption. I am interested in measuring the full complex power which means I need a way of determining the phase difference between the voltage and the current. After some consideration, I decided the best way to go is to sample the voltage and current waveforms directly and calculate the power as the multi-period average of the product of those two.  This is the most general (and hardly ever used) method for calculating power and it allows me to measure the non-sinusoidal waveforms that power electronics (computers, TVs, ...) generate.  Using this technique also allows me to calculate RMS voltage and current which can be used to calculate the apparent power and from there the reactive power and power factor.

Using the general approach is powerful because it enables all these other measurements but it has its own complications.  Since this is truly an AC system, half of the waveform is positive and the other half is negative and is therefore outside the voltage range of the Arduino's ADC.  To make the system work, I'm having to do a bit of signal conditioning to shift all the AC waveforms so that they are centered around +2.5VDC and and adjust the amplitude of each signal so that its maximum voltage swing is 5Vpk-pk. (This is the reason for the +2.5VDC precision reference; it provides a stable elevated "ground" point for my signal conditioning).

Thankfully, the same mechanisms I'm using to isolate this board from the high voltages and currents in a home power system also serve to allow my reference point to be moved up from ground to +2.5VDC: transformers.  All the voltages and currents are measured through transformers which removes the negative side of the signal from the true ground reference and allows me to assigned this signal a reference of my choice. One of the op-amp on the board above handles the amplitude adjustment and scales the signal down so that it fits in the 0VDC-5VDC range.

Sunday, June 24, 2012

Panoramas

I just stumbled upon a free photo stitcher called Hugin and have been using it to redo the panoramas I have taken over the years.  I previously used Photoshop Elements 3 (which must be around 10 years old) and I have not been very impressed with the results.  Hugin has been great, though.  The software is quite complex and there are settings and options far beyond my comprehension.  Thankfully, there is a three-step bozo mode that by-passes most of the mess and seems to just work, most of the time.  The results are great and I am enjoying being able to breathe new life into these photos.  

Pike's Peak (part-way up)


Pike's peak (almost at the peak).


Kuaui, Hawaii


Kuaui, Hawaii


View of the refineries on the north side of Baton Rouge



Garden of the Gods, near Colorado Springs

Wednesday, June 20, 2012

MagicJack Tech Support

This is one for the nerds.  If you've ever been frustrated by technical support that seems to know less than you, you're going to be able to relate.  I just ended my technical support chat with MagicJack, an internet phone company.  The support chat ended when I was informed the chat had ended; this is prior to finishing our trouble-shooting.  Even though I think they were headed down the wrong path I learned what I needed to know and managed to make the changes on my own.



Please wait for a site operator to respond.
You are now chatting with 'Marianne'
Your Issue ID for this chat is XXXXXXXXXXXX
Marianne: Hello, how may I help you?
Trevor: My USB Magicjack is constantly giving me the "Error 1 - No network connection message" even when I know I have an internet connection.
Marianne: May I have your Magicjack phone number please.
Trevor: 316-XXX-XXXX
Marianne: Please wait while I check that for you
Marianne: May i know  what device do  you  have a problem  with? since   I have check it here  you have 1  mj plus  and 1 old  mj device  here  in your account
Trevor: MJ Plus.
Marianne: May I know where did you used to plugged in your mj plus device in the computer or to the wall?
Trevor: Not plugged into my computer.
Trevor: Its plugged directly into the wall for power and also to the internet.
(I was trying to keep things simple at this point and answer the question the support person was trying to ask. The plug "to the wall" doesn't really describe the device well.)
Marianne: May i know if  you  have a  router there?
Trevor: Yes, I have a router
Marianne: May i know the   router  brand  model   that you are using please?
Trevor: Router is an Apple Airport Extreme.
Marianne: I   need the  exact  model  please
Trevor: The device identifies itself as an "Airport Extreme 802.11n (2nd generation)"
Marianne: One moment please...
Marianne: This issue is fixable, please allow me to guide you, so we can trouble shoot on your computer
Marianne: Please plug in your magicjack plus   device now to your computer.
Trevor: OK
Marianne: Please click the link to download and run the magicJack upgrade:
Marianne: Please inform me if you see dial pad after you run the upgrade link.
(This was helpful.  I had forgot to try a firmware update and having the link handy is great.)
Trevor: Running the installer now.
Marianne: Okay
Trevor: I see the dialpad now.
Marianne: Please  check if  you see  “   stock symbol Call’ there?
(I saw something that said Stock Symbol:Call" so I answered "yes".  I think this was the correct answer.)
Trevor: Yes, I do.
(At this point I plugged in a phone and tried to make a test call to see if things were working.  They were.  The support person doesn't seem to want to check this right now so I keep playing along.)
Marianne: • Please click the MENU on your SoftPhone dial pad and choose "VOLUME/HEADSET CONTROL." then tell me if you can switch between telephone or headset/other
Trevor: Yes, I can check either of the two boxes ("Telephone" or "Headset/Other") and the settings in the window change.
Marianne: Please  set it to telephone there  
Trevor: Done
(I don't know how this is going to fix my the connect problems but, oh well.)
Marianne: . Please click Apple menu at the top-Left corner of the screen and choose"System Preferences." Then open "Sharing" Icon.
Trevor: Done
Marianne: The first section that appears is the "Services" settings, Please check the entries that says Internet Sharing, Web Sharing, Windows Sharing, File Sharing and XGrid Sharing.. And click Start if you have a start button...
Trevor: Done
(This is crazy.  None of these services are necessary for this device to work properly.  This is like saying you need to open your windows, tilt the rearview mirror all the way down, and sit in the passenger seat when you start your car.  I know this because my Magicjack used to work just fine even when it was never plugged into my computer.  By starting up all these services I am (marginally) decreasing the security of my computer.  This is time-wasting, unnecessary, and slightly scary.)
Trevor: How will settings on my computer affect the MJ when it is not going to be plugged into my computer during normal use?
(Yeah, so this is the my big complaint.  My Magicjack is the kind the plugs directly into the router rather than into a computer.  We established this at the beginning of the chat.  It doesn't seem like I should have to make any changes to my computer to get the device to work properly. )
Marianne: We are doing  fixes  now. Please    just  follow the  steps   I gave to  you  
("Fixes". Got it.  I guess I'm just going to undo everything after this chat.)
Trevor: OK
Marianne: 5. Please click on the "Firewall" tab.
Marianne: 6. Please check if it says "Firewall Off" or "Firewall On".
Marianne: 7. If it says "Firewall On" please click on the button "Stop"
Trevor: I see no "Firewall" tab in the Sharing Preferences.
(The reason I don't have a "Firewall" tab is because I'm not running Windows.  Somehow the support person copied and pasted the wrong script into the chat.  Didn't even bother to take the step numbers out of the document she's looking at.)
Marianne: Okay..
Marianne: Please click Apple menu at the top-right corner of the screen and choose "System Preferen
Marianne: I  mean for  "System Preferences."
Trevor: Done
Marianne: Please open Network then click on your active Network Connection (Example: airport, Ethernet) and tell me the IP address
Trevor: IP is 10.0.1.107
(Uhmm, I don't think the IP address for my computer is going to fix this because, as I've mentioned, the Magicjack is not normally plugged into my computer. This is fixing a problem that doesn't exist.)
Marianne: . Please open up the Finder on your Mac task Bar and click theApplications button near the left of the page.
Trevor: Done
Marianne: Please click the Utilities button near the right of the page and click theAirPort Admin Utility button near the right of the page.
Trevor: Done
Marianne: Please Select Apple Base Station from the Select Base Station list. >>> Click the Port Mapping button near the top of the page. >>> Then click the Add button near the right of the page.
Trevor: Done
(These instructions are awful but I have had enough experience with my router that I knew what needed to be done. I pity the less educated who must try to decipher these obtuse and misleading instructions.)
Marianne: Please type in 5060 on both Public and Private Ports, The type 10.0.1.107 _(use the IP address) for Private Address and click OK
Trevor: Done.
Marianne: Please click the Add button. again and type in 5070 on both Public and Private Ports, The type 10.0.1.107  (use the IP address for Private Address and click OK
Trevor: Done
Marianne: When you're finished, please click Update near the bottom of the screen to save your changes.
Trevor: Done
Marianne: Please restart your Magicjack device. Just unplug then replug it after 2min
Trevor: Waiting 2 min...
(2 minutes!  I have no idea why we would need to wait that long.)
Marianne: Okay
THIS CHAT HAS ENDED.



So, from this chat, I learned I needed to update the firmware on the MagicJack and what ports I needed to set up to forward to the MagicJack when its plugged into my router.  No explanation as to why it stopped working a few days ago.  For now, we're back up and running.

Oh, and in case you're wondering, I don't recommend Magicjack.  Its cheap but you get what you pay for.  Since we hardly use this phone, its OK that it seems to hardly ever work.  I'm probably not going to renew after the first year.

Friday, June 08, 2012

Baton Rouge Plantations

My wife was very interested in visiting plantation during our trip and even though we went to three, I think she would have liked to see many more. She and her family are very history-oriented and the continued existence of these old buildings over a century old have great appeal.

Though I do not share her great interest, I did have some mixed feelings about visiting these sites. Not growing up in the South, this was my first direct contact with the pre-Civil War era and, arguably, the root of that war, the in humanity that was so tied up in it: slavery.  I grew up far removed from the troubles our nation's legacy of slavery have and continue to create; I didn't grow up in the South and this is not a part of my cultural identity.  I do appreciate, though, that these plantations can easily be seen as a symbol of that dark mark on our history and it seems awkward to make them historical sites and museums, tourist destinations.  By the same token, they are historical sites, they are significant artifacts of a former time.  Removing or ignoring the buildings serves little purpose and may not be beneficial; ignoring the past gets us nowhere.

I'm embarrassed.  Even though I had nothing to do with it, I'm embarrassed that this is a part of our history and I wish it had never happened. Its like being reminded of some foolish choice made in adolescence or dealing with that drunk uncle at your wedding who has lost all inhibition.  Its true, it happened, it can't be denied; I just want it not to be so.

And make of this what you will: during our time touring these three plantations, I only saw one African-American and she was working as a tour guide.


The philosophical misgivings aside, the plantation complexes and the central homes that are its focus are truly wonderful old buildings.  As all our tour guides said, these plantations were owned by the supremely wealthy of their day.  This was not their only residence and they may or may not have been living there year round.  The United States has largely rejected the more class-based cultures that have been a strong part of Europe's past but these plantations were truly a mark of the aristocracy of that day.  The owners needed and lacked for nothing and had the finest available in all respects.  Who else pays for hand-painted wall-paper murals to be custom-made and imported from Europe?



The age of the plantations is echoed in the age of the trees.  Though not as old as many of the forests I grew up around, the branching, reaching, canonpy-ing of these centurion oaks was impressive. This kind of beauty can only come with time; there's no rushing the slow majesty that is old growth.






There is so much of these houses that exudes the wealth of their creators.  The expansive gardens, the architectural details, the size of the houses in what were very rural settings.  Its hard to imagine having so much material means that your country home could easily house multiple families.



One of the plantations we visited was unique from all the others: it was only forty years old.  All except the columns of this building had burned in the 1950s and over the 1960s the home was rebuilt to its former glory.   It is an ersatz plantation which brings with it a distinct advantage: the building has all the modern benefits of appearing to be a planation with none of the burdens of historical preservation.  The current owners live on the third floor, there are some out-buildings that are rented as a bed-and-breakfast, and receptions are frequently held on the lower two floors.  Though the house is populated with period furniture, it is all reproductions and can be used practically.  When TV or film productions need a planation home, this is the place to go as it can be entirely redecorated as needed. The owners make their entire living by providing this fake plantation for use by whomever needs it.  In my mind, this is an ingenius use of the home and grounds.

Radioactive CFL


If you have very many compact florescent light (CFL) bulbs, you may have noticed that they glow for a while after you turn them off. The above is a ten second exposure in such a situation.  I didn't expect the green color.