Pages: [1]   Go Down
Author Topic: Infrared Homing Turret  (Read 2310 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm planning on using an Arduino to create a NERF turret that uses a thermopile sensor to locate, lock onto, and shoot at a living being. However, I'm not sure I really understand how to do this. After researching many hours upon stroke of luck I found this topic:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1183055686

But I'm not sure how that code works or how I can use it to find a body and direct servo motors to lock onto and shoot a nerf gun at it.

Any advice or help would be greatly appreciated. I plan on incorporating this project into an autonomous 4-wheeled roaming robot that I'm also working on. The end result is that I'm hoping to have a roaming turret that will just drive around, avoid obstacles, and lock onto and shoot at things it notices.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 50009
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Post a link to the sensor that you are using.

You need to get information from the sensor, as you move it around, and find the highest value. That indicates the warmest spot.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I actually was planning on using this: http://www.robotshop.com/devantech-8-pixel-thermal-array-sensor.html?utm_source=google&utm_medium=base&utm_campaign=jos

That's why I said it was lucky to find the thread I linked to - it's the same sensor.

So from your description and what I know about this sensor, it's essentially a 1x8 array of thermal sensing pixels, right? I imagine that means I can easily do horizontal movement for the turrent by simply positioning a servo to turn the gun to the warmest signature. If I wanted to do vertical movement as well, I'd need two of these, correct?
« Last Edit: January 17, 2012, 11:53:31 am by Jyosua » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 50009
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The data you get from that sensor is going to cover an area of 1 by 8 pixels. That's a pretty narrow range. You need, almost, to ignore 7 of the pixels, and rotate through a fairly broad range, probably 360 degrees, to find the warmest spot (which will have moved by then). Vertically, you need to move it through a smaller arc. The heat source is somewhere between straight up and straight down.

If you are just looking for a hot spot (target), as soon as you see the temperature drop off, you are moving past the hot spot, and it is time to stop/reverse direction - in one axis.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That sounds pretty simple. My next question is what to do as far as the servo motor is concerned: Do you happen to know of a good servo that could turn a NERF gun that weighs 7lbs? I saw other people use a sort of belt system to use a smaller servo to do that, but I'm not sure my crafting abilities are good enough to make something like that. I'd rather just had a big wheel servo with a decent range of rotation.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 50009
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are very large servos that can hoist sails on sailboats (full size ones). Plan to spend some money, though.

7 lbs? My Ruger P345 has a hell of a lot more stopping power and weighs n where near that much.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5590
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There are very large servos that can hoist sails on sailboats (full size ones). Plan to spend some money, though.

7 lbs? My Ruger P345 has a hell of a lot more stopping power and weighs n where near that much.

The OP is likely talking about the Nerf Vulcan; I found one of these at Goodwill over the weekend (spent $3.00 for it); I still need ammo belts and darts, though. The thing uses 6 D-cells for its battery pack. 7 lbs seems about right.

Doesn't look as cool as a Ruger, though... smiley-wink
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9671
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Big inexpensive servos. You may want to mount the gun on a plastic lazy susan from walmart to support the weight.

http://www.hobbyking.com/hobbycity/store/__291__189__-X_2DLarge_Servo_50g_2B.html
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 630
Posts: 50009
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Big inexpensive servos.
I'd argue that point on some of those... $87.75 for the last one on the page?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are very large servos that can hoist sails on sailboats (full size ones). Plan to spend some money, though.

7 lbs? My Ruger P345 has a hell of a lot more stopping power and weighs n where near that much.

The OP is likely talking about the Nerf Vulcan; I found one of these at Goodwill over the weekend (spent $3.00 for it); I still need ammo belts and darts, though. The thing uses 6 D-cells for its battery pack. 7 lbs seems about right.

Doesn't look as cool as a Ruger, though... smiley-wink

Yeah, it's a Vulcan. Sorry, I failed to mention that. smiley-lol

As far as the servos, I'm new to servo motors. How do you go about attaching things to them?
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9671
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'd argue that point on some of those... $87.75 for the last one on the page?

Just depends on what one is looking for and the price one is willing to pay.

http://www.lynxmotion.com/p-741-i00600-servo.aspx

http://www.hobbyking.com/hobbycity/store/__16643__VS_11_Vigor_Extra_Large_Servo_19sec_19kg_103g.html

http://www.hobbyking.com/hobbycity/store/__18742__Vigor_VSD_11AYMB_MG_HV_Extra_Large_360_Degree_Winch_Servo_0_75sec_50kg_150g.html
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got another question, in regards to the topic. So I now understand how the sensor works after I read this: http://www.robot-electronics.co.uk/htm/tpa81tech.htm

However, if I want to use this code:
Code:
// prototype code for interfacing Devantech TPA81 thermopile array
// http://www.robot-electronics.co.uk/htm/tpa81tech.htm
//
// Jason Winningham
// 27 june 2007

#include <Wire.h>
#define TPA81ADDR (0xd0>>1)

void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
  Serial.print("starting TPA81 test\n");
}
 
void loop()
{
  byte b;
  int i;
  
  for (i=1; i<=9; i++)
  {
    Wire.beginTransmission(TPA81ADDR);
    Wire.send(i);
    Wire.endTransmission();
    
    Wire.requestFrom(TPA81ADDR, (int) 1);
 
   while(Wire.available() < 1)
   { ; }

    b = Wire.receive(); // receive a byte as character

    Serial.print(b, DEC);
    Serial.print(" ");
  }
  Serial.println("");
 
  delay(2000);
}

Which pins do I use on the arduino? Sorry for the dumb question T_T, still kinda new to arduino code.

Edit: Turned out to be analog pins 4 and 5. I ran the code, and it works! Now I just have to modify the code to control a servo based on data from this sensor!
« Last Edit: February 23, 2012, 09:55:49 pm by Jyosua » Logged

Pages: [1]   Go Up
Jump to: