I’m trying to control my Air Conditioner using an Arduino Mega. Just like in this tutorial here.

But unlike in the tutorial, I’m planning on using an ESP8266 wifi module instead of an ethernet shield, and also the Blynk library. I’ll also be powering the arduino using an ACDC 12V 1A Adaptor.

After further googling however, i became confused.

  1. For the IR LED, over here, and here, it says that continuous 100mA is the absolute maximum rating, and 1.5A is the surge forward current. While the Arduino Mega can only supply 40mA per pin. Does this mean i can’t power the IR LED with the arduino? If so, how do i use it with my arduino then?

    1. Is there any other boards i can use instead of the Arduino Mega + ESP8266 for this project? I wanted to use an ESP32 because it’ll be cheaper. However, it seems that i can’t use it because the ESP32 can only receive IR signals.
  • \$\begingroup\$ why not just use the ESP8266? It can control the IR LED the same as a mega... Use a logic-level nchannel mosfet to turn high-power LEDs on/off, it's a simple configuration. The ESP32 is more than capable of sending/receiving IR, but the 8266 should be enough for what's described here. \$\endgroup\$
    – dandavis
    Feb 28, 2020 at 19:33
  • \$\begingroup\$ @dandavis Because the ESP32 can only receive IR signals, i thought the ESP8266 also couldn’t receive it too. So i guess i was wrong. Thanks for clearing it up. However it says from the IRRemote-arduino Library that an ESP32 can only receive IR signals? \$\endgroup\$
    – Myadra22
    Feb 28, 2020 at 19:38
  • \$\begingroup\$ last i played with it, about 18 months, the ardunio IR libs were a bit flaky on the ESPs, requiring shopping around and eventually some minor code adjusting, but they worked fine after.The libs might be more mature now. An MCUs capabilities are not determined by any one lib's support; i assure you the ESP32's hardware can handle sending, look at what bitluni does with it... \$\endgroup\$
    – dandavis
    Feb 28, 2020 at 19:41
  • \$\begingroup\$ IR is kind of old technology and is very limited by range and your environment. Like if you wanted to control your AC from outside, your IR transmitter must be outside. A lot of control pads for AC are already sold by companies to be "smartly compatible" meaning that you can interface with it on your phone or a computer. No need to reinvent the wheel :) \$\endgroup\$
    – user103380
    Feb 28, 2020 at 20:01

1 Answer 1


You need to define the ACU, carrier frequency of IR (30kHz is most common) then auto-learn the data format from your existing remote then duplicate it with an AND GATE software or hardware with NRZ synchronous data and clock. Drive current 100mA may be plenty 300mA for long-range or get narrow 10 deg. beamwidth LEDs for even more range to bounce off walls.

If 1.4V~1.5V from 3V @ 100mA then you want 1.6V~1.5 drop or 16~15 Ohms in series from a low Ron FET switch or direct drive from a 22 oHm CMOS port in the 3.3V Mega.

For 300mA from two AA's @ 3V the IR 5mm LED Vf rises to about 1.9V typ.
(Vbat{max,min}-Vf{LED@ If})/Rs= If of LED
The incremental resistance of the IR323 LED is about 5 Ohms and the CMOS ATMega drivers are about 25 Ohms.

Driving the LED is easy once you specify the supply voltage like 2.5 to 3V (2x Alk.bat or 3.3 2% or 3 to 3.7V LiIon. The LED can handle more than 100mA continuous depending on the duty cycle and thus average power. The 1A and 1.5A max ratings are at 10us. But you will be using something like 50% max duty cycle of 30kHz approx. The LED can be modelled with a linear regression so a series R can limit the current. The formula depends on the datasheet curves or you can use a linear Op Amp current sense limit with FET to accurately drive the LED if you want with a CMOS OA, logic level FET and <=1 Ohm current sensor.

http://www.vishay.com/docs/82489/tsop322.pdf This will show you how the common carrier modulated receiver is expected to work in your ACU.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.