Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Arduino Wifi/IR Uni...
 
Share:
Notifications
Clear all

[Solved] Arduino Wifi/IR Universal remote with "ADD" button

2 Posts
2 Users
0 Reactions
1,955 Views
 kjrr
(@kjrr)
New Member
Joined: 4 years ago
Posts: 1
Topic starter  

I want to build a ir cloner and transmitter for electronic devices (tv, home theatre,AC,etc) with NODE MCU so that i can control all the devices over wifi with my phone. There are may tutorials for making this type of project but all of them include manually inputting the "ir code"(not sure what is called) into the script. I wish to some how add like an "ADD" button in the circuit that when pressed it can read and store automatically in the script and then later i add another virtual button on the phone. Is it possible to make this project? sorry i am new to Arduino please excuse my stupidity if you think it is..

i am here to learn.

thank you in advance


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2741
 

Hi Kjrr!

This is an interesting project for sure! And ... there are no stupid or silly questions 😉 

I haven't played with IR yet (it has crossed my mind in the past, but now that HDMI CEC is controlling my stuff, I didn't have a need for it anymore).

Maybe this is helpful, I found it somewhere online, quite a while ago on Instructables:


#include <IRremote.h>

int IRPIN = 2;

IRrecv irrecv(IRPIN);

decode_results result;

void setup()
{
Serial.begin(9600);
Serial.println("Enabling IRin");
irrecv.enableIRIn();
Serial.println("Enabled IRin");
}

void loop()
{
if (irrecv.decode(&result))
{
Serial.println(result.value, HEX);
irrecv.resume();
}
delay(500);
}

The IR Library may be the same as the one you're using, or not (in that case: link).

From what I copied at the time:

First check the PinOut diagram of the IR receiver you have. IR receivers have 3 pins, +ve , GND and Out. Before using any receive make sure you know these pins. If connected improperly the setup won't work and you will find it difficult to figure it out.

Make the following connections :-

1. Connect +ve pin of receiver to 3.3v of Arduino.

2. GND pin of receiver to GND of Arduino.

3. Out pin of receiver to Digital pin 2 of Arduino.

Ah took me a bit, but I found the original article here: IR Decoder.

So you could add an "Add" button, which would read one or more codes as in the example code. You may want to add something to stop the code reading (eg pressing a button, or after a timeout).

Hope this helps. 🙂 


   
ReplyQuote
Share: