how to detect exactly two people close to a lamp

I would like to realize a lamp that swithes on if and only if two persons get close (or stay close) to it - I mean 1-1.5 m. I would prefer to have the sensor mounted on the lamp. It is for an indoor interactive art installation.
I did some research, and I evaluated these alternative options.

  • MEMS thermal sensors (like this one it sounded promising to me, but eventually I realized it is quite complicated due to signal processing and because the measure could be affected by the presence of the lamp. Moreover I couldn't find anybody succeding in effective human body detection.

  • PIR sensors (one or more combined to cover 360 degrees): cannot account for standing people and I don't how to count the number of people.

  • IR sensors: maybe the best solution (combining more sensors to cover the entire FOV), but I don't know if it is possible to count the exact number of people in the given area.

I tought of combining different solutions but I can't figure it out how to exacly count if two people falls in the desided area around the lamp.

Anyone have suggestions? (just to make the rigth start)
thanks in advance,

Hi, welcome to the forum.

Hire a person to see if there are two people and then hit a button. It is impossible to do that with an Arduino. It can be done when some (a lot) inaccuracy is allowed.

IR distance sensors with a small 'view' angle could be used. For example 15 degress, and many sensors. With that data, you could make a guess.
Or a matrix mat on the floor, that can detect the weigth in every 10cm x 10cm (4 inch x 4 inch).

Is it possible that every persons wears a tag ?
What if they both have to touch the lamp ? Then the lamp could have many strips connected to a capacitive touch chip.

Hi, thank you for your prompt reply and for making me aware of the difficulties of the task.
As I would really prefer to have only something mounted on the lamp maybe it's worth for me to make some test with narrow angle IR sensors, if I can find some low budget model (do you have a particular model in mind?).
Otherwise I can go for the RFID solution, as long as I can hide the tags in something nice to hold for the viewers of the exhibition.

Adafruit has these tags. I don't know at what distance they need to be, I think they need to be very close.

For the IR proximity sensors, I think you can use a common one. They can be placed vertical. Using a spacer/fence (I don't know the English word) in between, so they won't detect each others IR light.

I don't know if capacitive touch sensor can detect more than one touch at a time. But if they do, it is easy and cheap.

With that you can have 12 vertical strips on the lamp, en two people should touch the lamp (but not at the same strip). What if you start with this ? and see if people like that. Meanwhile you can work on a more sophisticated version.

Other options might be an Raspberry Pi with a Kinect or a camera with open source image recognition (OpenCV).

Raspberry Pi with camera module seems an intriguing solution.
..a lot of options, I have to think more about the entire set up of the installation,

Raspberry Pi with camera module seems an intriguing solution.

For a good introduction see:-

Page 48 of The MagPi Issue 32 at:-