[SOLVED] Blynk + NEC Generic TV IR remote power ON/OFF


Yes, it’s not needed for the NEC.




thanks costas, will share all later, just for your info, unlike the samsung code the app PUSH only needed quick push, the NEC code app PUSH needed hold longer, any ideas why that might be?


was bad wiring


Solved again by Costas

Here is the working project

Download Github Library:-


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <IRremoteESP8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "********************************";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "**********";
char pass[] = "**********";
char server[] = "************";

IRsend irsend(4); //an IR emitter led is connected to GPIO pin 4 (D2)
void setup()
  Serial.begin(115200, SERIAL_8N1, SERIAL_TX_ONLY);
  Blynk.begin(auth, ssid, pass, server);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);
  int onoff = param.asInt();
  if(onoff == 1){
    irsend.sendNEC(0X2FDE817, 32); // 32 bits, no repeat
void loop() {;

Here is the QR Code for the simple PUSH button, (must be set to PUSH and not SWITCH

Hardware side:- I used a NODEMCU IR led connected to D2

OBVIOUSLY the IR LED must be pointing at the TV to work.


one question, should i mark as solved or projects made with blynk


You should mark this as solved and if you want you can open a new one with “made with blynk”.
Btw about your project, looks really cool ! Are you able to only turn your tv on and off or do you have the possibility of switching channels etc ?


Hi, Thanks but credit goes to Costas for the solving of the code, at present it only serves as an ON/OFF switch.


Hi, I’m new here, I have a doubt in this project, where do I see the schematic, for linking the wires?


@joziel This wasn’t a project topic, rather a troubleshooting one.

As per the OP the pin he uses was determined on the sketch.

IRsend irsend(4); //an IR led is connected to GPIO pin 4 (D2) 

Google around for other full wiring options as they can vary depending on hardware used.


Good evening, a project like this, I wanted the schematic of this project


Hi I am the original poster of this project, sorry but there is not a schematic available, it was not posted as a project it was posted for help with some code that I was stuck on , I soldered up a custom circuit board for the hardware side of things which was quite basic using and ESP8266 chip with a 5v to 3.3 v voltage regulator, A transistor and an infrared LED .


Hi, good evening, I’m behind a project so that I can delligate the TV through the space, will you have a basic material like this.
thank you for your attention


i’m sorry but i do not understand your question.


Hi, good evening, I’m behind a project so I can turn off the TV through the ESP8266MCU, you have a basic material like this.
Thank you for your attention.


Take a look at this post:



I am having error “‘IRsend’ does not type a type”.
Can someone help me?


are you using the latest Library?


ho inserito l’ultima libreria markszabo/IRremoteESP8266 ma niente da fare il codice di errore continua a dire che che “IRsend non digita un tipo” qualcuno sa aiutarmi??


can i use raw data for this lib like on uno do?


Post number 24 in this topic has a link to latest version of the library.
This contains documentation, FAQs and example code for capturing and sending raw data.

I doubt if the library will work with an Arduino Uno, but from your question it’s not clear if that’s what you’re planning to do.