xbee question

can i use two xbees to collect information and put it together in one big database? like if i had two laser tag guns, gun 1 and 2, and each shooots in a different pattern so you know whos who. If gun one shot gun 2 4 times, and gun 2 shot gun 1 2 times, could i program them to both know? basically i am wondering if i can connect two and most likely more xbees.

oh and i also saw that there is a wireless shield. could i do the same thing with this, or does the wireless only connect to internet?

xbees are radios. Can you use a radio to put information in a database?

xbees can collect data from sensors, or from an Arduino. They can broadcast that data. They can receive data broadcast by other xbees, and give it to a serial port or to the Arduino that the xbee is connected to.

If an xbee is connected to appropriate hardware, like this
SparkFun XBee Explorer USB - WRL-11812 - SparkFun Electronics, and there is appropriate software running on the computer that the hardware is connected to, the software could process the serial data, and make entries in a database.

There are different kinds of xbees. Some form networks, so any number of xbees can talk to each other. It sounds like you want a number of xbees (one per gun) to talk to one xbee, though. For that, the series 1 radios are what you want.

Are you interested in knowing that the gun was fired, or are you interested in knowing whether the gun hit a particular target?

Why you want one gun to know what the other one did?

How do you intend to capture this information? How do you intend to display it?

How much experience with embedded electronics do you have? With programming?

There are certainly interesting possibilities in what you want to do, but there are lots of requirements that need to be thought out before you jump off the diving board.

What wireless shield are you referring to?

ahh! too many questions! im glad you understood what i was trying to say. I didn't think i explained it well.

well first off, my theory was that the gun would not know if it hit another gun 2. only gun 2 would know that it got hit.

I am using an IR led. The LED would flash when the trigger is pulled. there is a sensor (a photodetector) on the other gun. when the gun it hit, it looses points, while the gun that shot gains points. since there are many guns i would make it flash in a pattern ( in matters of milliseconds). The detector would detect that pattern, and therefore know who shot it, and then that person gains points. Then the final scores for that player will be shown on an lcd screen. does that answer your questions?

and the wireless shield i was referring to is located here:
http://www.cutedigi.com/product_info.php?cPath=284&products_id=4237&osCsid=07c3e89412c9c146f52e0f2dbe77a2ad

and come to think of it, instead of going through every gun to see who has the highest score, i might have one central xbee that collects all information and i can see on my laptop. would this change the type of xbees i should use?

The WiFi shield is about twice the price of a xbee, but it might work.

I presumed that there would be a central xbee. That one communicates with the PC to enter data into the database.

What is the range of your IR LED and photodetector? How far apart can the guns be? How accurately does the detector need to be aimed towards the transmitter? How narrowly focused is the transmitter? It wouldn't do to have to have the target very narrowly focused and the shooter hitting everything in sight without even aiming.

Good luck with the project.

the IR angle is 17 degrees. is that too narrow? i could also have a convex lens, too. the guns would not be too far apart, say, 40 meters at most.

and also, i was planning to use the lcd screen shield on the same site that i mentioned before. But, I don't think i can stack the lcd on top of the xbee, or vice versa. Is there any way to hook it up otherwise? please list some details or links if you know.

The shield that libelium designed for the xbees is atrocious. It covers up a bunch of pins, is not well supported (physically), and does not play well with other shields.

The LCD shield that digikey sells has all the same issues (except for support).

You could design a board to mount the xbee and passed all the pins through, similar to the prototyping shield but with the xbee in the center, instead.

The only problem with this approach is the antenna. The xbee needs to be at the top of the stack of shields, for it's antenna to be useful.

An IR angle of 17 degree is probably good. I don't know that 40 meters is a possible range. I think you should prototype that part of the project first.

Set up two Arduinos with IR senders and receivers, and some LEDs (say 5 each) and buttons. Send a signal every time the button is pressed. Every time the IR receiver receives a signal, turn on another LED.

Get a friend to help you test them. Run around outside, and see how sensitive and accurate they are, standing still AND moving rapidly. After all, in a shoot-em-up game, nobody is going to stand still.

Once you are satisfied that the IR stuff works, add three xbees - one for each Arduino/gun and one attached to the computer. Have each xbee send data whenever it "gets hit".

Make sure you can receive the data, and know which "gun" it came from.

Then, try sending data back to the "guns", and lighting the LEDs based on data received by the xbee.

Once all that is working, figure out what you want to display on the LCD, and integrate the LCD, not using a shield.

When it all works bread-boarded, you will know whether you want to design a custom PCB to incorporate the Arduino, the LCD shield, and the xbee shield into one board.

I make an Arduino compatible board (ZB1) that integrates an XBee and ATmega168/328. It sounds like it could work for this application. I also have an LCD interface and a prototyping board that work with the ZB1.

The datasheet and application hints are at Loading...

(* jcl *)


www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks
blog: http://luciani.org

Just on the IR angle; is the IR angle of 17 deg for the emitter or receiver?
For the emitter wouldn't this be to wide as at 40m, wouldn't it mean the base of the IR cone would be 12m in diameter.
For the reciever wouldn't it be to narrow as to avoid getting hit all you would do is turn 8.5 degrees away from straight on to the enemy.
I don't know exactly how the guns and targets will be implemented, maybe multiple receivers and the emmiter inside a barrel, i think if the IR emitter was in a 5mm barrel 500 long (would fit into an assualt type rifle gun) the IR cone would be 200mm at 40m (although maybe it will spread out more from diffraction - is that the right term? :-?).
Anyone feel free to correct me if I'm wrong :-/

I think that you are right. That's why the OP needs to test the IR transmitter/receiver before going any further.

Yeah, this sounds like a pretty cool project.

More suggestions (as if you don't have enough to deal with! ::));

  • Some sound to the guns would be good, otherwise how would you know if it is safe to go out.
  • Everytime someone gets hit, they are deactivated (killed) and must return to some place and wait some time before being reactivated - think paintball/deathmatch style rules.
  • Allow for single shot, burst and rapid fire. And track number of shots/rounds used to destinguish the sharp shooters from the Rambos, also could give a limit number of shots before having to return to base to rearm.
  • (now for a bit of a silly one) How about some granades, simply timer and lots of IR LED set at a low intensity (hopefully this wouldn't be detected at to big a distance). Pull the pin, throw, duct for cover and then kaboom - IR lights up all over and kills everyone in the area. Unless someone dives on it!

Anyway, as I said sounds like an awesome idea. Keep up the work and you will be playing in no time!

the IR angle is 17 degrees. is that too narrow?

For transmitter (shooting end) that is probably too wide. I think you can easily narrow the angle by placing the transmitting led inside a tube (the gun barrel). Deeper inside the barrel => more narrow angle.

A friend of mine works for a company that produces products that do exactly what you're talking about, with paintball guns, using XBees. Sorry, I don't know any of their secrets, but yes, it's not only possible, but someone is doing it commercially.

What company? Perhaps OP could check out their products.

A friend of mine works for a company that produces products that do exactly what you're talking about, with paintball guns, using XBees.

What exactly do they record? using IR? As Paul said this would be good for research, maybe they might even give out some of their secrets since you would have 2 simular but still very different end products, expecially if this is just to have a bit of fun with you mates.