Wiring ESP8266 to un arduino UNO

User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Wiring ESP8266 to un arduino UNO

Post by AnalysIR »

Sorry cannot tell.

Maybe posta link or photo of the module.
ffoo31
Posts: 18
Joined: Tue Oct 11, 2016 6:25 pm

Re: Wiring ESP8266 to un arduino UNO

Post by ffoo31 »

Hello
sorry, I could not post the picture.
it joins the link of a module identical to mine

http://www.aliexpress.com/store/product ... 39199.html


cordially
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Wiring ESP8266 to un arduino UNO

Post by AnalysIR »

Yes
that is the one we used in the following blog post.

https://www.analysir.com/blog/2017/01/2 ... r-signals/

You will need to make some minor modifications as explained in the blog post.

Alternatively, you can use the version of IRremote for ESP8266, without any modifications.
https://github.com/markszabo/IRremoteESP8266
ffoo31
Posts: 18
Joined: Tue Oct 11, 2016 6:25 pm

Re: Wiring ESP8266 to un arduino UNO

Post by ffoo31 »

Good evening
I want to upload this code on ESP8266 but I have an error


error
-----------------
C:\Users\HPF5DF~1\AppData\Local\Temp\arduino_modified_sketch_740424\IRGCSendDemo.ino: In function 'void loop()':

IRGCSendDemo:84: error: no match for call to '(IRsend) (int)'

irsend(4).sendRaw(rawData,195,38);

^

exit status 1
no match for call to '(IRsend) (int)'

Bibliothèque non valide trouvée dans C:\Users\HPµ\Documents\Arduino\libraries\Arduino-master : C:\Users\HPµ\Documents\Arduino\libraries\Arduino-master
Bibliothèque non valide trouvée dans C:\Users\HPµ\Documents\Arduino\libraries\Arduino-master : C:\Users\HPµ\Documents\Arduino\libraries\Arduino-master

-------------------------------
code:

-------------------------

Code: Select all

#ifndef UNIT_TEST
#include <Arduino.h>
#endif
#include <IRremoteESP8266.h>
#include <IRsend.h>



IRsend irsend(4);  // An IR LED is controlled by GPIO pin 4 (D2)



// Example of data captured by IRrecvDumpV2.ino
//IRsend irsend;


unsigned int  rawData[195] = { 3148, 4428, 724, 464, 696, 1524, 672, 516, 672, 1528, 676, 516, 692, 1500, 676, 492, 716, 1508, 676, 516,
692, 496, 672, 516, 668, 528, 672, 516, 672, 520,
672, 496, 688, 524, 676, 516, 672, 516, 672, 516,
672, 524, 672, 516, 672, 1524, 672, 1524, 672, 500,
696, 516, 672, 496, 692, 516, 672, 524, 672, 520,
672, 516, 672, 516, 672, 520, 676, 1520, 676, 516,
668, 520, 672, 524, 672, 516, 672, 1524, 672, 516,
672, 520, 676, 1500, 696, 516, 672,  516, 672,  504,
692, 516, 672,  516, 676,  512, 676,  1528, 672,  520,
668, 520, 672,  496, 692,  520, 676,  1524, 672,  512,
672, 1524, 672,  524, 668,  520, 676,  516, 672,  516,
672,  504, 692,  516, 672,  516, 676,  492, 696,  524,
676,  512, 676,  516, 672,  496, 692,  504, 692,  516,
672,  516, 676,  516, 672,  520, 676,  516, 672,  516,
672,  520, 668,  524, 672,  516, 676,  516, 672,  496,
692,  524, 672,  516, 672,  516, 676,  512, 676,  520,
672,  520, 672,  516, 672,  516, 672,  524, 672,  516,
672,  516, 672,  1524, 672,  1528, 672,  1524, 672,  1504,
692,  1500, 696,  1520, 672,   };  


void setup()
{
 Serial.begin(115200);
}

void loop() {

 
     irsend(4).sendRaw(rawData,195,38);
    
     delay(3000);
    
}
-------------------------------------------------------------------


??? thanks
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Wiring ESP8266 to un arduino UNO

Post by AnalysIR »

try this...changes were....
  • type definition for rawData
  • changed sendRaw statement to allow automatic size calculation, by compiler.
  • removed trailing comma in rawData array....this would have introduced an error as well
  • The IRsend irsend(4); declaration refers to setting of pin number only. The (4) shouldnt be used later for actial send statements
Please make sure to follow the examples as closely as possible.

Code: Select all

#include <IRremoteESP8266.h>
#include <IRsend.h>



IRsend irsend(4); // An IR LED is controlled by GPIO pin 4 (D2)



// Example of data captured by IRrecvDumpV2.ino
//IRsend irsend;


uint16_t rawData[] = { 3148, 4428, 724, 464, 696, 1524, 672, 516, 672, 1528, 676, 516, 692, 1500, 676, 492, 716, 1508, 676, 516,
692, 496, 672, 516, 668, 528, 672, 516, 672, 520,
672, 496, 688, 524, 676, 516, 672, 516, 672, 516,
672, 524, 672, 516, 672, 1524, 672, 1524, 672, 500,
696, 516, 672, 496, 692, 516, 672, 524, 672, 520,
672, 516, 672, 516, 672, 520, 676, 1520, 676, 516,
668, 520, 672, 524, 672, 516, 672, 1524, 672, 516,
672, 520, 676, 1500, 696, 516, 672, 516, 672, 504,
692, 516, 672, 516, 676, 512, 676, 1528, 672, 520,
668, 520, 672, 496, 692, 520, 676, 1524, 672, 512,
672, 1524, 672, 524, 668, 520, 676, 516, 672, 516,
672, 504, 692, 516, 672, 516, 676, 492, 696, 524,
676, 512, 676, 516, 672, 496, 692, 504, 692, 516,
672, 516, 676, 516, 672, 520, 676, 516, 672, 516,
672, 520, 668, 524, 672, 516, 676, 516, 672, 496,
692, 524, 672, 516, 672, 516, 676, 512, 676, 520,
672, 520, 672, 516, 672, 516, 672, 524, 672, 516,
672, 516, 672, 1524, 672, 1528, 672, 1524, 672, 1504,
692, 1500, 696, 1520, 672 };


void setup()
{
Serial.begin(115200);
}

void loop() {


irsend.sendRaw(rawData,sizeof(rawData)/sizeof(rawData[0]),38);

delay(3000);

}
ffoo31
Posts: 18
Joined: Tue Oct 11, 2016 6:25 pm

Re: Wiring ESP8266 to un arduino UNO

Post by ffoo31 »

hank you very much
I followed the instructions, result: upturn carried out without problem
But the LED does not send any signal.
connection:

from GND to LED
from Pin D2 to 20ohm resistance to Led
I tried without resistance but the problem persists

there is no voltage between G and D2.

it encloses the code used:

Code: Select all

#include <IRremoteESP8266.h>
#include <IRsend.h>

IRsend irsend(4); // An IR LED is controlled by GPIO pin 4 (D2)

// Example of data captured by IRrecvDumpV2.ino
//IRsend irsend;

uint16_t rawData[195] = { 3148, 4428, 724, 464, 696, 1524, 672, 516, 672, 1528, 676, 516, 692, 1500, 676, 492, 716, 1508, 676, 516,
692, 496, 672, 516, 668, 528, 672, 516, 672, 520,
672, 496, 688, 524, 676, 516, 672, 516, 672, 516,
672, 524, 672, 516, 672, 1524, 672, 1524, 672, 500,
696, 516, 672, 496, 692, 516, 672, 524, 672, 520,
672, 516, 672, 516, 672, 520, 676, 1520, 676, 516,
668, 520, 672, 524, 672, 516, 672, 1524, 672, 516,
672, 520, 676, 1500, 696, 516, 672, 516, 672, 504,
692, 516, 672, 516, 676, 512, 676, 1528, 672, 520,
668, 520, 672, 496, 692, 520, 676, 1524, 672, 512,
672, 1524, 672, 524, 668, 520, 676, 516, 672, 516,
672, 504, 692, 516, 672, 516, 676, 492, 696, 524,
676, 512, 676, 516, 672, 496, 692, 504, 692, 516,
672, 516, 676, 516, 672, 520, 676, 516, 672, 516,
672, 520, 668, 524, 672, 516, 676, 516, 672, 496,
692, 524, 672, 516, 672, 516, 676, 512, 676, 520,
672, 520, 672, 516, 672, 516, 672, 524, 672, 516,
672, 516, 672, 1524, 672, 1528, 672, 1524, 672, 1504,
692, 1500, 696, 1520, 672 };

void setup()
{
Serial.begin(115200);
}

void loop() {
irsend.sendRaw(rawData,195,38);

delay(3000);

}
thanks
User avatar
AnalysIR
Site Admin
Posts: 793
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Wiring ESP8266 to un arduino UNO

Post by AnalysIR »

The resistor value you have will try to send 100mA thru the IR LED.

However, the max current from a GPIO pin on the ESP8266 is 12mA (I believe).

So you should change the resistor value to at least 175R (ohms).

However, this will not have much if any range....so you should try to use a transistor based driver circuit ( examples via web search or on our blog).
https://www.analysir.com/blog/2013/11/2 ... d-circuit/

or consider our more advanced & high power SendIR module with dual emitters via https://www.analysir.com/blog/product/s ... er-module/
ffoo31
Posts: 18
Joined: Tue Oct 11, 2016 6:25 pm

Re: Wiring ESP8266 to un arduino UNO

Post by ffoo31 »

OK,
to decide between ESP and LedIR. I replaced the led IR with a limune LED.
but no sign of life.
is the upturn correct? because there is an error message at the bottom tells me that: no valid library found in: c: users / hp / documents / arduino / arduino-masters
Capture.PNG
You do not have the required permissions to view the files attached to this post.
ffoo31
Posts: 18
Joined: Tue Oct 11, 2016 6:25 pm

Re: Wiring ESP8266 to un arduino UNO

Post by ffoo31 »

Good evening
I solved the problem.
it was necessary to replace Serial.begin (115200) by irsend.begin ();
the IR LED sends the signal to the A / C and it works

Note: I did not add any resistance to the IR led.
is it interesting to add a transistor stabilizer to 5V to power the LEd?

now I will lean in sending this signal from the outside,
please point me to topic.
thank you
Locked