Another post about multiple IR-Receivers


Working on a tankgame-project and need to use 4 IR-receivers as hitsensors.
Using Sony 12 bit IR protocol to send Tankid and weapontype and decode with bitmasks on the receiving "beeinghittank"

Works like a charm with one IR-receiver...Diggin into forums and posts i understand its not that straightforward using more then one. Tried to use Ken Shirriff's excellent IR-library modified to support multiple IR-receivers but it gives me tons of compile-errors.

Have anyone out there used Shirriffs dev-version with success?? Seems to me it lack files.
Does the latest masterversion of IR-library include multiple IR-receivers?

Another tip howto use multiple IR-receivers would be appreciated!


I’m guessing that each IR receiver needs to feed into a serial port and on a Uno that would mean using softwareSerial. SoftwareSerial is fairly basic and can only receive or transmit, not both at the same time. I guess two instances of it can’t receive at the same time either.

If you use a Mega which has 4 USARTs you could read three IR receivers (plus the connection to the PC).

However, why do you need more than one receiver. IR is not very directional so one receiver should be able to pick up from several transmitters provided they don’t all talk at once. And even with multiple receivers there is likely to be interference if multiple transmissions overlap.

I have used a system (with 2.4GHz wireless) in which the “sun” sends an ID code and the “planet” matching that code then responds with a message. That way there are no transmission overlaps. I’m pretty sure you could implement that sort of system with IR.


I have two choices...

Either use the IR-library modified for multiple IR-receivers. The author of the Ir-library has made such a version.
Ken Shirrifs comment:
"I've implemented a new version of the library with a whole bunch of changes including multiple input support (TiStyle, this is for you), "Downloaded it but fails when compiling with tons of errors. Have anyone run this version?

Second choice is to use a pro mini for every IR-receiver and using i2c to send hits to "central" arduino.

Im very satisfied with my tests regarding IR:s directional capabilities. Using one IR-LED in a plastic tube i get the precision i want. Also mounted IR-receiver a bit inside in a plastic tube in the "tankhull". Will have less problem with sun since i will be indoors.... :slight_smile:


What are you trying to achieve? (Never mind how do it for the moment).

It seems to me that you have several model tanks and any one of them can send a signal to say that it has been hit.

It also seems to me that you are using a directional IR transmission from the "gun" and directional(?) reception by the tank so that the "gun" can only hit one tank at any moment.

However there is no need for the tank to reply with a directional IR signal if a non-directional signal would simplify the detection of an "I have been hit" message. If it was my project I would be trying to find a way to work with a single IR receiver that gets the message from every tank.

If I have misunderstood your project let me know.


Hey Robin

Im sorry i cant explain what im trying to do. I have no problem acheiving what i wanna do

The main reason posting here is to find someone that can help me with compile-errors.
If i cant use IR-lib i will go for a hardwareconcept


I manage to fix compile errors and it works using 4 IR-Receivers registring front, left, right and back hits
Mission accomplished!


hi , ZOOMZKY can you please tell me how did tou manage to fix the problems ?