In college I was broke and living in a house without central AC. The solution was an old window unit my parents had sitting around somewhere. It was a bit old and dirty but blew precious cold air. It worked... for a while. Eventually it would start to stay on and run until it had consumed a ton of power and turned itself into a giant block of ice. A good smack would fix it for a while, but soon percussive maintenance was no longer good enough.
I was excited to upgrade this thing a super awesome modern design, with a fancy readout, push button programming and real time clock. I would be able to program the temperature to change throughout the day saving every extra penny I could on the electric bill. So I designed it, drew up my parts list, had a decent version 1.0 in eagle, then I started hunting for parts. A quick tally showed that getting the circuit board made was going to cost me around 65 dollars and parts were going to run another 30 to 40 easily, and shipping is never cheap when its hot out. A new AC unit costs barely over 100 at the hardware store most of the summer, and some careful craigslist shopping can procure one for half that.
There was no way around it, I had to simplify. The whole point of this project was to save money instead of just buying a new unit. The absolute simplest method would have been to use toggle switches for the fan speeds and a comparator and potentiometer for the thermostat. I decided to go a little more complex than that. I used an ATTiny13 to control everything using a simple analog temperature sensor and some simple relays. Low voltage power was supplied by a cheap board from eBay.
The relay boards were my first attempt at having a PCB manufactured. I used OSH Park for fabrication and borrowed the schematic from sparkfun. The rest was made on basic prototyping board. I used the internal oscillator on the ATTiny and had just enough pins. I used 3 relays for the fans and one for the compressor. The lowest fan setting ended up mostly just making noise and not really moving much air so I disconnected it. Its relay was later used as the original sticking on problem returned.
The code was fairly straight forward. I hooked up the sensor and used a serial output to find the raw value in an area of the house that I found to be a comfortable temperature and used that temperature to cycle the compressor on and off. The fan speeds were adjusted up and down and eventually all the way off as the temperature strayed from that set point. I sampled the temperature relatively infrequently and used some basic averaging to try and keep the compressor from clicking on and off quickly.
I used the system for about a year and it worked well enough. After a while it would start to stick on again much like the original system. I robbed the relay from the lowest fan setting for the compressor and it made it through the rest of the summer. The biggest problem was simply the relay circuit that I used was designed for low power DC an not the higher power AC that I was switching. Astute observers will notice that I had no way of setting up the relay to switch at the zero cross and I was switching whenever I felt like it likely damaging the relays over time.
The staggered temperature operations worked out quite well. I was able to leave the AC unit on full time as the weather changed. On nice days it just left itself off using minimal power for the micro controller only and then ramped up the super fast fan when it got hot. I would have liked to make it user programmable since if I wanted to change the temperature I would need to reflash the micro controller. It's looking like I will be diggin this project back up to revamp since my new house does not have central AC either, so stay tuned for the updates/fixes.