I am trying to setup a Home Automation project involving an Arduino (Leonardo) and a Raspberry Pi. I have the RasPi acting as a web server which I can control from the Internet or via SSH. The RasPi has an RF Transmitter which I use to send signals to an Arduino (in a different room) which has an RF Receiver. The setup works fine when I have just a relay attached to the Arduino and I switch it on or off from the RaspPi
The problem is when I try to attach an IR LED to the Arduino in order to control my room AC.
I have verified that the following works just as expected:
Arduino is just connected to a relay and RasPi sends On and Off signals via RF. → Relay turn on and off
Arduino is connected to the relay and the IR Led, but not the RF Receiver. → I can control both the relay and the IR LED by passing commands through Serial
Use Two Arduino’s: One with the RF Receiver and another with the Relay and IR LED. Communicate using digital pins → I can control both the IR LED and the Relay from the RasPi, but it adds an extra Arduino to the setup which I would like to avoid.
Which leads me to believe that there might be something which messes up when I have both the IR and the RF part of the code running on the Arduino.
I have attached the sketch I am using for controlling both the IR LED and the Relay via the RF Receiver. It compiles fine but doesn’t seem to be doing anything at all. It is supposed to print to the Serial every-time it gets an input, but it doesn’t print anything at all. Which means the RF receiver is not able to catch the signal.
Also in the sketch if I comment out all the lines which transmit an IR signal (anything beginning with “irsend.sendRaw”) it works fine. (The relay turn on and off as expected)
- I am using RCSwitch (https://code.google.com/p/rc-switch/) for the RF Module
- and Ken Shirriff’s IR Remote library (A Multi-Protocol Infrared Remote Library for the Arduino)
RF_Recieve_All.ino (5.92 KB)