Remote control is a standard feature for most home applications. Dozens of companies have released many different kinds of IR remote control products. Though remote control brings us leisure, have you ever happened to need it but having no clue where it is? Here we'll stack up hardware and download an app so to integrate all your remote commands into one Android device.
Step 1: Hardware Connection
Step 2: Program and Test
Prepare the library: use git clone or just to download the zip.
https://github.com/toddtreece/Arduino-IRremote
https://github.com/yexiaobo-seeedstudio/Infrared-Transceiver/downloads
- Copy folder into arduino’s library path
- Open Arduino IDE and choose the BeaconIR_demoCode from the example DropDownList
- Upload it to Seeeduino
Step 3: Pair-up
The panel needs to gain approval from Seeeduino before they "talk" via Bluetooth: that agreement is "pairing up".
- Open the APP
- Click the first button with a Bluetooth logo on, then a note will pop up for you to select device and enter PIN
- The default PIN is "0000"
Step 4: Study
Before the IR remote may control anything, it must learn from the encoded infrared signal. Tap the second button on the screen. After that, point the remote to the infrared receiver. Press the key you want the panel to learn till you find message "Got it!" show up on the screen.
Step 5 Try It
Now you should be ready to use this function. Point the infrared emitter to the conditioner. Tap the third button on the screen. What happens to the conditioner? If it reacts to your command, congratulations! If not, back to the "Pair-up" step, and have these all over again.
Seeeduino plays a mailman role in this project. We added an infrared receiver on it, so that Seeeduino can get the command message from the remote. We added a Bluetooth module on it, so that Seeeduino can talk with the Android panel we used here. Lastly, we added an infrared emitter so that Seeeduino is capable of sending IR commands. Besides, to run up all these electricity consumers, we prepared a Lipo rider to handle the battery. You can find how all these devices look like on the first picture and the principle diagram on the second picture.
The whole process can be divided into three simple steps. They are:
- PairPair the Android device to the serial bluetooth on Seeeduino.
- StudyAim the conditioner remote at the infrared receiver on Seeeduino. Press the target key on the remote, for example ON/OFF button, then the Android panel knows how to repeat the command.
- SendNow aim the infrared emitter to the conditioner, press "send" button on the screen. The conditioner should be turned on or off.
Step 6: Implementation Software
Implementation of the software:
Create a state machine which consists of three basic states on Arduino:
-
SM_WAITORDER: wait for order
-
SM_STUDY: study mode, begin to study, if there is no IR data within 10s, time out, turn to SM_WAITORDER
- SM_ORDER: order mode, get order, send data to IR to control the IR equipment, such as TV.
ye xiaobo
Comments