IR Beacon/ library for 2x IR receivers

Looking for a good library to watch 2 IR receivers/compare to locate a beacon

I ask on here, because I’ve tried about 5 so far and they all suck to varying degrees,
mostly only allowing 1 receiver

(Most of the trouble has been shrouding everything so it doesn’t just pickup reflections : )

If the beacon is the only transmitter around, you could stick to transmitting the carrier frequency. That way you could just connect the receivers to a regular digital input. If the signal is low the receiver sees the carrier.

Love it/thought of that :slight_smile:

I want to be able to have multiple beacons in an area for a robot to “See” & home in on as it gets closer;
Charging Dock, Destination A/B/Drop a transmitter to mark areas for later

I am exploring https://github.com/Arduino-IRremote/Arduino-IRremote

Can anyone see how to declare more than ONE “IrReceiver.begin” based on this?

Relying only on a carrier wave, the beacons would not be able to be in the same area of influence. You will not be able to tell them apart either.

I think you’re out of luck.

But you’ll probably be able to switch between the receivers pretty quickly.

Haha, thank you! I found an uncommented shit code variant to play with…

but jesus christ I’m not building the space station!
Why is there not like an adafruit, paired transciever/simple libraries like there is for Ultrasonics?

Is there a super easy, common solution I just don’t know? the thing I’m trying to make should have been around since like the 80s

I think you should consider whether you actually need to receive data on both receivers at the same time. I would think switching between them at a somewhat quick interval should be fine.

Probably would work fine, that would be enabling only one receiver at a time and checking/saving the data to 2 different ints to compare,

while moving a servo inbetween each time to check what sees what when…

On second thought I don’t think that’s a good direction to research? since the incoming pulses are timed, and do not transmit constantly (Different remote code for constant vs one “button press”)
and I want to “look” with a servo… too many different things needing timing now…

this should be a separate module that recognizes pulse stream from another module when they see each other…

This is as far as I got for anyone trying to torture themselves.
https://github.com/Neco777/Arduino-IRremote/tree/master/examples/IRrecvMulti

That’s for a variant allowing multiple IR receivers, it needs to have out of date libraries installed, then updated code for 3.0+ from here:
https://github.com/Arduino-IRremote/Arduino-IRremote

what a clusterfk,
will update when I find a less ret
*ed solution

I think it’s doable. Timing is gonna be important yes, especially if you want multiple beacons that might collide.

If you’re creating this on an Arduino with multiple uart peripherals, you might also be able to piggy back on those?

Ooh… I have no idea what that means :stuck_out_tongue:

Current version to be expanded into 2 Holding bins tomorrow!

//IR remote functions FUCK up Timer2.... TONE/PWM on 3/11

//needing to add ANOTHER reciever on A5, and SERVO on 9 

#include <IRremote.h>

const byte IR_RECEIVE_PIN = A4;  



/*2 LED SIN FADE */  int ledpin = 10, ledpin2 = 1, ledSINUS1, ledSINUS2, periode = 3000, displace = 500; long time=0; 
/*BLINKw/oDELAY */int ledState = LOW;unsigned long previousMillis = 0;const long interval = 150; 

int IRdata=0;

void setup()
{
   Serial.begin(9600);
   Serial.println("IR Receive test");
   IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);  //begin reciever on pin A4, show LED flicker
}

void loop()
{
/*VOIDLOOP 2 LED SIN FADE */ time = millis();ledSINUS1 = 128+127*cos(2*PI/periode*time);ledSINUS2 = 128+127*cos(2*PI/periode*(displace-time)); analogWrite(ledpin, ledSINUS1);        analogWrite(ledpin2, ledSINUS2);

//we should like, error check 0s....seems to mean it sees it, but cant decode it, still gonig to need at least 2 sensors to determine which direction is strongest

  
   if (IrReceiver.decode())
   {
     IRdata = IrReceiver.decodedIRData.command,HEX;    //Take in data as HEX... this only appears to take in NON HEX data
      Serial.println(IrReceiver.decodedIRData.command, HEX);  //should still discard zeros... better version considers that the right direction even though it might be wrong beacon? crossreference Grid Coords
      Serial.println("IRDATA");Serial.println(IRdata);  
      IrReceiver.resume();
   }

 if (IRdata == 69)  {   //CANNOT deal with fucking hex, so now it's 3x translated  maybe it needs to be a string or something idk/gaf
      Serial.println("45 == 69 for some fucked reason");
/*BLINKw/oDELAY VOIDLOOP*/ pinMode(ledpin, OUTPUT);unsigned long currentMillis = millis();if (currentMillis - previousMillis >= interval) {previousMillis = currentMillis;if (ledState == LOW) {ledState = HIGH;} else {ledState = LOW;}digitalWrite(ledpin, ledState);}

pinMode(ledpin, OUTPUT);digitalWrite(ledpin, HIGH);delay (150);digitalWrite(ledpin, LOW);delay (150);digitalWrite(ledpin, HIGH);delay (150);digitalWrite(ledpin, LOW);delay (150);digitalWrite(ledpin, HIGH);

IRdata = 0; //reset to 0
 }
 
              //OK so like...    The blink without delay is great, how do we have it blink like 10x while not interrupting the code like this blinks is the MAIN loop,SO IF = switch to blink B for X millis
//ISSUE #2.... with no error checking, it just blows out ZEROs all the time instead of finding the start of a signal? 
//so if we hold down the button, it never sees the start of the code/correct number, only infinite Zeros
              
}

It means that instead of sending common IR codes you use the uart module to transmit serial data. Basically you would connect the output of the receiver to the RX signal of the receiving device. On the transmitting side you would turn on the carrier wave when the TX signal is low. That meaning you would feed an inverted TX signal into an AND gate with the carrier wave as the other input.

Then the uart peripherals do the heavy lifting.

THANK you SO much though man,
I’ve had such a bad experience on this forum in the past,
it’s so nice just to have someone suggest things to try

No chance you’d have a link or catchphrase I could google to get started? :3

You are welcome, glad to help :slight_smile:

I don’t have any specifics I can point you to, but try googling something like serial over infrared? It’s not that uncommon, Vishay even manufacture receivers with carrier frequencies that are multiples of common serial baud rates.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.