Saturday 5 October 2013

Software defined FM radio transmitter (Arduino + AD9850)

This video shows it all, take it away!

The frequency is generated by the AD9850 and the modulation is done by the arduino

The full code is here:

The FM band channels are centered at certain frequency, in our case 90Mhz, any slight deviation of that freq (by a max of +/- 75Khz) will move the membrane of the speaker backward or forward, here is the bit of code that implements that. And this is the (unoptimized) modulation routine.
void playTone(unsigned int note, unsigned int duration ) 
  const double freq = 90 * 1e6; // transmitting at 90Mhz

  // play silence 
  if ( note == 0)
  unsigned long currentMillis = millis() + duration;
  while( millis()< currentMillis)
      ad.setfreq(freq + 75e3/2); // speaker's membrane backward
      ad.setfreq(freq - 75e3/2); // speaker's membrane forward

  ad.setfreq(freq );

Credits go to:
Brett Hagman for the RTTTL tune player
Poul-Henning Kamp for the AD9850 lib