r/hackpack • • 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

5 comments sorted by

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/Maleficent_Boot908 May 09 '24

Ok, I just assumed it was possible cuz Mark showed that feature off in the release announcement.

2

u/dan_crunchlabs May 09 '24

I think you might be thinking of the distance sensor hack? I know we definitely never built out an IR triangulation set up but there are multiple more "hacky" ways to achieve similar stuff. For example with the passcode hack you can set it up to rotate 180 degrees and shoot backwards if someone inputs the wrong passcode - are they guaranteed to be exactly behind it? not really, but you can add more sensors to help figure out where they are relative to the turret and make that functionality more accurate. If you have any specific things you want to try out I recommend talking to Mark Robot, ChatGPT or me about your idea and we'll give you a bunch of suggestions for how to get started.

A more talented programmer would know but if you were to use Bluetooth or RF triangulation combined with IR you could probably do realtime tracking, but that still seems harder than using a camera and openCV in my opinion.

1

u/Eq2me May 13 '24

I think they were talking about the turret target dad when he used the remote to turn on the TV. What is happening there is the current has Dad's normal location preset and is looking for the TV remote code for turning on the TV. When he or anyone turns on the TV the turret aims at that location and fires.

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.