Howdy guys and girls! It’s summertime and it’s hot in New York City. You always hear about those blog posts about people setting up an Arduino to control their air conditioners remotely, and I figured I was due for my own, so here it is. Unfortunately, I was unsuccessful. Hopefully someone can read through what I did and I can follow up with a successful completed post. Either way, here we go…
After some research, I realized that I don’t want to deal with any electronic internals of the air conditioning unit (as I am no electronic engineer, just a computer scientist dressed up as one), so I will be communicating with it by simulating the requests of the remote control with my Arduino via infrared.
- Arduino Duemilanove
- Radioshack 38kHz IR Receiver Module
- Radioshack Infrared Emitter (they only had the emitter/detector package in stock together, so I bought both)
- Remote-controllable air conditioner (mine is some Zenith model, I don’t think it should matter)
As you can (hopefully) see, I have my Arduino and a breadboard with the IR Receiver plugged into digital pin 2, ground, and 5V. I also have the IR Emitter plugged directly into digital pin 12 and ground. (Side note: do I need any resistors anywhere here? I know about Ohm’s Law, but I’m not sure exactly how to apply it here)
Part 1. Detecting the IR Signal:
I attempted to follow Adafruit’s tutorial on reading an IR Sensor, modifying the Serial monitor output so that I could reuse it for Part 2. Here is the sketch I am using:
Now when I upload that sketch to my Arduino, point my A/C remote control at my IR Receiver, and press the power button, I get the following results:
Part 2. Blasting the IR Signal:
Next, I attempted to follow Adafruit’s next tutorial on Making an Intervalometer to blast the pattern that I’d received in the last sketch using my IR Emitter. Here is the sketch, you’ll see that my code varies a bit for simplicity:
As you can see, it attempts to send the IR signal that we got from Part 1, sleeps for 10 seconds, and then tries again, forever.
Now this is the sad part – I point this sucker at my air conditioner hoping for some grand moment of joy, and nothing happens!
Does anyone have any ideas on what I could be doing wrong?