• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » IoT IR Remote Control with ESP32 Arduino and IBM Watson IoT

By Abhishek Ghosh May 22, 2020 10:37 pm Updated on May 22, 2020

IoT IR Remote Control with ESP32 Arduino and IBM Watson IoT

Advertisement

In this article, we are discussing the overall hardware, code and library we will need. This article is not about building one particular project. Infrared (IR) remote control technology is widely used in day to day used devices. IR remote control signals are a reliable resource to control nearby electrical appliances. With the development of ESP32 like cheaper system on chip and Internet of things (IoT) technology, there is wider chance to control the devices remotely supporting IR remote control without any manipulation on the existing consumer-centric appliance such as air conditioner, television and so on. There is a small potential risk that IoT devices can be exploited maliciously to leak sensitive data. As we are simply controlling the devices which supports a limited range and has limited function, the risk is lower.

The ESP32 has IrDA support, but there is no documentation of how to wire it or about hardware requirements. ESP32 can directly generate the IRTX and decode the IRRX so it is just about adding minimal hardware like an IR-LED and an IR-Phototransistor. Infrared has two different modes, for remotes of television and air-conditioners, the one-way with modulation of 35 or 38 kHz is used. So for them, just switching the IR-LED on and off will build the 38 kHz Packet. Driving an IR remote transmitter using an official Arduino is easy, as there is a library named IRremote.h.

If you have an IR transmitter module, then attaching the signal pin to the appropriate Arduino pin with a current limiting resistor is all the wiring you need. KY-005 Infrared Transmitter Module (it is a transmitter module) emits infrared light at 38kHz. IR LEDs are usually made of gallium arsenide or aluminum gallium arsenide. KY-022 is the IR receiver module. This an example code for original Arduino boards :

Advertisement

---

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <IRremote.h>
IRsend irsend;
void setup()
{
Serial.begin(9600);
}
void loop()
{
   for (int i = 0; i < 50; i++) {
     irsend.sendSony(0xa90, 12); // Sony TV power code
     delay(40);
   }
}

But, that IRRemote.h Arduino library only supports receiving IR signals. To solve this issue, Andreas Spiess has a library to fully support ESP32 :

Vim
1
https://github.com/SensorsIot/Definitive-Guide-to-IR

The CIR (Commercial Infrared) Transmission Protocol cut-out the other sources of infrared radiation with a bandpass filter. The 940nm infrared transmitter is modulated by a carrier frequency in the 32-40 kHz range. This is how the receiver discriminates the IR signal and any unmodulated IR. So the IR receiver is tuned both to the wavelength and to the carrier frequency. The IR wavelength of the emitter and receiver should match.

The send-only code with infrared-LED and a resistor is this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//HardwareSerial Serial1(1);
HardwareSerial Serial2(2); // GPIO 17: TXD U2  +  GPIO 16: RXD U2
 
void setup() {
    Serial.begin (115200); // (USB + TX/RX) to check
    Serial2.begin(115200); // GPIO 17: TXD U2  +  GPIO 16: RXD U2
 
    //UART_CONF0_REG  Configuration register 0
    //UART0: 0x3FF40020
    //UART1: 0x3FF50020
    //UART2: 0x3FF6E020
 
    WRITE_PERI_REG( 0x3FF6E020 , READ_PERI_REG(0x3FF6E020) | (1<<16 ) | (1<<10 ) );  //UART_IRDA_EN + UART_IRDA_TX_EN  "Let there be light"
    //Serial.print("Reg: "); Serial.println(READ_PERI_REG(0x3FF6E020),BIN);  //For Debug only
}//setup
 
void loop() {
    Serial.println("Hello");
    Serial2.println("Hello");
    delay(1000);
} //loop

The receive-only code with a phototransistor and a resistor is this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//HardwareSerial Serial1(1);
HardwareSerial Serial2(2); // GPIO 17: TXD U2  +  GPIO 16: RXD U2
 
void setup() {
    Serial.begin (115200); // (USB + TX/RX) to check
    Serial2.begin(115200); // GPIO 17: TXD U2  +  GPIO 16: RXD U2
 
    //UART_CONF0_REG  Configuration register 0
    //UART0: 0x3FF40020
    //UART1: 0x3FF50020
    //UART2: 0x3FF6E020
 
    WRITE_PERI_REG( 0x3FF6E020 , READ_PERI_REG(0x3FF6E020) | (1<<16 ) | (1<<9 ) );  //UART_IRDA_EN + UART_IRDA_DPLX  "Let there be light"
    //Serial.print("Reg: "); Serial.println(READ_PERI_REG(0x3FF6E020),BIN);  //For Debug only
}//setup
 
void loop() {
    while (Serial2.available()) {
        Serial.print( (char) Serial2.read() );
        delay(2);
    } //while
} //loop

IoT IR Remote Control with ESP32 Arduino and IBM Watson IoT

We already have articles Controlling appliances with ESP32 and IBM Watson IoT and Android Apps to Control Devices Connected to IBM Watson IoT which will give a fair idea about how to send an HTTP request towards IBM’s server to get response on the connected remote ESP32. We have lot of example codes for IBM Watson Iot on our Github repository. The IoT part is just like switching a LED.

Probably you want to clone some brand’s remote. There are a lot of articles on the web on how to clone an IR remote for using with Arduino.

As for the Panasonic air-conditioners, this blog post will help.

Tagged With esp32 infrared , ir remote control esp32 , ir remote decoder using uart , ir sendor reat using esp32 relay control , ir transmitter esp32 , irremote esp32 , windows iot ir controller

This Article Has Been Shared 449 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to IoT IR Remote Control with ESP32 Arduino and IBM Watson IoT

  • Android Tablet as External Monitor For Windows PC and Mac

    Android Tablet can be used as a External Monitor for Windows PC and Mac using a small software either connected through wireless or USB cable.

  • Autonomic Computing : What it is, How it Works

    Autonomic Computing not to be confused with the more demanding Autonomous Computing Systems of artificial intelligence or robotics in cognitive science.

  • Switch in Network Computing

    Switch is a digital device for logical interconnection of computer networks operating in the data link layer of OSI model. Switch interconnect network segments. Previously we wrote about Router and KVM Switch for Server. Switch is used when it is desired to connect multiple networks, fusing them into one. These are basic hardware components of Network Computing, […]

  • SaaS Checklist : The Big List

    SaaS Checklist sound bizarre but it actually serves various useful purposes for the users, developers and those who want kind of monetization through SaaS.

  • Akamai, Edge Computing, Cloud Computing and Web Page Acleration

    Akamai is the leading cloud platform provider that allows owners to provide users with a safe, high-performance static and streaming content all over the world.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Online Dating: How to Find Your Match March 20, 2023
  • Web Design Cookbook: Logo March 19, 2023
  • How Starlink Internet Works March 17, 2023
  • The Importance of a Camera Tracking System in Virtual Production March 15, 2023
  • Understanding the Key Differences between Docker and OpenVZ March 14, 2023

About This Article

Cite this article as: Abhishek Ghosh, "IoT IR Remote Control with ESP32 Arduino and IBM Watson IoT," in The Customize Windows, May 22, 2020, March 20, 2023, https://thecustomizewindows.com/2020/05/iot-ir-remote-control-with-esp32-arduino-and-ibm-watson-iot/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT