• 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 , irremote esp32

This Article Has Been Shared 507 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic 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

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

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 (21K Followers)
  • Twitter (5.3k 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

  • 5 Tech Tools to Help With Business Growth April 22, 2021
  • Corona Pandemic as Cloud Adoption Driver April 20, 2021
  • How to Save Electricity Consumption During the Pandemic April 20, 2021
  • Best Powerpoint Templates for Communicating IoT Concepts April 17, 2021
  • How to Build a DIY Water Level Indicator? April 16, 2021

 

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, April 22, 2021, https://thecustomizewindows.com/2020/05/iot-ir-remote-control-with-esp32-arduino-and-ibm-watson-iot/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

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

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

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