BRT Sys 1.1 LDSU IR Blaster Application User Guide

June 10, 2024
BRT Sys

BRT Sys 1.1 LDSU IR Blaster Application

Product Information

The LDSU IR Blaster Application is a device that allows any remote button signal to transmit. It comes with a Learning module that captures remote- control codes from the original remote and sends them to control the device using the IR. The device can be set up using the LDSBus Python SDK and remote controller.
Use of BRTSYS devices in life support and/or safety applications is entirely at the user’s risk, and the user agrees to defend, indemnify, and hold BRTSYS harmless from any and all damages, claims, suits, or expenses resulting from such use.

Setup

  1. LDSBus IR Blaster Setup
    To set up the LDSU IR Blaster, follow the instructions provided in the user manual. Connect the device to a power source and ensure it is within range of the device you want to control.

  2. Remote Controller
    The remote controller is used to capture remote-control codes from the original remote. Follow the instructions in the user manual to use the Learning module to capture these codes.

  3. LearnIRv2 Setup
    The LearnIRv2 setup allows you to configure the captured remote-control codes and send them to control the device using the IR. Follow the instructions in the user manual to set up LearnIRv2.

  4. LDSBus Python SDK Setup
    The LDSBus Python SDK is used to set up the device for use with Python code. Follow the instructions in the user manual to set up the SDK.

Sample Applications

The user manual provides sample applications that demonstrate how to use the device with Python code. Follow the instructions in the user manual to run these sample applications.

Command Line
The Command Line application demonstrates how to use the device with Python code from the command line. Follow the instructions in the user manual to run this application.

Source Code Description
The Source Code Description provides an overview of the Python code used to control the device. Follow the instructions in the user manual to understand how this code works.

Verifying LDSBus IR Blaster Transmission
The Verifying LDSBus IR Blaster Transmission application demonstrates how to verify that the device is transmitting IR signals correctly. Follow the instructions in the user manual to run this application.

Further Ideas
The Further Ideas section provides suggestions for additional ways to use the device with Python code. Follow the instructions in the user manual to learn more about these ideas.

Note :

BRTSYS recommends third-party resources on an as is basis. When you use a third-party resource, you will be subject to its terms and licenses and no longer be protected by our privacy policy or security practices, which may differ from the third-party policy or practices or other terms. You should familiarize yourself with any license or use terms of, and the privacy policy and security practices of, the third-party resource, which will govern your use of that resource.

This application note explains about the LDSU IR Blaster and LDSU Python Library. The IR Blaster allows any remote button signal to transmit. The remote-control codes can be captured from the original remote using the Learning module. These can be sent to control the device using the IR

Third-Party Software & Hardware Disclaimer Notice 

BRT Systems Pte Ltd (BRTSYS) may recommend use of software, hardware, information, products, or websites that are owned or operated by other companies. We offer or facilitate this recommendation by hyperlinks or other methods to aid your access to the third-party resource. While BRTSYS attempts to direct you to helpful, trustworthy resources, BRTSYS cannot endorse, approve, or guarantee software, hardware, information, products, or services provided by or at a third-party resource or track changes in the resource. Thus, BRTSYS is not responsible for the content or accuracy of any third-party resource or for any loss or damage of any sort resulting from the use of, or for any failure of, products or services provided at or from a third-party resource. BRTSYS recommend these resources on an “as is” basis. When you use a third-party resource, you will be subject to its terms and licenses and no longer be protected by our privacy policy or security practices, which may differ from the third-party policy or practices or other terms. You should familiarize yourself with any license or use terms of, and the privacy policy and security practices of, the third-party resource, which will govern your use of that resource

Introduction

  • This application note describes the use of the LDSBus IR Blaster with the LDSBus Python SDK. The LDSBus Python SDK is available on Microsoft Windows 10, Ubuntu 20.04, Raspberry Pi 3 and Pi 4 and Raspberry Pi Pico platforms. The LDSBus Python SDK implements the LDSBus host that manages and controls LDSU devices on the LDS bus and the platforms are referred to as LDSBus hosts. An LDSBus host communicates the IR sequence to the IR Blaster which then transmits the sequence.
  • The LDSBus IR Blaster is a “transmit only” device. IR sequences (from remote controllers or other IR transmitters) are captured using a separate 3rd party module, called the LearnIRv2 which is capable of both reception and transmission of IR sequences. Captured sequences may be stored in either the LearnIR (LIR) format or as raw pulse-pairs.
  • This application note covers the capture of IR sequences using the LearnIRv2 module and the playback of captured sequences using the sample applications. The sample applications are built using the LDSBus Python SDK.
  • The following sections describe the LDSBus IR Blaster Setup, LearnIRv2 setup, IR sequence capture and playback.

Setup

LDSBus IR Blaster Setup

The IR Blaster may be setup in 2 ways; namely as a standalone LDS unit (LDSU mode) or as part of an LDS bus (LDSBus mode). These setups are shown in Figure 1 and Figure 2. In both setups, the common denominator is the LDSBus USB Adapter. LDSU mode requires only the IR Blaster and the LDSBus mode requires additional bus devices such as LDSBus HVT-Junction and a 24V power supply to power the bus.
Before the LDSU IR Blaster is used in these examples, it is assumed that it has been configured using the LDSBus Configuration Utility. The LDSBus Configuration Utility is available for download from https://brtsys.com/resources. Using the LDSBus Configuration Utility, note the LDSU ID of the IR Blaster and the COM port number assigned to the LDSBus USB Adapter.

Remote Controller

Select an available remote-controlled appliance (e.g., Television, Air Conditioner or Fan) that is within line of sight of the IR Blaster setup. Though the IR Blaster has a maximum range of up to 7m, choosing a device within a 3m to 5m range ensures range issues do not affect the setup. The remote controller of the selected appliance shall be used in the following examples.

LearnIRv2 Setup

The LearnIRv2 is a module designed for capturing (learning) IR signals. It is a USB dongle in the shape of a thumb-drive and comes in 2 varieties (with and without an enclosure). It comes bundled with a companion LearnIRv2 Microsoft Windows application which works with official LearnIRv2 devices, only. More details may be obtained at the company’s website.

Follow these steps for setup

  1. Attach the LearnIRv2 dongle to an available USB port on the PC.
  2. Launch the Device Manager, locate the LearnIRv2 dongle and note the COM port number. This COM Port number will be used in the LearnIR application. Note that the COM port number may change whenever it is detached and attached again. In the below figure, the USB-SERIAL CH340 (COM23) represents the LearnIRv2 dongle.
  3. Launch the LearnIR application.
  4. Observe the bottom row of buttons. Some buttons are not shown on this initial screen and to make them appear, click on the Configure tab once and then click on the Learn tab. Additional buttons “Open Device File” and “Save Device File” will now be displayed. See Figure 6.
  5. Set the Port number – At the bottom row, from the “Port” drop-down box, select the COM Port number assigned to the LearnIRv2 dongle (from Device Manager). In the example screen (Figure 7), the selected COM Port is COM23.
  6. Set the Baud Rate – From the “Baud Rate” drop-down box, select 115,200 bps to set the baud rate

LearnIR module is now ready to capture IR signals from the selected remote controller. In this application note, a Panasonic AC remote controller is used as the remote controller.

  1. Point the remote controller away from the LearnIRv2 dongle and at the selected device. Turn it off by pressing the Power OFF button.
  2. Now, point the remote controller at the LearnIR dongle. Press the Power ON button on the remote controller. The dongle will capture the emission from the remote controller.
  3. The application will display the captured pulses.
  4. Repeat step 1.
  5. Select the LIR sequence (shown in Blue).
  6. Click [Send Selected Signal] button to playback the captured signal.
  7. The target device should be Powered On.
  8. Select “Save Device File” button to save the sequence. The file will be used in the following examples and so, save it under “lir_input_file.txt”. Do not modify the contents of this file.
  9. Note the Carrier Frequency displayed on the bottom right side of the Figure 8.

LDSBus Python SDK Setup

The LDSBus Python SDK uses Python 3.8.8 or later. If Python3 has not been installed, then please do so before proceeding to the next step.

LDSBus Python SDK

The LDSBus Python SDK is a Python3 compatible library named pyliblds. It is usually installed together with the LDSBus Configuration Utility. If the library was not installed earlier, then visit https://brtsys.com/resources to download and install the SDK. The samples in this application note were developed using pyliblds v1.0.0 and the package may contain a more updated version of the SDK.

3 Sample Applications
The sample application implements a command line that takes input parameters which are described below. The first 3 parameters describe the LDSBus setup to the pyliblds.

Command Line
The sample application is invoked as follows:
C:/> python3 LDSBus_IR_Blaster.py –port COM5 –port_type ldsbus –ldsuid 1

  • port: COM port number assigned to LDSBus USB Adapter (COM5 in our setup)
  • port_type: “ldsu” or “ldsbus”
  • ldsuid: LDSU ID of the device. Set to ‘1’ in this application note.

Source Code Description

The sample application processes the captured LIR sequence (stored as text) and formats it into a form suitable for the IR Blaster. It first converts the sequence from text format to binary format. Then it pads the sequence with header bytes and a trailer byte which are required by the IR Blaster.

LDSBus_IR_Blaster.py

LDSBus_IR_Blaster.py uses the LDSBus Python library, called pyliblds. Pyliblds takes care of all the LDSBus protocol communication, power, and overcurrent management via the liblds, which is a low-level library developed in C language. Figure 10 shows the LDSU IR Blaster connected in the LDSU mode.

Application Flow

The important variables in the sample application are:

  • lir_file: This variable stores the name of the file where captured sequences are stored using LearnIRv2. In this application note, the sequence is taken from ‘lir_input_file.txt’ which are captured after remote transmission.
  • user_cfreq: Carrier frequency; default = 38kHz and
  • dutyCyclePerc: Duty cycle of the carrier in percentage. If user specifies as zero, then firmware set to default 36 percent.

The sample application performs the following steps –

  1. Initializes the LDSBus library
  2. Turns on power to the LDSU or LDSBus (depends on the port_type selection).
  3. Sets the LDSUID to search (‘1’ in our application note).
  4. Sets the type of LDSU to search as “IRBLASTER”. This is optional and may be set to ‘None’.
  5. Scans the devices on the LDSBus.
  6. If the LDSU is found, it prints the details about the sensor.
  7. Open the file which is assigned to variable (lir_file) and extract the LIR captured sequence.
  8.  Encodes the carrier frequency (user_cfreq) and duty cycle (dutyCyclePerc) and adds these as headers to the LIR sequence. Adds a termination byte to the LIR sequence. The IR Blaster sequence packet is thus formed.
  9. The packet is written to the IR Blaster using the following fixed details:
  10. SensorAttribute ID (said): 0x00.
  11. Configuration Register Address: 0x08 (This is base address for IR Configuration data).
  12. Enables the transmission
  13. Turns off power to the LDSU or LDSBus
  14. Upon execution, the results look like the one displayed in Figure 14.

Verifying LDSBus IR Blaster Transmission

If it is necessary to verify that the LDSBus IR Blaster is indeed transmitting correctly, the transmission from the IR Blaster may be captured using the LearnIR application and compared against the original capture from the remote controller.

  1. Start and initialize LearnIR application and LearnIRv2 dongle.
  2. Point the LDSBus IR Blaster at the LearnIRv2 dongle.
  3. Initiate a transmission using LDSBus_IR_Blaster.py. Capture using LearnIR and save this capture to file let’s say “lir_irBlaster_transmitted_capture.txt”.
  4. Update the global variable inside the IRBlaster helper function python file – “irBlasterAppHelperFunctions.py”.
  5. lir_file: This variable stores the name of file where captured sequence is saved using LearnIRv2. In this note, the sequence is taken from ‘lir_input_file.txt’ which are captured after remote transmission.
  6. recaptured_lir_file: this variable stores the name of file where captured sequence is saved using LearnIRv2. In this note, for example, the sequence is taken from ‘lir_irBlaster_transmitted_capture.txt’ which are captured after IRBlaster transmission.
  7. Run “irBlasterAppHelperFunctions.py” to compare these two files:
    C:/> python3 irBlasterAppHelperFunctions.py
    The result of the comparison is then displayed.

Further Ideas

Further ideas to enhance the sample app are:

  1. Multiple sequences may be saved to the LIR file. Edit the LIR file and label each sequence. Extend the LDSBus_IR_Blaster.py command line to invoke transmission by using labels. Move non-changing command-line parameters as constants into the file. Then a new command line may be as so:
    C:/> python3 LDSBus_IR_Blaster_new.py –LIRfile=lir_device_file.txt –seq=”AC ON” C:/> python3 LDSBus_IR_Blaster_new.py –LIRfile=lir_device_file.txt –seq=”AC OFF”

  2. Read the captured samples from LearnIR directly and transmit via LDSBus IR Blaster.

Conclusion

In this app note, we have shown how to use the LearnIRv2 dongle and LearnIR application to capture IR sequences. We have also introduced the LDSBus Python SDK and how it may be used to control and communicate with the LDSBus IR Blaster.

Contact Information

Head Quarters – Singapore BRT Systems Pte Ltd 178 Paya Lebar Road, #07-03
Singapore 409030
Tel : +65 6547 4827
Fax : +65 6841 6071
E-mail (Sales ) sales@brtsys.com
E-mail (Support) support@brtsys.com

Web Site
http://brtsys.com/

Distributor and Sales Representatives
Please visit the Sales Network page of the BRT Systems Web site for the contact details of our distributor(s) and sales representative(s) in your country.

System and equipment manufacturers and designers are responsible to ensure that their systems, and any BRT Systems Pte Ltd (BRTSYS) devices incorporated in their systems, meet all applicable safety, regulatory and system-level performance requirements. All application-related information in this document (including application descriptions, suggested BRT Systems devices and other materials) is provided for reference only. While BRT Systems has taken care to assure it is accurate, this information is subject to customer confirmation, and BRT Systems disclaims all liability for system designs and for any applications assistance provided by BRT Systems. Use of BRT Systems devices in life support and/or safety applications is entirely at the user’s risk, and the user agrees to defend, indemnify, and hold harmless BRT Systems from any and all damages, claims, suits, or expense resulting from such use. This document is subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Neither the whole nor any part of the information contained in, or the product described in this document, may be adapted, or reproduced in any material or electronic form without the prior written consent of the copyright holder. BRT Systems Pte Ltd, 178 Paya Lebar Road, #07-03, Singapore 409030. Singapore Registered Company Number: 202220043R.

Appendix A – References

Document References
BRTSYS_AN_001_LDSBus_Configuration_Utility_User_Guide BRTSYS_API_001_LDSBus_Python_SDK_Guide

Acronyms and Abbreviations

Terms Description
AC Air Conditioner
COM Communication Port
HVT High Voltage T-Junction
IR Infrared
LDSBus Long Distance Sensor Bus
LDSU Long Distance Sensor Unit
LIR Learn IR
PC Personal Computer
SDK Software Development Kit
USB Universal Serial Bus

Appendix C – Revision History

Revision Changes Date
Version 1.0 Initial Release 26-11-2021
Version 1.1 Updated release under BRT Systems 15-09-2022

Copyright © BRT Systems Pte Ltd
Use of BRTSYS devices in life support and/or safety applications is entirely at the user’s risk, and the user agrees to defend, indemnify, and hold BRTSYS harmless from any and all damages, claims, suits, or expense resulting from such use.
BRT Systems Pte Ltd (BRTSYS) 178 Paya Lebar Road, #07-03, Singapore 409030
Tel : +65 6547 4827 Fax: +65 6841 6071
Web Site: http://www.brtsys.com
Copyright © BRT Systems Pte Ltd

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals