Offline
Newbie
Karma: 0
Posts: 11
|
 |
« on: January 17, 2012, 09:50:10 am » |
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=1183055686But 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
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #1 on: January 17, 2012, 10:54:31 am » |
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
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #2 on: January 17, 2012, 11:36:04 am » |
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=josThat'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
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #3 on: January 17, 2012, 02:00:21 pm » |
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
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #4 on: January 17, 2012, 02:05:24 pm » |
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
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #5 on: January 17, 2012, 03:02:51 pm » |
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
Faraday Member
Karma: 27
Posts: 5078
Where's the beer?
|
 |
« Reply #6 on: January 17, 2012, 04:37:16 pm » |
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... 
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #8 on: January 17, 2012, 07:54:46 pm » |
Big inexpensive servos. I'd argue that point on some of those... $87.75 for the last one on the page?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #9 on: January 17, 2012, 08:33:53 pm » |
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...  Yeah, it's a Vulcan. Sorry, I failed to mention that.  As far as the servos, I'm new to servo motors. How do you go about attaching things to them?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6535
Arduino rocks
|
 |
« Reply #10 on: January 18, 2012, 01:45:32 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #11 on: February 23, 2012, 08:07:09 pm » |
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.htmHowever, if I want to use this 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
|
|
|
|
|
|