Go Down

Topic: RF transmitter and Receiver to communicate between two arduinos  (Read 194 times) previous topic - next topic

Noahcowper

I am working on a project with a parter to build a laser tag game that communicates the score between the two players. We are using RF transmitters and receivers to do this, and are trying to shut off LEDs when a hit is registered on the opponent and when the opponent takes a shot. Each player has 7 shots and 5 lives, so when one person takes a shot we want the transmitter to send a signal to the other arduino to turn off the shot LED. This will also happen when a player is hit. If they are hit the players arduino who was hit will send a message to the other opponent and turn off a life pin for the opponent. This is the last part of the project we are trying to figure out, and don't really know where to start. Any help would be really appreciated.

jremington

What have you got so far? Post the code you have.

The first step is to make sure you can do bidirectional communication between two Arduinos.

Noahcowper

Thats the problem we are unable to get any code down. We have been confused as to whether or not we need to use a library. We have tried Radiohead and virtualwier, and have had no luck figuring anything out. The biggest thing I'm looking for is a push in the right direction so that we could get something started.

mauried

How far apart are the Arduinos that have to communicate and whats in between?
How reliable does the communication have to be ?

jremington

The least you could do is tell us what transmitters and receivers you want to use.

Noahcowper

The arduinos need to be able to transmit over a distance of about 15 feet, and the communication needs to be good enough to turn an LED off whenever the guns are fired or a hit is sensed. Although a delay is fine at this point. Also we are in a fairly open room just some tables so there is noting to really obstruct the two. We have to sets of receivers/transmitters. One at 434 MHz and the second at 315 MHz. The following are the part numbers from SparkFun respectively, 10532/10534 and 10533/10535 (Receiver/Transmitter).

jremington

Start by using the VirtualWire library and getting one of the examples to work.

mauried

Those radios will work, but they are very simple cheap radios, so dont expect too much.
In particular, how badly affected will your project be if transmissions are lost, ie you transmit some data
but the receiver doesnt pick it up.
How often will you be transmitting .
You may need to implement some kind of end to end integrity checking, which will have to be coded into the Arduinos.

Noahcowper

Could you please give a example that a beginner could follow, the only ones we have been able to find are a little over our head. As for the importance of picking up a signal it wont affect anything but the scores displayed. They wont be accurate, but this will not affect the game from still being played. The transmissions will be every time a shot is fired or a hit is registered, so it will be fairly regular but would vary on the pace of the game.

mauried

What have you got so far in terms of hardware and code ?

jremington

Quote
Could you please give a example that a beginner could follow, the only ones we have been able to find are a little over our head
The examples that come with VirtualWire are as simple as possible. Which have you tried and what don't you understand about them?

Google "arduino 433MHz tutorial" for lots of ideas.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy