Anda di halaman 1dari 3

hi

Do-it-yourself
Nid ria
hu
Kat

Arduino Based Windows PC


Volume Remote Control
Arnav Bansal

P
resented here is a project that bits represent the address of the de- After transmitting the data, only
turns your Arduino into a vice to be controlled. Six command the leader code and a single bit are
remote control. Infrared (IR) bits contain the information to be transmitted repeatedly for as long as
remotes have been very promi- transmitted. a key is pressed. A special prop-
nent since 1980s. In todays world Each bit in the data consists of erty of this code is a constant word
almost everything is controlled by half a bit period with no transmis- length in combination with pulse
a remote. This project allows you sion and half a bit period with a distance modulation.
to control the master volume of a burst of 32 pulses at 36kHz. The Address and data bits are trans-
Windows PC, a television set, set- most suitable IR receivers for receiv- mitted twice, first as a normal byte,
top box, home theatre system and ing RC5 code are those with AGC2 followed by an inverted byte. The
the like. setting and a band-pass frequency half period burst portion of each
of 36kHz. Some examples are bit contains 22 pulses, each with
Standard data formats TSOP1236, TSOP4836, TSOP34836, a width of 8.77s and a period of
There are two common data formats TSOP39236 and TSOP36236. 26.3s. 0 is represented by a pulse
for IR control: RC5 coding and NEC NEC code. NEC code uses bursts distance of 1.125ms, and 1 by a
coding. at a carrier frequency of 38kHz. It pulse distance of 2.25ms.
RC5 code. RC5 code uses a starts transmission using a leader Eight address bits are used to
bi-phase coding, and the carrier code, a burst with a length of 9ms, identify the device to be controlled.
frequency is fixed at 36kHz. Trans- followed by a pause of 4.5ms and Further eight bits are used for
mission of the data begins with two then the data (Fig. 2). The original transmission of command data. As
start bits followed by a toggle bit purpose of this leader code was to mentioned above, the words are
(Fig. 1). Toggle bit changes its value let the internal control loops in the always followed, without a pause,
at each new key press. Five address receiver modules to settle. by inverted words. For example,

114ms
The data word
is repeated as
long as a key is
Data
pressed

24.9ms
Bit length 1.78ms

Example
of a data word

2 1 5 6
start bits toggle bit address bits data bits

27.8s

Burst
(half bit)

868s (32 cycles of 36kHz)


17052
Fig. 1: RC5 transmission code (Image courtesy: www.vishay.com)

130 May 2017 | Electronics For You www.efymag.com


Do-it-yourself

Leader code
Data

67.5ms

108ms 108ms

Address code Address code Data code Data code


4.5
9ms ms 8 bits 8 bits 8 bits 8 bits

13.5ms 27ms 27ms

17053

Fig. 2: NEC transmission code (Image courtesy: www.vishay.com)

key of the remote and then


Some IR receiver modules for compares it with predefined
different carrier frequencies variables to figure out which
Module Frequency Module Frequency key is pressed. If it finds a
TSOP1730 30kHz TSOP1733 33kHz match, it sends the signal
TSOP1736 36kHz TSOP1737 36.7kHz to the PC, which is inter-
TSOP1738 38kHz TSOP1740 40kHz preted by Remote Volume
TSOP1756 56kHz Control software (designed
Fig. 4: Screenshot of Remote Volume Control by author), which further
software performs the required
task. Screenshot of Remote
TSOP1738
IRTX1 108ms time slot for as long Volume Control software is shown in
POWER USB
INPUT as the key is pressed. Fig. 4. The most important step is to
DRIVER AREF
IR receiver modules. configure the desired remote control
1 2 3
IOREF
RST
GND The most suitable IR device with Arduino Uno.
13
receivers for receiving
GND
VCC
O/P

ARDUINO

3.3V
Software
12
5V 11
GND 10 NEC code are those with
GND
Vin
9
8
AGC4 setting as these The source codes (IR_Key_Test.
have the best noise sup- ino and IR_Final.ino) are written in
ATMEGA328

7 pression while still sup- Arduino programming language. The


6
DIGITAL

A0 5 porting this data format. software used to program Arduino


A1 4
Some examples are Uno is Arduino IDE, which can be
ANALOG

A2 3
A3 2 TSOP4438, TSOP58438 and downloaded free of cost from www.
A4 TX 1
A5 RX 0 TSOP75438. Receiver mod- arduino.cc/en/Main/Software
ules for different carrier Arduino, which is an open source
BOARD1
frequencies are given in the software, makes it easy to write and
Fig. 3: Circuit diagram of Arduino based Windows PC
Table above. upload the code to the board. It runs
volume remote control on Windows, Mac OS X and Linux.
Circuit and working The environment is written in Java
transmission of address 00110111 and Circuit diagram of Arduino PC and based on Processing and other
command data 00011010 is per- volume control is shown in Fig. 3. open source software.
formed by sending bits as: Hardware components required are The library used in this project is
00110111110010000001101011100101 Arduino Uno, TSOP1738 IR receiver, IRremote library. It allows Arduino
In a special version of NEC code, breadboard and some jumper wires. Uno to decode IR signals coming from
the pre-burst, including all address Working of the project is fairly the remote. To install the library, copy
and data bits, is repeated in each simple. Arduino Uno decodes the IRremote folder and paste it in the

www.efymag.com Electronics For You | May 2017 131


efy Note
The source code of
Do-it-yourself this project is
included in this
months EFY DVD and
is also available for free
download at source.
efymag.com

Point the remote control towards TSOP


receiver module and press the key
that you want to assign for volume up
function continuously. Note the key
code number that will repeat again and
again when the key is pressed. Screen-
shot of the example is shown in Fig. 5.
Key code for volume up function
as per current serial data is 45135.
Note that some remotes send value
Fig. 5: Example of key configuration 65535 or FFFF after sending the key
code. Sometimes, there might
be abrupt values due to
ambient light or interference,
so take five to six readings
before assigning the key
code. Similarly, repeat the
above procedure to find the
key codes for volume down
and mute functions.
Step 3. After noting down
the key codes for all func-
tions, open IR_Final.ino code
and write down your key
codes as shown in Fig. 6.
Fig. 8: Authors prototype Save and compile the code.

Fig. 6: Screenshot of IR_Final.ino no Uno and PC, mode of communi- Testing the project
cation used is serial communication. After uploading IR_Final.ino code to
You need to install Remote Volume Arduino Uno, connect it to your PC
Control software on the targeted PC, and open Device Manager. Note the
which communicates with Arduino COM port assigned to Arduino Uno.
Uno and accordingly performs the Here, Arduino Uno is assigned
task. This software runs in the COM3 (Fig. 7). Install Remote Vol-
background and automatically starts ume Control software and start it.
when the PC boots. Select COM3 in COM Ports menu and
select 9600 baud rate from Baud Rate
Initial setup menu. Click on Connect, and if all
Step 1. To configure your desired goes well, volume of the PC will be
remote control device, install IR- controlled by your desired remote.
remote library and open IR_Key_Test. The authors prototype of Arduino
ino code from Arduino IDE. Select based Windows PC volume remote
Fig. 7: Device Manager window the correct board from ToolsBoard control is shown in Fig. 8.
menu in Arduino IDE, and burn the
following location: program (sketch) through the stand-
Documents>Arduino>libraries ard USB port in your computer. Arnav Bansal is an electronics
hobbyist and loves to tinker
folder Step 2. After uploading the code, with circuit designs
To communicate between Ardui- open Serial Monitor in Arduino IDE.

132 May 2017 | Electronics For You www.efymag.com

Anda mungkin juga menyukai