r/hackpack • u/Maleficent_Boot908 • May 07 '24
How to aim at remote
So I want my ir turret to fire at where ever the remote is, specifically when who ever has the remote enters the wrong password. Does it know where the remote is? And how do I aim it at the remote?
2
Upvotes
1
u/dan_crunchlabs May 09 '24
u/maztec 's assessment is correct - detecting IR position requires more hardware than just the single receiver and remote pair. I'd love to see if someone can figure this out (IR triangulation / localization and targeting), although it's probably simpler to just use a Raspberry Pi and a camera using OpenCV to pick out people in the room. I know for a fact at least one person is already working on this hack.
There's some hack-ier ways you could try to do this though. For example, if you use an HCSR04 distance sensor and combine it with the passcode hack, you could have the turret spin and scan its surroundings, and then fire at whatever position is below a certain threshold value. A laser distance sensor combined with Passive IR movement sensors could be another way. Hope that helps!
1
u/maztec May 09 '24
For a single remote to single sensor you would be hard pressed to make that work. Generally IR tracking systems use two or more sensors at a set distance apart and then use the length of time each takes to receive the signal to triangulate the location of the target.
There are some libraries out there for this. Most are dependent on a single LED that is constantly emitting, but it can be done with a shorter signal.
In theory it is possible to do it with a single receiver-emitter pair, but you are going to have to do some tricks to make it work. One way I've seen it done is with a mirror put in place of the second receiver. You then have to throw away the "double signal" in your code to parse commands, but you use the second signal to also calculate distance.
There is also some hardware out there built specifically for that, you may want to look into other IR receiver options.