Notifications
Clear all

Help needed for "Using IR Remote Controls with Arduino"

11 Posts
3 Users
1 Likes
2,630 Views
WolfgangW
(@wolfgangw)
Member
Joined: 4 years ago
Posts: 70
Topic starter  

Hi Guys,

Today I dealt with the remote control, see Bill's lesson "Using IR Remote Controls with Arduino".
When I follow the code I get the following error message. "The function decode(&results)) is deprecated and may not work as expected! Just use decode() - without any parameter."

So I removed the parameter from the function accordingly.

Serial.println(results.value, HEX);                  results "0"
switch (results.decode_type)                         results "unknown"

Unfortunately, however, I always get the same result for all remote controls, no matter which button I press. The difference I made, I am not using a brakeout, but the VS1838B Diode. 
I made 2 different trial, one is as shown in that picture below, another one is without the resistors, as I have seen in another site. The strange for me is, that no matter which code I use, the result is always same. I tried 4 different remote control devices, Samsung, Thomson and one unknown.

The Github-Link at Bills page "http://z3t0.github.io/Arduino-IRremote/" returns a 404. I think I found the right one at "https://github.com/Arduino-IRremote/Arduino-IRremote".

Has anyone of you an idea, where I am wrong? 

image

If I am not here, then I am most probably somewhere else


   
Sean451 reacted
Quote
KIMOSUBBY
(@kimosubby)
Member
Joined: 3 years ago
Posts: 14
 

Greetings WolfgangW, I hope this might assist you.

I once had a voluntary job as a stage hand at a local pantomime. They wanted UV lighting across the stage front and in specific areas but only at set times. My solution was using IR remote control, the Maker version, to control Arduino nanos to switch on/off, but they are all very similar. Any way, I used this document from the Adfruit learning centre and it all worked perfectly in the end. In fact we built a triple unit plus back-ups and no problems except remembering which number coded for what part of the stage etc.

The VS1838 is mentioned as are various others. My first trials were with the IR sensors supplied in the multi 38 piece sensor kit, after that I used Maker versions.

Hope the link works :-     https://cdn-learn.adafruit.com/downloads/pdf/using-an-infrared-library.pdf?timestamp=1612350852

Or just type in using an infrared library and select the download in the blue list on the left.

I assume posting a link is acceptable practice here?

Have fun, aye, Kim

 

 


   
ReplyQuote
WolfgangW
(@wolfgangw)
Member
Joined: 4 years ago
Posts: 70
Topic starter  
Posted by: @kimosubby

Hope the link works :-     https://cdn-learn.adafruit.com/downloads/pdf/using-an-infrared-library.pdf?timestamp=1612350852

Well thank you for your answer Kimosubby, but your link is referring to to the same Github-source.
Not working either.

But thanks anyway

Wolfgang

If I am not here, then I am most probably somewhere else


   
ReplyQuote
KIMOSUBBY
(@kimosubby)
Member
Joined: 3 years ago
Posts: 14
 

Hi, my mistake on the link, should have deleted all after the ? which followed .pdf

I'll re-set a breadboard and run code via Aduino IDE I used and then expt with receivers with/without resistors. I'll also pop same code into platformio and upload to see if there's a different result.

New to Platformio so good to have something to try out that should be simple!

Aye, Kim


   
ReplyQuote
WolfgangW
(@wolfgangw)
Member
Joined: 4 years ago
Posts: 70
Topic starter  

@kimosubby

Thanks for that information. When you finish and having a result, I would be glad to know how it is working on your side.

 

Thanks, Wolfgang

If I am not here, then I am most probably somewhere else


   
ReplyQuote
KIMOSUBBY
(@kimosubby)
Member
Joined: 3 years ago
Posts: 14
 

Hi Wolfgang, here we go.

I set up a VS1838b onto breadboard and connected as you have BUT no resistors etc just three wires. My remote is labelled as a KEYES with < OK > on top and number pad below. New battery. Each button gives unique value. Hope this helps

CODE

/* using an Arduino UNO and loading code from Arduino IDE as the
* libraries are there that I use at the moment.Kimosubby
* This returns unique values for any button press
* KEYES remote unit used
* VS1838b receiver wired direct to UNO no resistors, no capacitor.
*/


#include <IRremoteInt.h>
#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop()
{
if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
}

   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@wolfgangw

I'm thinking it may be the version of the library you are using!

Are you using the one that Bill talks about in his video?  Notice the version he has installed:

image

His version is 2.2.3, while the latest from the github site is 3.0.0, or in the Library Manager on my IDE at  the moment.  If you can go back to the 2.2.3 using Bill's Arduino code you might see that indeed makes the sketch work.

SteveG


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@wolfgangw

I just verified the results using the code from Bill's lesson, and it indeed runs as advertised using the 2.2.3 version of the IRremote.h from shirriff, but does NOT run using the 3.0.0 version.

I'm going to try tp see where the difference are.  If you want to use the latest version on the shirriff library we are going to see what changes are necessary in Bill's code.  I'm sure it is something simple, but I haven't looked into it at all at the moment.

By the way, its pretty easy to go back to a previous version of an installed library just by selecting that version in the list of versions and installing.  Of course you'll need to recompile and upload to the Arduino.

Be sure to let us know how you make out.

SteveG


   
ReplyQuote
KIMOSUBBY
(@kimosubby)
Member
Joined: 3 years ago
Posts: 14
 

codecage and WolfgangW

Was just about to state the same thing. I'm using library Remote.h version 2.1 from 1999!   I was about to view in PlatformIO to see if the various versions are available, Bill's video states that old library versions are available and can be 'locked' into sketches.  The old versions are on the Arduino IDE plus a new one IRRemoteControl which also fails to supply the HEX values.

I did have to look up deprecated to get the compilers definition and then the light bulb popped on, "what if the code in the library had been changed" and bingo...

Aye Kim


   
ReplyQuote
WolfgangW
(@wolfgangw)
Member
Joined: 4 years ago
Posts: 70
Topic starter  

@Kimosubby & @Codecage

Thank you guys,

I guess this is it. I haven't tried yet, job is forcing...

But I thought it must be something simple like that. I remember Bill mentioned that we have to take care for using the library from that people, but you know, the last I was thinking about is the version.

I'm gonna try later. 
Thank you both. I'll tell you the result tomorrow. 

Thanks again,

Wolfgang

If I am not here, then I am most probably somewhere else


   
ReplyQuote
WolfgangW
(@wolfgangw)
Member
Joined: 4 years ago
Posts: 70
Topic starter  

@Kimosubby

@Codecage

Thank you so much guys. That was it. I used Version 2.2.3 and first shot already worked. I can read out any remote control I have. Now I can create a fast "couch potato" remote control for some things I use frequently. Not anymore using 3 controllers, but using only one.

And of course, I can use this controllers for many other things too.

you have made my day, 🙂 and while I am quoting movie, it remind me this is sure one good example for one of the Murphy's law. 

Thanks again

Wolfgang

If I am not here, then I am most probably somewhere else


   
ReplyQuote