Need help with wireless project

Hi
I'm brand new at this, so please forgive my inexperience, but I am a product design student working on a project for school, and I really need help.
I was wondering if there was anyway to take this basic setup:

http://www.honorlevel.com/data/Arduino/MorseCode1/codeOscillator.01.html

and make the speaker function wirelessly (I don't need it to work at a range of more than 30 feet or so, although any distance greater than that would be fantastic if possible). If it can be done, what exactly would I need (other than the items already listed in the how-to guide) and how would I do it? Also the final object would need to be able to fit inside a plastic outer casing that I will ultimately design so it will need to operate on battery power. Simple/cost effective solutions are always appreciated. Thank you so much in advance for your patience and help!

If I understood you correctly, you have a design for an Arduino circuit and sketch which has a button and a buzzer and sounds the buzzer when the button is operated. You want to split this in two so that you have one Arduino with a button, and another Arduino with a buzzer, and have the buzzer sound when you operate the button.

That's straight forward using a couple of radio transceivers. There are various types you could use, but a pair of nRF24L01+ transceivers would only cost a few bucks and would work over that sort of range. Obviously you'd need a pair of Arduinos, and you'd need two sketches: one to read the button and send a radio message when it was operated, and the other to read the radio and sound the buzzer when the message was received.

Took a bit of hunting to find the the nRF24L01+ at yourduino ...
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=188

Thank you for replying! Is there any way to do it without using two Arduinos? The idea is that there will be two separate telegraphs that can communicate with each other by sending a signal wirelessly to the speaker inside of the other person's device. Because of this it would mean each plastic casing I must design will have to include two Arduinos inside of it. This will add considerable bulk to the final object's overall form which is difficult because I need to be concerned with usability and ergonomics. Would it be possible to avoid including more than one Arduino per telegraph if I used technology I took from an existing product to connect (maybe a wireless mouse or bluetooth)?

oliverin:
Thank you for replying! Is there any way to do it without using two Arduinos? The idea is that there will be two separate telegraphs that can communicate with each other by sending a signal wirelessly to the speaker inside of the other person's device. Because of this it would mean each plastic casing I must design will have to include two Arduinos inside of it. This will add considerable bulk to the final object's overall form which is difficult because I need to be concerned with usability and ergonomics. Would it be possible to avoid including more than one Arduino per telegraph if I used technology I took from an existing product to connect (maybe a wireless mouse or bluetooth)?

You didn't mention anything about this being bidirectional before.

Of course you only need one Arduino in each 'handset'. Each Arduino would have a button that caused a message to be sent to the other unit, and sounded the buzzer when it received a message from the remote unit.

Yes, use a transceiver with each arduino:

http://arduino-direct.com/sunshop/index.php?l=product_detail&p=188

The Arduino can be a small version as well, such as this Mini-uino more pics & parts listed at my signature link).
Has a xtal and couple of Rs & Cs on the back side.
Run from 3 AAAs, power everything from 4.5V directly, no regulators needed.
Or a flat LiPo battery & 8 MHz xtal vs 16MHz.

And the arduino would be able to simultaneously operate the wireless transceiver and play the tone when the the button is pressed without having to use more than one code? Where would I connect the transceiver? (Thank you again for your help, this is my first time wiring anything other than a lamp)

Yes.

http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
Scroll down ~2/3, the pins you would connect to are listed there.
So basically connect to Power, Gnd, SS (D10), MOSI (D11), MISO (D12), SCK (D13)
Have to do some reading for CE, CSN, IRQ.

Have to run at 3.3, so maybe just 2 AAAs.

http://www.linear.com/product/LTC3525 and a couple of parts

or this

Ok, I'm going to try this. Thank you so much for your help!

Oh! One more question: How do the speakers connect?

Use the Tone library to create a tone to play thru speaker.
The speaker connects to a PWMable pin (3,5,6,9 - 10,11 will be used for SPI) with a series resistor so that your speaker does not draw over 35mA.
5V/35mA = 140 ohm (speaker+resistor)

Hi!
So I tried it today and I think I must have wired it wrong because it didn't work. I basically left all the wiring in the photos hooked up exactly where they were, except for the connection at D11 which I changed to D9 (I made sure to change that part of the code as well). I also left the wire that goes to the 5 volt slot in the arduino exactly where it was. Then I connected the transceiver like this:

But when I turned it on the beeping sound only came from the speaker hooked up to the arduino I was using, not from the other arduino.

Do I need to change the speaker away from D9? Will that fix the problem?

What do you have for code?

here is the code:

int myKey=14; // We are borrowing Analog Pin 0 and using it as digital
int speaker=9; // Speaker will be hooked between pin 9 and ground

int val=0; // A value for key up and down
int myTone=410; // Freq. of our tone

void setup() {
pinMode(myKey, INPUT);
pinMode(speaker,OUTPUT);
}

void loop() {
val=digitalRead(myKey); // Read the state of the key
if (val) tone(speaker,myTone); // If it is down play the tone
if (!val) noTone(speaker); // If it is not down stop the tone
}

Will I need to change the code?

Will I need to change the code?

Yes.

  if (val) tone(speaker,myTone);   // If it is down play the tone
  if (!val) noTone(speaker);       // If it is not down stop the tone

If val is not true, is there any possible way that !val will be false?

if(val)
  tone(speaker, myTone);
else
  noTone(speaker);

And this will fix the wireless transceiver problem? The telegraph beeps the way it is supposed to, it just only does it on the arduino that you are using (it won't transmit wirelessly).

I am so confused. Do I need to write new code or install something to activate the transceiver? Because basically all I have done is connect the transceiver to each arduino like this:

and moved the second speaker to d9.

but then I read this and it makes it sound like I need to add stuff for it to work:

http://arduino.cc/playground/InterfacingWithHardware/Nrf24L01

Here is an excerpt from the page:

nRF24L01

An Arduino port of the tinkerer.eu library. It works with the Sparkfun nRF24L01+ modules.

Note: This library supports a small (but useful) subset of the features provided by the nRF24L01 chip.

Download -> Mirf.zip

Also see github repository

Documentation
Pins:

MISO -> 12
MOSI -> 11
SCK -> 13

Configurable:

CE -> 8
CSN -> 7

Properties:

byte cePin
CE Pin controls RX / TX, default 8.
byte csnPin
CSN Pin (Chip select not), default 7.
byte channel
RF Channel 0 - 127 or 0 - 84 in the US, default 0.
byte payload
Size in bytes, default 16, max 32.

NB: channel and payload must be the same for all nodes.

Methods:

void init(void)
Initialize the module, set the pin modes for the configurable pins and initialize the SPI module.

Example:
Mirf.csnPin = 9;
Mirf.cePin = 7;

Mirf.init();

void setRADDR(byte *addr)
Set the receiving address. Addresses are 5 bytes long.

Example:
Mirf.setRADDR((byte *)"addr1");

void setTADDR(byte *addr)
Set the sending address.

Example:
Mirf.setTADDR((byte *)"addr1");

void config(void)
Set channel and payload width. Power up in RX mode and flush RX fifo.

Example:
Mirf.payload = 32;
Mirf.channel = 2;
Mirf.config();

bool dataReady(void)
Is there data ready to be received?.

Example:
if(Mirf.dataReady()){
//Get the data to play with.
}

void getData(byte *data)
Get the received data. 'data' should be an array of bytes Mirf.payload long.

Example:
byte data[Mirf.payload]
Mirf.getData(data);

void send(byte *data)
Send data. 'data' should be Mirf.payload bytes long.

bool isSending(void)
Return true if still trying to send. If the chip is still in transmit mode then this method will return the chip to receive mode.

Example:
Mirf.send(data);

while(Mirf.isSending()){
//Wait.
}

//Chip is now in receive mode.

NB: Lots more information is available from the status registers regarding acknolagement or failure status. See Mirf.cpp:218.

bool rxFifoEmpty(void)
Is the RX Fifo Empty.
bool txFifoEmpty(void)
Is the TX Fifo Empty.

byte getStatus(void)
Return the status register.

void powerUpRx(void)
Power up chip and set to receive mode. Also clear sending interrupts.
void powerUpTx(void)
Power up tx mode.