I always wanted to control my PC in a different way. I had an Arduino lying around I uploaded the code to display received IR codes on serial monitor, and started to work with the VB side in a complex if..else..elseif statements.
Controlling a PC with remote gives us freedom of wireless, and it is a cheap way too. It is still in development stage, I will notify if I make any changes to the code.
let's code ...
Step 1: Material and Tools
1. Any Arduino (I used Duemilanove)
2. IR Transistor (TSOP1738)
3. An IR remote of any TV or DVD
1. Visual Studio 2010 or later (because I developed the app in this version)
2. Arduino IDE
Step 2: Connecting IR Transistor to Arduino
Connect the VCC to arduino’s 5v.
And the transistor’s out pin to digital pin 11, and don’t forget to connect the GND to Arduino’ GND
Step 3: Building the Development Environment
If you are already familiar with arduino’s IDE and installed IRremote Library then you can proceed to Step 4.
First of all, you need to download Arduino IDE from its official website here.
After installing the IDE, you need to download and install IRremote Library.
Extract the .zip files in arduino’s library folder. Restart the IDE to make it work.
Step 4: Coding the Arduino
Open the IDE, and go to File>Example>IRremote>IRrecvDemo
Change the line:Serial.println(results.value, HEX);
Upload the file to Arduino.
Open serial monitor to check everything works fine.
For every button on the remote has very unique code. It will be displayed on the serial monitor when you press a button.
Step 5: Making Application in Visual Studio
If you have a Philips DVD player remote like I have, then you only need to run my application by selecting the COM port to which Arduino is connected.
Start Visual Studio and go to: File>Open>Project/Solution
Open the downloaded project files.
There you will find “remote.vb” – Right Click>View Code
My Philips remote emits 2 values at a time that’s why I compared “str” to two values to trigger an event.
In the “trigger event” section you can change the IR remote values according to your remote.
Change the comparison value according to your remote
Ex: If str = 1124 Or str = 66270 Then
assume your remote sends 'xxxx' and 'XXXXX' on pressing power button
then change the statement to:
Ex: If str = xxxx Or str = XXXXX Then
Build and run the application, now you can control your Windows PC with your TV or DVD remote.