Skip to content

IR Emitter Wireling Tutorial

TinyCircuits IR Emitter Wireling product photo

This Wireling features an 880 nm IR LED and can be used with our IR Receiver Wireling or other IR receivers (like television sets).

Great for using as a tiny remote!

Technical Details

XZTHI56W Specs

  • Emitting Material: GaA1As
  • Lens-color: Water Clear
  • Radiant Intensity CIE127-2007* (Po=mW/sr) @20mA:
    • Min: 1*
    • Typ 2.3*
  • Wavelength CIE127-2007* nm λP: 880*
  • Viewing Angle 2θ 1/2: 30°
  • ~1.5m range when paired with the IR Receiver Wireling

    TinyDuino Power Requirements

    • Voltage: 3.0V - 5.5V 
    • Current: 10µA (Normal Mode).

    Pins Used

    • A5/SCL - I²C Serial Clock line
    • A4/SDA - I²C Serial Data line
    • AX - Where X is the pin number (0-3) used in reference to Wireling Port number

    Dimensions

    • 10mm x 10mm (.394 inches x .394 inches)
    • Max Height (from the lower bottom of Wireling to upper top Wireling Connector): 3.70mm (0.15 inches)
    • Weight: 1 gram (.04 ounces)

    Materials

    To interface with any TinyCircuits Arduino board, you will need the Arduino IDE and a Micro USB Cable

    There are multiple processor/adapter combinations that can be used with Wirelings. Use the following table to find the combination that works for you.

    Processor Adapter
    *TinyDuino and USB TinyShield Wireling Adapter TinyShield
    *TinyZero Wireling Adapter TinyShield
    *TinyScreen+ Wireling Adapter TinyShield
    WirelingZero N/A
    *RobotZero N/A
    Arduino Wireling Arduino Shield
    Raspberry Pi Wireling Pi Hat

    * These processors have a 32-pin connector and can have multiple Wireling Adapter TinyShields stacked to increase the number of Wireling ports up to a maximum of 32 total Wireling ports.

    In order to interface with Wirelings, you'll need the appropriate number of Wireling Cables and the Wireling.h Library (You can download this from GitHub as linked, or from the Library Manager in the Arduino IDE).

    You will also need the IR Emitter Wireling and the library included in one download in the table below:

    Wireling Code
    Port 0 IR Emitter Wireling Library & Example Sketch

    Hardware Assembly

    Depending on the development system you choose, you will need to put together a TinyDuino stack using the 32-pin tan connectors, or you will just need to plug in your Wireling to Port 0 using a Wireling Cable. (You can change this port in the included Arduino Sketch using the Wireling.selectPort() function)

    NOTE: Be mindful when inserting Wireling Cables - the connector pins inside the 5-pin connectors on Wirelings can be bent when cables are inserted at an angle.


    Software Setup

    If you have not already done so, download the IR Emitter Library & Example Code. To install an Arduino library, check out our Library Installation Page.

    Once downloaded, open the example titled IREmitterWirelingBasicExample.ino in the Arduino IDE. All the necessary files for the program are included in the zipped folder.

    Make the correct Tools selections for your development board. If unsure, you can double check the Help page that mentions the Tools selections needed for any TinyCircuits processor.


    Upload Program

    This code shows how to use the IR Emitter Wireling to transmit NEC IR codes of your choice. In this example, the sample codes used are from the TinyTV Remote.

    The Emitter will work best if pointed at the target with the top of the board (where the IR LED is) facing vertically, like a remote. Keep in mind that when the IR Emitter triggers, you will not be able to visibly see the LED light up.

    Code
    /************************************************************************
       IR Emitter Wireling Example
       This code shows how to use the IR Emitter Wireling to transmit NEC
       IR codes(in this example, the codes used with TinyTV).
    
       Hardware by: TinyCircuits
       Written by: Ben Rose for TinyCircuits
    
       Initiated: 11/20/2019
       Updated: 05/06/2020
     ************************************************************************/
    
    #include <IRremote.h>
    #include <Wire.h>
    #include <Wireling.h>
    
    #if defined (ARDUINO_ARCH_AVR)
    #define SerialMonitorInterface Serial
    #elif defined(ARDUINO_ARCH_SAMD)
    #define SerialMonitorInterface SerialUSB
    #endif
    
    // Define codes as 32 bit unsigned integers
    uint32_t powerCode = 0x10AF8877;
    uint32_t volUpCode = 0x10AF708F;
    uint32_t volDownCode = 0x10AFB04F;
    uint32_t chanUpCode = 0x10AF807F;
    uint32_t chanDownCode = 0x10AF20DF;
    uint32_t muteCode = 0x10AFF00F;
    
    // Receive and transmit can be done on any IO pin. Pick A0-A3 for Wireling ports 0-3.
    int TX_PIN = A0;
    
    IRsend irsend(TX_PIN);
    
    void setup(void) {
      SerialMonitorInterface.begin(9600);
      Wire.begin();
      Wireling.begin();
      while (!SerialMonitorInterface && millis() < 5000); //This will block for 5 seconds or until the Serial Monitor is opened on TinyScreen+/TinyZero platform!
    }
    
    
    void loop() {
      SerialMonitorInterface.println("Sending powerCode!");
      noInterrupts();
      irsend.sendNEC(powerCode, 32);
      interrupts();
      delay(1000);
      SerialMonitorInterface.println("Sending muteCode!");
      noInterrupts();
      irsend.sendNEC(muteCode, 32);
      interrupts();
      delay(1000);
    }
    
    

    To read the output IR codes, use the IR Receiver Wireling in combination with the IR Emitter Wireling!


    Downloads


    Contact Us

    If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

    Thanks for making with us!