Author Topic: Arduino Based System - IR Receiver Setup  (Read 1169 times)

ejh77777

  • Developer
  • Newbie
  • ***
  • Posts: 8
    • View Profile
Arduino Based System - IR Receiver Setup
« on: January 03, 2018, 10:08:55 AM »
I am in the process of building an arduino-based system and have thus far been unable to find documentation on how to expand the IR Library (IRLib2) to read an IR signal from two pins (interrupts).  Combining that potential limitation with having only two or three IR sensors per circuit (shown in Milestag configurations), how can a system be expended to have more than 3 IR receivers?

Does anyone know how to adapt the IRLib2 to receive from more than one pin?  Or, can more than 3 sensors be connected if you provided the needed voltage/amperage?


ezio

  • Full Member
  • **
  • Posts: 76
    • View Profile
Re: Arduino Based System - IR Receiver Setup
« Reply #1 on: January 03, 2018, 11:46:39 AM »
Why would you need to monitor different pins?  Why wouldn't you put all the IR receivers on the same pin?  That way, you could detect a signal from any of them that got hit.  That is, a player could hit any one of the head/body/gun sensors, and the system would detect a "hit" on the target.

ejh77777

  • Developer
  • Newbie
  • ***
  • Posts: 8
    • View Profile
Re: Arduino Based System - IR Receiver Setup
« Reply #2 on: January 04, 2018, 08:20:55 AM »
Preferably, I'd like to use 2 pins to be able to distinguish between head and body shots if I decide to have different damage values in the future.  However, that's not critical, and I was asking for input on your suggested use of 1 pin for all sensors.

The directions for connecting sensors here on MilesTag only shows 2 or 3 sensors connected together and I am trying to get some feedback on how to connect more than 3 sensors together.  I don't understand the circuit in the sensor pcb.  Is it a series circuit for all sensors?
« Last Edit: January 04, 2018, 08:22:32 AM by ejh77777 »

ezio

  • Full Member
  • **
  • Posts: 76
    • View Profile
Re: Arduino Based System - IR Receiver Setup
« Reply #3 on: January 04, 2018, 09:52:31 AM »
It doesn't appear to be a series circuit.  It looks like a parallel circuit, with all the TSOP sensors branching off the same trace -- which would make sense to me.  You'd want to be able to detect a hit from any TSOP sensor.

As for making the system detect two separate circuits of TSOP sensors, I'm not entirely sure that's going to be possible using the IRLib2 library, or any other library for that matter on the Arduino platform.  The IRLib2 library uses a hardware timer to send/receive IR data, and I'm not sure if it can manage 2 streams of data simultaneously with a single timer, since 56/57Khz seems to be the upper limit for these timers.  You'd have to re-write the library to take advantage of another available timer to add an additional pin.  But even then, the PWM functions of each microcontroller are usually limited to specific pins which are defined in the library.  I may be wrong about the microcontroller's capabilities, but that's how I understand it.

Section 1.5 of the manual should be able to explain it better:  https://github.com/cyborg5/IRLib2/blob/master/IRLib2/manuals/IRLibReference.pdf
« Last Edit: January 04, 2018, 09:55:04 AM by ezio »

ejh77777

  • Developer
  • Newbie
  • ***
  • Posts: 8
    • View Profile
Re: Arduino Based System - IR Receiver Setup
« Reply #4 on: January 04, 2018, 11:29:16 AM »
Great feedback on the IRLib2 limitations.  That's just what I needed to understand for that option.

As for the sensor pcb, it'd be great if someone could confirm that it's in parallel, but I should probably go through the wiring diagram myself in order to better understand how to wire everything.

Thank you for taking the time to reply.

ezio

  • Full Member
  • **
  • Posts: 76
    • View Profile
Re: Arduino Based System - IR Receiver Setup
« Reply #5 on: January 04, 2018, 03:09:14 PM »
If you look at the schematic for wiring multiple sensor PCB's together here:  http://lasertagparts.com/images/sensors/New%20Sensor%20Harness%20Wiring%20Triple.jpg

You'll see that the data line through holes (any of the blue holes) allow current to either flow to the sensor, or around it to the next sensor.  If the circuit was in series, the current would have to go through one component before getting to the next one.  But in this configuration, any TSOP sensor could be triggered and send a signal back through the data line without the signal having to actually go through any of the other sensors.  Another way to look at it is that the voltage across all the sensors is the same.  It's not dropped after each sensor.  That's a parallel circuit.