ASK AN EDUCATOR “How can I use IR sensors to detect where someone is sitting in a room?”

A.Khan asks:

“I am trying to use IR sensors to detect where someone is sitting in a room. The IR sensor would be placed on a rotating panel where it will send signals to the microprocessor about where it detects people sitting and the microprocessor can then plot in the 360 circle at which angles it received the input.

For this, what do you suggest is the best way to go? I was thinking more about getting IR body heat sensors premade components (~$6-$10) which give out high or low processed signals when they detect heat and sending it off to an arduino board. But it looks a bit on the expensive side. Is there anyway of creating this setup cheap?


What a fun question!

I spent the past couple of days coming up with what I think would be viable solution to your problem. To start, Adafruit happens to offer a great little PIR that, as you suggested, responds with a high/low signal in correlation to a IR source crossing its path. Adafruit’s PIR also has a 120 degree viewing angle, which is a bit wide if you are trying to pinpoint a person in a room. Because the device relies on the “path” state to change between the two sides of the sensor and you want to pinpoint a heat source, you will have modify the sensor to limit the viewing angle. You can do this by removing the faceted Fresnel lens and attaching a small tube about 1″ long over the sensor or by covering a percentage of it with some non-transparent tape (this certainly would require some experimentation). Ladyada has a wicked tutorial about PIRs work and how to modify/use it.

The next problem is the fact that you want to view in 360 degrees. I came up with three solutions for this. First, which is the most costly, would be to make your circuitry wireless, relaying the data back to a server. This also poses the problem of powering the device. The second would be to keep the sensor tethered and sweep the device clockwise then counter clockwise. Finally, the third, would be to follow the attached diagram. I had the idea that if you used an 1/8″ stereo “headphone” plug & jack you could simulate a slip-ring (commonly found in wind turbines to transfer electrical energy from the generator in the rotating nacelle). This would allow you to isolate the PIR on a rotating platform and transfer signal/power to the device without interruption. You might want to add a little non-conducting grease to the interface to keep it from wearing out.

In order to make the device rotate, I would recommend using a stepper motor attached to a larger gear, which acts as a yaw bearing for the PIR platform. You can easily control the stepper using an H-bridge (for bipolar) or darlington array (for unipolar) to precisely cover your 360 degrees. Now you get to do the math to determine how many steps per rotation, decoding the PIR, etc.

I hope this answers your question! Up next is J.Miraldi with a question about creating a robotics program for their high school!

Don’t forget, everyone is invited to ask a question:

Click here!

Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here:

Join Adafruit on Mastodon

Adafruit is on Mastodon, join in!

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 36,000+ makers on Adafruit’s Discord channels and be part of the community!

CircuitPython – The easiest way to program microcontrollers –

Maker Business — “Packaging” chips in the US

Wearables — Enclosures help fight body humidity in costumes

Electronics — Transformers: More than meets the eye!

Python for Microcontrollers — Python on Microcontrollers Newsletter: Silicon Labs introduces CircuitPython support, and more! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

Adafruit IoT Monthly — Guardian Robot, Weather-wise Umbrella Stand, and more!

Microsoft MakeCode — MakeCode Thank You!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — #NewProds 7/19/23 Feat. Adafruit Matrix Portal S3 CircuitPython Powered Internet Display!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at !


  1. I work with slip rings. Only silver with silver/carbon brushes, gold rings with platinum brushes, or mercury pool rings are noise free. Every other moving connection will soon develop noise. Guaranteed. I highly recommend a “clock spring”. This is what the steering wheel to column connection is in modern cars, as cheap old slip rings led to horns not blowing and lawsuits. Just provide a slick surface disk with a 3-4 turn pancake of wire on it. You should be able to do back and forth 360s for years,noise free. (After all, car wheels do 2.5-3 turns for a decade or two!)

  2. Woah, this solution does NOT allow you to determine the position of a person sitting in a room, it merely allows you to determine roughly the angular position of the person, with respect to the sensor turrett.

    If you want to determine the position of a person with this system, you would have to use at least two turretts, at two angles of the room ; their combined info would allow you to pinpoint the location where the person is sitting.

    If you do this, do NOT use slip rings, have the turrett rotate in one direction, and then the other, it’s a simpler solution.

    This gives you the answer with two systems. It is probably still simpler to do as they do in parking lots: have a sensor above each place. However, it you absolutely cannot imagine to have a distributed system, then PIR is not your solution.

    Any system to locate accurately something in 2D or 3D that’s not distributed is complicated, but the easiest I can imagine for your particular problem is an audiogoniometer. Take three microphones and mount them on the angles of an equilateral triangle with a 1 ft side, or so. Compare the output of each microphone with a reference threshold voltage, using operational amplifiers. Then, as soon as the person makes a sound louder than the background, you will have a voltage step on the output of each amplifier. The difference in the time where the step occurred on the three microphones will allow you to determine the location of the person with a 50cm accuracy (the sound travels 1ft per ms, roughly, but as you catch only the first sample, you have further errors due to the wavelenght of sound, which is typically in the 10cm range).

    This requires the person to make one sound significantly louder than the backgound (e.g. clap her hands). You can also track the person by any sound she makes, which could be the sound she makes by simply sitting down, but this requires some serious signal processing.

    Do you get the general idea? If I were you, I’d make a parking lot style implementation: it’s big and might seam like a dirty hack, but it’s simple, cheap and reliable.

Sorry, the comment form is closed at this time.