I have an Akita mix. She is the definition of a winter dog but with summer coming, I'm worried that she will get too hot in my house during the day. I don't want to leave on the air conditioner all day because that will waste a lot of energy but I need to leave it on because she'll get over heated. I don't have central air in my house so my thermostat only controls my heat. I wanted a way to cool my house to a set temperature without having to buy a whole new air conditioner so I made a device to do it. I used a power switch along with the very capable Particle Photon to build the Air Conditioner Controller.
In normal air conditioning systems, there's either an on or and off. In order to avoid the system from just switching constantly, it overshoots (keeps the air conditioner on past the actual temperature). I decided I wanted to do the same thing for my system. If the temperature gets above my target temperature, I want the air conditioner to turn on and continue to stay on for 5 minutes.
The graph below shows the goal of this device. When there isn't any air conditioning (AC), the temperature will stay at about what the outside temperature is (shown in red). When the AC is on all day, the temperature will plummet down and keep the house very cold which is a waste of electricity (shown in purple). When the AC is only on long enough to overshoot five minutes (shown in aqua), the temperature read inside will start resembling a sine wave (shown in dark blue) with the peak of the sine wave at our threshold temperature.
I found a case that a flash drive came in that would be just the right size for the controller. It had a larger window on it than I needed some foam could cover that. I used a standard breadboard and fit everything in snugly. See the wiring diagram for specifics on how to wire.
I wanted the wires going to the DHT22 to be outside the container and I needed a hole for the wires for the power relay so I took some tin snips and cut a hole. I cut another hole for the micro-usb connector.
I tested some code without hooking up the air conditioner and then I felt like it was good enough to run on the real thing.
There are three separate phases to my code:
Phase 1 - Continuously ON
This phase is when the temperature is above 75 degrees (75 can be easily changed in the code). The air conditioner is then on and will stay on until the sensor reads below 75 degrees.
Phase 2 - Overshooting
This phase occurs right when the temperature transitions from above 75 degrees to below 75 degrees. The air conditioner remains on and stays on for five minutes. At the end of five minutes, it will transition to Phase 3.
Phase 3 - OFF
This phase occurs when the temperature is below 75 degrees and we aren't in the overshooting phase. The air conditioner is off for this phase.
IFTTT
By adding this section to my code:
if ((averageIndex%10) == 0 && onOff == "ON") {
Particle.publish("AirConditionerController", String(f) + "|||" + onOff);
}
This is will publish the current temperature in Farenheit along with the onOff status (this will always be on but I include for verification that the logging works correctly. The reason for the "|||" (three vertical bars) is because IFTTT interprets that as a break for the next column.
I can connect this to IFTTT by doing the following steps:
Testing that the temperature was reading was an informal process where I held an ice cube to the DHT22 and the LCD showed the temperature decreasing and then blowing on it increased the temperature.
Here are the videos for each stage of the device actually working. The hum in the background is the air conditioner working. In the last video, there's a click which is the relay turning off and then the hum goes away.
Results/DiscussionBeing able to edit code using the Particle Photon in my web browser made the process significantly easier than needing to be physically connected to the device. Integrating the device with IFTTT allows me to track to verify that the air conditioner actually cools when it's on (verification that it operates correctly). I plan on updating this project with the results of this system as the summer gets hotter.
Comments