Pages: [1]   Go Down
Author Topic: Transmitting to a nearby AM radio  (Read 2317 times)
0 Members and 1 Guest are viewing this topic.
Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 797
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I can successfully transmit tones to an AM radio nearby with this code:
Code:
void tone(int freq, int duration){
  if(freq == 0){delay(duration); return;}
  unsigned loops = (800000 / freq);
  long wait = (1000000 / freq);
  long v = (duration / ((wait*2)/1000));
  for(long k = 0;k < v;k++){
      for(unsigned i = 0;i < loops;i++){
      PORTD ^= 0x8;
    }
    delayMicroseconds(wait);
  }
}
void setup(){
    tone(440, 500); //Play A4 for 500ms
}
void loop(){}

The circuit is a 1K resistor from pin 3 to an antenna.
It works by actually turning the pin on and off over 800000 times per second.
Received frequency is between 880 and 890 khz.
« Last Edit: February 23, 2011, 05:22:13 pm by smeezekitty » Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a bow, you have invented the Arduino Marconi   smiley-wink
Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 797
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now if I only knew how to read sheet music or how to send morse code.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now if I only knew how to read sheet music or how to send morse code.

Well I have to think that anyone that learns to program and read in C/C++ can learn to read sheet music, not that I've tried. And sending morse code is simple, it's learning to receive it, that's a bitch.

  ._ _   ._   _....  _  _._  _..
 
Lefty

Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 797
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now if I only knew how to read sheet music or how to send morse code.

Well I have to think that anyone that learns to program and read in C/C++ can learn to read sheet music, not that I've tried. And sending morse code is simple, it's learning to receive it, that's a bitch.

  ._ _   ._   _....  _  _._  _..
 
Lefty


http://www.qrz.com/db/wa6tkd
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

0
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

this is some useful work on AM morse code with radio
Logged

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 797
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

this is some useful work on AM morse code with radio
My code is better smiley-wink
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Rural Arizona
Offline Offline
Edison Member
*
Karma: 7
Posts: 1711
Incorrigible tinkerer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now if I only knew how to read sheet music or how to send morse code.
Follow the link in this thread: not only does he do Morse quite cleverly, but, with a name like "Kontrapunkte", he's gotta know something about music, too  smiley-wink
Logged

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

It works by actually turning the pin on and off over 800 times per second.
Received frequency is between 880 and 890 khz.

Shouldn't that be "800,000 times per second"?

I'm also wondering if this could possibly earn one a visit from the FCC, but I am not knowledgeable enough about RF to know whether this would cause any form interference or other issues that would have such consequences (not likely a power issue - though you could easily boost it if you wanted)...

Neat, all the same...

 smiley
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.

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1169088394/0#0
This lets you get up to 4MHz! The code is also incredibly short, but fairly complex, unless you know lots about port manipulation and disabling interrupts.  smiley-twist

Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 797
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It works by actually turning the pin on and off over 800 times per second.
Received frequency is between 880 and 890 khz.

Shouldn't that be "800,000 times per second"?
Fixed.
Quote
I'm also wondering if this could possibly earn one a visit from the FCC, but I am not knowledgeable enough about RF to know whether this would cause any form interference or other issues that would have such consequences (not likely a power issue - though you could easily boost it if you wanted)...
Unlikely since the signal doesn't leave the property. The PO is < 25mw.
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

Netherlands
Offline Offline
God Member
*****
Karma: 7
Posts: 657
A naughty mind is a joy forever.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm waiting for the first DX-contest  smiley
Logged

Pages: [1]   Go Up
Jump to: