background image

uint16_t rawData[71] = {8994, 4428,  600, 522,  600, 520,  602, 520,  604, 1608,  606, 516,  60
6, 516,  606, 516,  606, 516,  606, 1604,  600, 1610,  604, 1606,  598, 524,  598, 1612,  602, 1
610,  604, 1606,  598, 1614,  600, 1612,  602, 520,  602, 1608,  606, 514,  608, 514,  596, 524,
  598, 524,  598, 524,  598, 524,  598, 1610,  604, 518,  604, 1606,  598, 1612,  600, 1610,  60
4, 1606,  596, 1616,  598, 35622,  8988, 2214,  598};  // NEC 10EFA05F 
uint32_t address = 0x8; 
uint32_t command = 0x5; 
uint64_t data = 0x10EFA05F; 

These lines will be used in the next example, where we test the emitter.

Sending IR Codes

Armed with the timing data for your desired IR command, load up the 

IRsendDemo

 example. Around line 42,

replace the 

rawData

 array with the one you copied from the previous example. You shouldn’t have to modify the

pin definition for the IR emitter – just double-check to make sure 

IR_LED

 is set to 4, which is the ESP8266 pin

connected to the IR emitter.

With that change made, upload the code. Then point the IR emitter at your device. The emitter has a range of
about 10 feet, so you may need to get a little close. It should receive a command every 6 seconds.

If your code is Sony- or NEC-encoded, you can also plug the value from 

data

 in the previous example to send an

NEC or Sony command. This is quite a bit more efficient than sending the raw timing data.

Sending NEC Codes via Web Server

One last example which really begins to show the power of this module is the 

IRServer

 example. This sketch will

connect your ESP8266 to WiFi and set it up as a web server. When the right HTTP endpoint is hit, it will send a
desired command. So you can trigger your device from a web browser!

This example requires that you have an NEC-encoded signal to send.

Before uploading this example, plug your WiFi network’s SSID and password into the 

ssid

 and 

password

variables.

Then adjust some of the static HTML in the 

handleRoot()

 function to send your desired code. This is a little tricky.

You need to find your NEC code from the receive example – in my case it was 

0x10EFA05F

. You’ll also need to

convert this value to decimal (here’s a calculator for that). In my case it was 

284139615

. Plug those two values

into a new line of C-string'ed HTML. I added this line on line 59, for example:

              "<p><a href=\"ir?code=284139615\">Send 0x10EFA05F</a></p>" \ 

Then upload the code! Open the serial monitor to check on your ESP8266’s connection status. Once connected it
should provide you an IP address.

On a device connected to the same WiFi network, plug that IP address into the address bar. You should be
greeted with a page like this:

Summary of Contents for ESP8266

Page 1: ...emotes when you probably have a much smarter WiFi connected device device sitting conveniently in your hand The WiFi IR Blaster is designed to connect all of those old legacy IR controlled devices to a WiFi network exposing them to a new method of control Want to control your TV via a web browser Want to ask Alexa to mute your stereo Want to schedule triggers to your IR controlled LED strip These ...

Page 2: ... and it will detail how to program the ESP8266 using the Arduino IDE Once complete you ll have a simple web server than can emit infrared signals at the click of a browser page Required Materials The WiFi IR Blaster includes the board an infrared emitter and an infrared receiver You ll need a handful of other tools and components to get it powered and programmed SparkFun Beefy 3 FTDI Basic Breakou...

Page 3: ...and general soldering accessories To add you ll also need a local WiFi network that you can connect your ESP8266 up to It also helps to have a second device smartphone or computer that s also connected to that network Suggested Reading If you aren t familiar with the following concepts we recommend checking out these tutorials before continuing COM 14865 PRT 00553 How to Solder Through Hole Solder...

Page 4: ... anything that may interfere with WiFi signals near that area Supporting the ESP8266 are a reset and general purpose button a user LED and an array of pin breakouts Of course there s also the IR emitter and detector These components are packaged with the board but not soldered in place This allows you to solder both components at any angle your project requires It also leaves the option to customi...

Page 5: ...e you solder them in in the correct orientation Both components have a bulb shaped bump protruding from one side the bumps should both be facing towards the nearer edge of the board Silkscreen on the board should also help orient the components While you have your iron out you may also want to solder headers into the 6 pin serial header and the 8 pin power GPIO header Which headers you solder into...

Page 6: ...st 300mA which most FTDI boards cannot do We recommend the Beefy 3 FTDI Basic Breakout which can supply up to 600mA Removing the Standoff Edge A pair of standoffs are provided towards the bottom of the WiFi IR Blaster If you don t need these standoffs and want to save some space the standoff board can be removed by breaking it along the v score line Standoff Board Snappable Area Programming the ES...

Page 7: ...P8266 Arduino board definitions The board definitions can be found in the ESP8266 Arduino GitHub repository For installation instructions check out this section of the README The WiFi Blaster board definition is not included with the Arduino ESP8266 board files but it can be uploaded to as a Generic ESP8266 Module Verify your settings look like below Board Generic ESP8266 Module Board Generic ESP8...

Page 8: ... be holding pin 0 low while resetting the ESP8266 1 Hold down the 0 button 2 Press and release the RST button 3 Release the 0 button The timing of this can be a little tricky Try resetting it into bootloader mode then quickly uploading your sketch Decreasing the upload speed baud rate to something around 115200 bps can also help improve the reliability of the reset circuit Testing the Receiver ESP...

Page 9: ...et it to 13 define RECV_PIN 13 Once that modification has been made upload away Make sure the board is set correctly to NodeMCU 1 0 ESP 12E Module Then open up the serial monitor and set the baud rate to 115200 You should see a IRrecvDumpV2 is now running and waiting for IR input on Pin 13 message print out If you don t try tapping the board s reset button Then aim an IR remote at the board and hi...

Page 10: ...ious example to send an NEC or Sony command This is quite a bit more efficient than sending the raw timing data Sending NEC Codes via Web Server One last example which really begins to show the power of this module is the IRServer example This sketch will connect your ESP8266 to WiFi and set it up as a web server When the right HTTP endpoint is hit it will send a desired command So you can trigger...

Page 11: ...y recommend checking out the IR Controller ESP8266 firmware This fully featured firmware combines IR send and receive functions with a web server It monitors for received commands and provides a handy interface to emit those back out with the ESP8266 There are even instructions for connecting the Blaster to an Alexa service Click the image for a closer look If you give this firmware a spin just re...

Page 12: ...hese documents GitHub Product Repository GitHub repository where you can find all of our latest hardware and software design files Hardware Schematic PDF schematic Eagle Files PCB design files ESP 12S Datasheet ESP8266 module w integrated crystal antenna flash LTE 302 Datasheet IR emitter TSOP382 Datasheet IR receiver Firmware IRremoteESP8266 Arduino Library ESP8266 IR Arduino library ESP8266 IR C...

Page 13: ...Roshamglo Project TV B Gone Turn your Roshamglo board into a nearly universal TV power button AVC Sensor Test JUNE 20 2016 ...

Reviews: