Notifications
Clear all

[Solved] TSOP 4838 IR Receiver

13 Posts
4 Users
1 Likes
260 Views
(@moorem34)
Member
Joined: 11 months ago
Posts: 7
Topic starter  

I'm using SimpleReceiver.ino to receive and decode IR signals from ir-remote-send.ino. SimpleReceiver board is Uno R3 and sensor is TSOP 4838. Works WELL!

But, I would like to use two or more receivers so as to eliminate "dark" spots where no IR reception occurs.

PinDefinitionAndMore.h defines pin 2 for the Uno as the default receiver input. How can I modify PinDefinitionAndMore.h to implement multiple IR receivers on the same platform?

 

Thanks,

Mark


   
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6982
 

@moorem34 Perhaps if you provided links to the code someone could have a look.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2532
 

@moorem34

Perhaps you might also consider what might happen if more than one receiver is activated simultaneously.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2043
 

@moorem34

But, I would like to use two or more receivers so as to eliminate "dark" spots where no IR reception occurs.

Kind of unclear what mean without showing your setup.

Is it possible to OR the ir detectors together?

Maybe use an address driven selector to read each IR detector in turn for a valid value.

If for example you have 4 detectors you could address each one in turn using two output pins.

pseudo code

Set Address 00         // on say pin3 and pin4)
value = Read(pin2)   // using your library thingy
if Valid(value) then result = value

Set Address 10
value = Read(pin2)
if Valid(value) result = value

Set Address 01
value = Read(pin2)
if Valid(value) then result = value

Set Address 11
value = Read(pin2)
if Valid(value) then result = value

 


   
ReplyQuote
(@moorem34)
Member
Joined: 11 months ago
Posts: 7
Topic starter  

Yes of course. My apologies...here's the link. I got the library from this (Dronebot Workshop) site when Bill did the recent IR Remote Control projects in the workshop but this is the reference from github that Bill has in the comments sections at the front of the sketch. Install IRremote library, go to examples from custom libraries, IRremote, SimpleReceiver.

This post was modified 2 months ago by moorem34

   
Ron reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6982
 

@moorem34 When you ask the following question

How can I modify PinDefinitionAndMore.h to implement multiple IR receivers on the same platform?

Are you looking for an answer along the lines of

1. Open your editor

2. Load in the file PinDefinitionsAndMore.h

3. Add an extra line for the pin of the 2nd reciever

4. Save and exit

Or are you really asking a different question?

BTW, how many hours of programming experience do you have?

 

 

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@moorem34)
Member
Joined: 11 months ago
Posts: 7
Topic starter  

@zander Thank you! YES! I'm trying to implement a second receiver. I have no idea what the attached files does or how it works.

I'm a retired controls engineer. LOTS of plc, hmi, servo....etc programming. BUT, this environment is new to me. I love this stuff and want to continue to work "hands on" to stay sharp, release some creative juices....and stay out of the bar!!


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6982
 

@moorem34 Attached file?????

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6982
 

@moorem34 I just had a quick look at the receive code. Change ALL mentions of IrReceiver to

IrReceiver1. Now duplicate all the relevant code but call the object IrReceiver2.
That is the high level, it will take some thought as to the best way to manage it. I would take ALL the code in setup and make a separate module called perhaps setupReceiver1 and same for the main loop, move it into a module called processReceiver1. Now just duplicate, add one extra line to setup and 1 extra line to loop.
E&OE

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@moorem34)
Member
Joined: 11 months ago
Posts: 7
Topic starter  

@zander sorry...I thought I'd attached a link to github for the library the receiver file is in. You found it though! OK...let me get caught up. I've added IR_Receiver2 to the definitions file and am working on the code now. I'll report back in after I get the hardware up and running. Thanks for your help


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6982
 

@moorem34 No problem. I was actually pleasantly surprised it appeared so easy.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@moorem34)
Member
Joined: 11 months ago
Posts: 7
Topic starter  

@zander Good NEWS!

I took your advice and segregated the code as you outlined into setupreceiver1/2 and processreceiver1/2. I then called the setup subs from the setup function and then each of the process subs from the main loop.

I've not had a data fault yet that I'm aware of. And, occasionally both receivers report the same data on a single button push. 

 

I've attempted to verify operation by commenting out one receiver, thereby disabling that hardware. I get good data on the other one. Just to be sure, I then reenabled the first receiver and disabled the second...again good data.

I'm quite pleased. thanks for your help.

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6982
 

@moorem34 That's great news.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote