Professional Documents
Culture Documents
net/publication/315855200
CITATIONS READS
0 3,268
1 author:
M. Todica
Babeş-Bolyai University
101 PUBLICATIONS 405 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
IR and Raman Investigation of Some Poly(acrylic) Acid Gels in Aqueous and Neutralized State View project
Algorithm for preliminary analysis of viscosity behaviour of some aqueous poly(ethylene oxide) gels View project
All content following this page was uploaded by M. Todica on 10 April 2017.
In this work we will show how to send IR codes of some IR TV, audio systems, LED
strip, etc. remote controlc using Blynk application and smartphone via internet. In
addition we will have a feedback of the transmitted order. To do this we used the
WeMosD1 mini board and few external components, one IR LED, one 560 Ohms resistor
and one 2N2222 transistor. Optionally we can use a witness led, lighting when the IR
data string is send. The circuit is shown in the figure 1. The IR led is connected directly
to the collector of the transistor 2N2222 and +3.3V of the board. The emitter of the
transistor is connected directly to the GND and the gate is connected to the digital D2 pin
of the WeMosD1 Mini board trough a 220-560 Ohms resistor. The witness LED is
connected between the same D2 pin and GND trough a 220 Ohms resistor. The work
contains two parts:
Part 1, the Receiver. In this stage we need to decode the codes of the original remote
control of the device that we wish to control with Blynk, for instance the RC of TV,
audio system or LED strip.
Part 2, the Sender. In this part we need to introduce the desired codes of the RC into
Arduino ide and programming the board WeMosD1 Mini.
IR LED
C
2N2222 G
Part 1. The Receiver. To receive and decode the codes of the original remote control we
need to use UNO or Mega Arduino board and an IR sensor, for instance the TSOP38238.
If we use the Mega board we can connect the IR sensor directly to the board, (in order to
avoid the use supplementary wires). The output pin of the sensor is connected directly to
the D25, the GND to the D23 and the V+ to the D21 of the Mega, (Fig. 2). For UNO we
connect the sensor to +5v, GND and D11 pin. We upload the Arduino code to the Mega
board, we open the serial monitor, we place the remote control in the front of the IR
sensor and we push the desired button of the remote control. We will see on the monitor
something like this, (the example reefers to JVC audio system MX-30):
V+
OUT
//Create a receiver object to listen on pin D11 for UNO or pin D25 for Mega
//IRrecv My_Receiver(11); //for UNO
IRrecv My_Receiver(25); //for Mega
//Create a decoder object
IRdecode My_Decoder;
/*
The IR sensor's pins are attached to Arduino as so:
Pin 1 to pin D25 of Arduino
Pin 2 to pin D23 of Arduino
Pin 3 to Vcc (+5v of Arduino, or to pin D21 of Arduino Mega)
*/
void setup()
{
Serial.begin(9600);
My_Receiver.enableIRIn(); // Start the receiver
pinMode(masaIR, OUTPUT);
digitalWrite(masaIR, LOW); //set the GND pin of the sensor to the ground
void loop() {
//Continuously look for results.
if (My_Receiver.GetResults(&My_Decoder)) {
My_Decoder.decode(); //Decode the data
My_Decoder.DumpResults(); //Show the results on serial monitor
My_Receiver.resume(); //Restart the receiver
}
}
Part 2, the Sender. In this part we will program the board WeMosD1 Mini to send the
IR codes. Firs of all we need to set our Arduino ide to recognize and communicate with
the WeMosD1 Mini board. We used the version Arduino 1.6.8. To do this please refers to
our previous works Controlling by smartphone via internet two relays with Blynk and
ESP 8266-01, DOI: 10.13140/RG.2.2.31986.91847
We need also to use the library IRremoteESP8266-master from github.com site.
Upload the code bellow:
void setup() {
Serial.begin(9600);
delay(5000);
Blynk.begin(auth, ssid, pass);
irsend.begin();
}
void loop()
{
Blynk.run();
}
//////////////////////
BLYNK_WRITE(V13)
//read the status of button attached to virtual button V13
{
if (param.asInt() == 1){
for (int i = 0; i < 4; i++)
{
irsend.send(JVC,0xC5F8, 16);//Vol –
//please delete and replace with your code
//if sthe staus of the widget button is HIGH,
//the WeMosD1 Mini will send 4 times the above code
}
//Blynk.virtualWrite(12, 0xC5F8);
vol=vol-10;
//Blynk.virtualWrite(5, "Vol-");
Blynk.virtualWrite(5, vol);
//if the code sent by smartphone is received by the WeMosD1 Mini board,
//the board will send back the text "Vol-" on widget gauge V5.
//That ensure the software feedback.
}
}
/////////////////////
BLYNK_WRITE(V11)
{
if (param.asInt() == 1){
for (int i = 0; i < 4; i++)
{
}
}
/////////////////////////////
BLYNK_WRITE(V3)
{
if (param.asInt() == 1){
for (int i = 0; i < 4; i++)
{
}
}
BLYNK_WRITE(V1)
{
if (param.asInt() == 1){
BLYNK_WRITE(V0)
if (param.asInt() == 1){
BLYNK_WRITE(V8)
if (param.asInt() == 1){
for (int i = 0; i < 4; i++)
{
We introduced here two codes, for JVC audio system, and NEC for led strip. When a
button is pushed ON, the two codes are sent simultaneously to the two systems. If both
are in ON state, both will react accordingly to the sent command. If only one of them is
ON, only that system will react. In this way it is possible to control two different systems
without changing the code uploaded to the WeMosD1 Mini.
Blynk settings.
On the smartphone, we set the Blynk as follows:
The board: Arduino UNO WI Fi ESP8288
V8 corresponding to touch 4 of remote control and state GREEN for Led Stip
We added value display widget on virtual V12 for feedback, (software feedback). It will
display the name of the touch activated.
We added gauge widget on virtual V5 for volume feedback, (software feedback). The
angle of the gauge will increase or decrease as the Buttons Vol+ or Vol – are activated.
The displays V12 and V5 will shows messages only if the transmitted code from the
smartphone is received by the board WeMosD1 Mini. If the board is offline or in OFF
state, these displays will not react.
Once the code uploaded to the board, this one will work independently from the
computer. Place the board in the area of work of the WI FI router, point the IR led
towards the device that will be remotely controlled and power the board using mini USB
cable. The board will connect automatically to the router and will wait the order
transmitted from the smartphone. That’s all.
Observation. If the system doesn’t work it is possible the libraries are not updated.
It is possible to use for sender the board WeMOsD1 R2 with the same code ide, but the
IR transmitter led will be connected to pin D4 instead D2.
Acknowledgment.
For this project we used many examples from internet which were modified according to
ours goal.