Direction Detection

I'm trying to build an Arduino device that detects the direction of a person (they can be wearing a beacon of some sort) and points a servo motor in their direction. This will be in a busy location (a classroom with lots of people), so PIR won't work. I'm hoping to not use like a Pixy camera or something that has to be connected to a computer. Could this be done with bluetooth? IR? I've tried it with the IR sensors that come with some of the starter kits, but they are so sensitive that even a TV remote pointed anywhere in the room with my finger over one of the sensors, they both still detect it. If there's an IR detector that would work better the one I have (https://easyeda.com/winter2015/Infrared_IR_Remote-DqnTNjd7f), let me know. I'm shooting for less than $100.

Thanks in advance for your ideas and links. Be patient, I'm a vice principal who just tinkers with the stuff and tries to get students excited about it.

Mike

If there is only one person to be identified and if they could have a flashing IR led high enough so that it would not be obscured by other people and if you mount a photo-detector in a long tube so it is very directional and if you sweep the tube from side to side with a servo you may be able to detect the flashing led. It might be easier to develop if you start with a visible led.

Otherwise this sounds like a job for a camera and sophisticated image recognition software - i.e. on a PC or RaspberryPi.

...R

Try Posyx;

Posyx

Ooh, that's still too expensive. We're going to need about 25 of these and we're a school, so not a big budget.

Robin2:
If there is only one person to be identified and if they could have a flashing IR led high enough so that it would not be obscured by other people and if you mount a photo-detector in a long tube so it is very directional and if you sweep the tube from side to side with a servo you may be able to detect the flashing led. It might be easier to develop if you start with a visible led.

Otherwise this sounds like a job for a camera and sophisticated image recognition software - i.e. on a PC or RaspberryPi.

...R

It is only one person. It could be a flashing LED bracelet or something, even one on both wrists if necessary. I'm already testing something like this now, but even the light from an TV remote passing right through my finger, through 1/8" of wood, etc. No matter where I point the remote, both detectors ping every time. If my finger can't stop it, then a tube isn't going to stop it. Maybe a filter to lower the sensitivity. Are there materials that absorb IR? Some types of glass do, I believe.
Do I understand correctly that these IR sensors detect a modulated frequency of flashing light so that sunlight doesn't interfere? I don't think that I could just blink an IR LED at 35KHz.
Could bluetooth, ultrasound, RF, etc. be used?

mhorton:
It is only one person. It could be a flashing LED bracelet or something, even one on both wrists if necessary.

In my mind it needs to be on a hat so it is easily higher than all the other people in the room. Think about the requirements to be able to see a lighthouse at sea.

...R

mhorton:
I'm trying to build an Arduino device that detects the direction of a person (they can be wearing a beacon of some sort) and points a servo motor in their direction. This will be in a busy location (a classroom with lots of people), so PIR won't work.

There are a variety of Raspberry Pi projects documented on the Internet that do moving object tracking using a camera. Usually these are single object tracking, but if the classroom is constrained to tracking a standing instructor and typically seated students, one could mask the image where the students are typically seated.

It would be more complicated to do multi-object tracking and there are challenges of tracking the same object if the tracks of two cross.

A RaspberryPi 3B+ is about $45 USD, $10 for the SD Card, and under $10 each for a low resolution USB webcam and a servo, so something on the order of $85 per node.

Sample project found searching on "raspberry pi tracking camera" Raspberry Pi Motion Tracking Gun Turret - Hackster.io.

mhorton:
It is only one person. It could be a flashing LED bracelet or something, even one on both wrists if necessary. I'm already testing something like this now, but even the light from an TV remote passing right through my finger, through 1/8" of wood, etc. No matter where I point the remote, both detectors ping every time. If my finger can't stop it, then a tube isn't going to stop it. Maybe a filter to lower the sensitivity. Are there materials that absorb IR? Some types of glass do, I believe.
Do I understand correctly that these IR sensors detect a modulated frequency of flashing light so that sunlight doesn't interfere? I don't think that I could just blink an IR LED at 35KHz.
Could bluetooth, ultrasound, RF, etc. be used?

Robin2:
In my mind it needs to be on a hat so it is easily higher than all the other people in the room. Think about the requirements to be able to see a lighthouse at sea.

...R

In a similar thread a month or so back I proposed a hat with retro-reflective tape on the object to be tracked. The idea would be to have a modulated light source and sensor scanning a region (on a servo) and look for the azimuth angle where the largest return comes from. Relative to the "flashing bracelet" approach this might be less sensitive to orientation of the target object.

The problem with using ordinary IR receivers for modulated remote controls is that they have only a binary output indicating that the modulated source signal was received above some threshold. They don't provide any indication of the relative amplitude of the received signal, so this sort of approach implies building a detector that will provide that information. That's a reasonable enough task, but it's more involved than picking a stock IR receiver out of the parts bin and throwing together some software.

MrMark:
There are a variety of Raspberry Pi projects documented on the Internet that do moving object tracking using a camera. Usually these are single object tracking, but if the classroom is constrained to tracking a standing instructor and typically seated students, one could mask the image where the students are typically seated.

It would be more complicated to do multi-object tracking and there are challenges of tracking the same object if the tracks of two cross.

A RaspberryPi 3B+ is about $45 USD, $10 for the SD Card, and under $10 each for a low resolution USB webcam and a servo, so something on the order of $85 per node.

Sample project found searching on "raspberry pi tracking camera" Raspberry Pi Motion Tracking Gun Turret - Hackster.io.

I've used a Raspberry Pi pretty extensively and I could probably pull this off. But then English and Social Studies teachers would have to type in Linux commands every morning to get it started. That isn't going to happen. And they'd need a keyboard and monitor to do it. The Arduino, you just plug it in and it starts doing its thing.

I have a Pi application here, a TTN Gateway.

There is no keyboard or monitor.

To start it I turn it on.

mhorton:
I've used a Raspberry Pi pretty extensively and I could probably pull this off. But then English and Social Studies teachers would have to type in Linux commands every morning to get it started. That isn't going to happen. And they'd need a keyboard and monitor to do it. The Arduino, you just plug it in and it starts doing its thing.

It's pretty straightforward to setup a RPi (or any Linux computer) to run an application on startup. The bigger trick is shutting it down without risk of corrupting the filesystem, but that can be done with a read only filesystem and a RAM drive for dynamic data.

Boot time is another area where Arduino shines as that's going to be on the order of a minute for a standard RPi install which may be a consideration.

I've spend a couple hours poking into OpenCV and image processing but I can't say how big a time sink it might be to implement this sort of thing. It should be almost entirely a software project whereas I expect the proposed Arduino approaches are going to involve significant circuit and mechanical construction. If this is a group project with students, then the latter might be a plus since there'd be more tasks to divide among the team, but probably not the quickest route if one actually wants a workable solution.

I'm curious about the overall objective for the project. My first visualization was keeping a spotlight on the instructor. Maybe more practically, I could see a video camera following their movements.

MrMark:
It's pretty straightforward to setup a RPi (or any Linux computer) to run an application on startup. The bigger trick is shutting it down without risk of corrupting the filesystem, but that can be done with a read only filesystem and a RAM drive for dynamic data.

Boot time is another area where Arduino shines as that's going to be on the order of a minute for a standard RPi install which may be a consideration.

I've spend a couple hours poking into OpenCV and image processing but I can't say how big a time sink it might be to implement this sort of thing. It should be almost entirely a software project whereas I expect the proposed Arduino approaches are going to involve significant circuit and mechanical construction. If this is a group project with students, then the latter might be a plus since there'd be more tasks to divide among the team, but probably not the quickest route if one actually wants a workable solution.

I'm curious about the overall objective for the project. My first visualization was keeping a spotlight on the instructor. Maybe more practically, I could see a video camera following their movements.

Yes, it is a camera (or iPad) following the teacher while they teach. It is highly likely that when school opens in August, there will be half of students in class and half of them at home. There are commercial products like Swivl, but they cost thousands each and we'd need 25 of them. There's no way that we can afford that. Another issue with RPi, is in a school, the WiFi does not allow tunneling, SSH, or VPN. The district controls that and it is non-negotiable.

I appreciate the brainstorming, still thinking.

mhorton:
I appreciate the brainstorming, still thinking.

The temptation here is to believe (hope?) there is a low cost solution to the problem, and all it needs is a bit of thinking.

The forum members watching have thousands of years of experience in Arduino projects between them, so if there were a straightforward, low cost, solution, it would be a surprise if it was not known.

Posyx is a solution, and that it exists (and presumably sells) is an indication that locating things in enclosed spaces and using the changes in location to work out direction is not simple or low cost.

To me the idea of putting a marker on the head of someone and tracking movement (and hence direction) with a camera above is a low cost method. That your school may prevent or hinder such approaches does not mean another low cost method will appear.

Neither can I see why a Pi, which could be able to do the camera bit, would need to use 'tunneling, SSH, or VPN'.

Having a Pi send commands to remote servo pointing device, which could be as simple as a Pro Mini, Servo and radio device is at the low end of complexity and cost, I would suggest.

mhorton:
There's no way that we can afford that. Another issue with RPi, is in a school, the WiFi does not allow tunneling, SSH, or VPN. The district controls that and it is non-negotiable.

I agree with @srnet about this.

But if it really is necessary and if the district (presumably an education district) wants to use technology to extend the scope of the teaching then surely they will be agreeable to technical change. And if they don't agree with your proposed use of technology then your first task is to persuade them to change their mind. If you can't then that's the end of the project.

Yes, it is a camera (or iPad) following the teacher while they teach.

There is a very low-tech solution to that.

Paint an X or a small square on the floor and get the teacher to stay in that position. And even if the teacher occasionally goes out of camera range you will have audio so you probably won't lose much.

...R

mhorton:
Another issue with RPi, is in a school, the WiFi does not allow tunneling, SSH, or VPN. The district controls that and it is non-negotiable.

Then if you actually needed it, you would simply have to provide it yourself. Like any other WiFi dead zone. :roll_eyes: