I am playing around with an arduino and a cheap SDR dongle and I just noticed something strange!

When I play a tune on pin 13 with just a random piece of wire connected to the pin (Using the Melody example from the arduino page: http://www.arduino.cc/en/Tutorial/Melody) I can pick it up as AM sound on my SDR on exactly 64Mhz even as far as 15meters away through walls with a little gain!!!

What magic is going on here and secondly and maybe most importantly would there be a relatively easy way to pick up the signal using just an arduino and cheapo components?

(Just for educational purposes of course, I know that there is better options depending on what I need to send)

64Mhz arduino tone library magic?

I would like any qualified guess as to what is going on, I am genuinely puzzled...

  • 1
  • That gives a good explanation for the signal. Thanks, still don't understand how the internal RF-clock can affect pin output, interresting that it can be hacked into transmitting FM signals too!
    – EJTH
    Oct 28, 2016 at 23:49
  • My guess is you are seeing harmonics of your pin's output. Fast toggling digital signals, like your PWM, carry heavy harmonic content. I would expect many more peaks, but your setup may be by pure luck (stray inductances and capacitances) well tuned for that particular band. Oct 29, 2016 at 14:03
  • @EdgarBonet the display isn't wide enough to see the other harmonics Oct 29, 2016 at 23:14

2 Answers 2


I did something like that a while ago. Hardware:

Arduino as a radio


const byte ANTENNA = 9;

void setup() 
  // set up Timer 1
  TCCR1A = bit (COM1A0);  // toggle OC1A on Compare Match
  TCCR1B = bit (WGM12) | bit (CS10);   // CTC, no prescaler
  OCR1A =  9;       // compare A register value to 10 (zero relative)
  }  // end of setup

void loop() 
  pinMode (ANTENNA, OUTPUT);
  delay (500);
  pinMode (ANTENNA, INPUT);
  delay (300);
  }  // end of loop

The 16 MHz clock is divided by 10 (that is, 1.6 MHz) and that is used to toggle pin 9 at that rate, giving a frequency of 800 KHz, since one toggle turns the output on, and second toggle turns it off.

If you hold the Arduino near an AM radio tuned to around 800 KHz you should hear a hissing toggling on and off (like Morse code) as the carrier is turned on and off for 0.5 / 0.3 second intervals.

would there be a relatively easy way to pick up the signal using just an arduino and cheapo components?

I think you might find making a receiver a bit harder than a transmitter.

  • I just tried to modify the Melody example, replacing the digitalWrite calls with pinMode and I can basicly now play tunes on the AM band, is that even legal :D ?
    – EJTH
    Oct 29, 2016 at 1:23
  • I doubt it. I also doubt it would have enough power to get much further than the walls of your room.
    – Nick Gammon
    Oct 29, 2016 at 1:43
  • Bottom line: The OP has built an 800 kHz AM radio transmitter. All it transmits is an 800mHZ carrier signal. If you modulated the amplitude of that carrier, you could transmit sounds. However, an Arduino doesn't have the processing power to do that. You'd be better off building an analog 800 kHz AM transmitter.
    – Duncan C
    Nov 3, 2019 at 20:59

I dont think Nick Gammon's answer actually explains clearly enough what is going on - he just made an example of how to do it. Since no-one else on this site has had a go at explaning it-I will-though Im no expert in arduino radio communications.

"What magic is going on here"

Its not magic -you are observing the principle of "electromagnetic induction" and the principle of "resonance". Its not unique to arduino- basically an Antenna transmits information by making on and off power changes in the electrical current in the wire-as you are doing playing the melody. By the famous Maxwell equations this energy in the wire creates a corresponding invisible waves in the air. A well known circuit in electrical engineering (tank circuit or oscillator circuit) says that there is also a corresponding receiver circuit (which can be a radio) that will change the waves back into sound (by using the principle of electrical resonance).

  • I think the “magic” the OP is talking about is not the propagation of electromagnetic waves, but rather the emission being at 64 MHz, way above anything the Arduino does. Oct 29, 2016 at 13:51
  • @Edgar Bonet. I can only at best guess what the OP is thinking (from what they wrote in the question) and I think a new reader would appreciate to know what going on in terms of electromagnetic waves-and how how an antenna works-especially if they really didnt know any physics or how transmitters and receivers work Oct 29, 2016 at 16:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.