Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Build Your Own Digital FM Radio Transmitter with Arduino

I recently searched for a digital FM transmitter kit, but most of the ones that I found online were either
too expensive or did not have enough flexibility for my future applications. So I decided to make my own
digital FM transmitter with the help of some popular and inexpensive components. At the heart of my
design is an NS73M FM Transmitter Breakout Board. It is digitally tunable from 87 MHz to 108 MHz, and
Right and Left channels are available for stereo broadcast as well. According to some tutorials, with 2-
mW maximum broadcast power, we’ve been able to transmit up to 60 feet with a mere 31-inch piece of
wire. I tested my prototype to about 10 feet of distance with a simple 6-inch piece of 22SWG hookup
wire as the antenna.

The project is, in fact, a matter of putting together two highly integrated modules with a tested code
snatched from the web (I still need to bundle it with my own code). Both of the freestanding modules
(NS73MFM transmitter, Arduino UNO) can be mounted to a breadboard and interconnected. Refer to
the hardware setup and proceed. The simple code generates digital tones with the Arduino and
broadcasts on Left channel (L) to prove connectivity and transmission frequency. The hardware shown
below is able to take in stereo audio inputs by performing L+R channel modulation; i.e., it can work with
the typical 3.5-mm stereo audio jacks of your laptops or smartphones. However, note that the maximum
audio input levels are at only 200 mV (by raising the volume too high, the audio may get clipped and
you’ll get piteous music at the receiver side). To transmit audio, just connect the audio source to LIN,
RIN, and GND. Use the same code to set the broadcast frequency, but omit the tone generation in the
loop function of the given code.
Learn the code:
#include "pitches.h"
int CK = 13; // Clock
int DA = 11; // Data
int LA = 10; // Latch

int AudioPin = 9; // Tone Output

int notes[] = {
NOTE_A4, NOTE_B4, NOTE_C3
};

int numNotes = 3;

void setup() {
Serial.begin(9600);
pinMode(CK, OUTPUT);
pinMode(DA, OUTPUT);
pinMode(LA, OUTPUT);
digitalWrite(LA, LOW); //Unlatch transmitter
delay(100); //Wait
spi_send(0x0E, B00000101); //Software reset
spi_send(0x01, B10110100); //Register 1: forced subcarrier, pilot tone on
spi_send(0x02, B00000011); //Register 2: Unlock detect off, 2mW Tx Power
spi_send(0x03, B10001010); //Register 3: Set broadcast freq to 97.3, lower
byte
spi_send(0x04, B00101110); //Register 4: Set broadcast freq to 97.3, upper
byte
spi_send(0x08, B00011010); //Register 8: set Osc on band 2
spi_send(0x00, B10100001); //Register 0: 200mV audio input, 75us pre-
emphasis on, crystal off, power on
spi_send(0x0E, B00000101); //Software reset
spi_send(0x06, B00011110); //Register 6: charge pumps at 320uA and 80 uA
Serial.print("Transmitting"); //for debugging

void loop() {
// square wave tones
//tone(9, notes[random(numNotes)], 500);
// random frequency
tone(9, random(50, 5000), 20);
delay(10);
}

void spi_send(byte reg, byte data) //Routine to send Register Address and
Data as LSB-first SPI
{
int x;
int n;
digitalWrite(LA, LOW);

for (x = 0 ; x < 4 ; x++) //Send four-bit register address


{
digitalWrite(CK, LOW); //Toggle the SPI clock
n = (reg >> x) & 1; //n is the xth bit of the register byte
if (n == 1) {
digitalWrite(DA, HIGH); //Put high bit on SPI data bus
}
else {
digitalWrite(DA, LOW); //Put low bit on SPI data bus
}
Serial.print(n);
digitalWrite(CK, HIGH); //Toggle the SPI clock
}

for (x = 0 ; x < 8 ; x++) //Send eight-bit register data


{
digitalWrite(CK, LOW); //Toggle the SPI clock
n = (data >> x) & 1;
if (n == 1) {
digitalWrite(DA, HIGH); //Put high bit on SPI data bus
}
else {
digitalWrite(DA, LOW); //Put low bit on SPI data bus
}
Serial.print(n);
digitalWrite(CK, HIGH); //Toggle the SPI clock
}
delayMicroseconds(1); //Wait
digitalWrite(LA, HIGH); //Latch this transfer
delayMicroseconds(4);
digitalWrite(LA, LOW);
digitalWrite(CK, LOW); //Keep CK pin at 0V at end of data
transfer
Serial.print("\n"); // Send new-line to serial for debugging
}

As presently configured, the NS73M transmits at 2-mW power output with a 75-μs pre-emphasis
and 100% modulation to occur at 200 mV of audio input. During initial power-up, it will start at
97.3 MHz. Fortunately, everything is reconfigurable, including the FM broadcast band edges and
the channel spacing. You can use this formula to determine the register values for a new
transmitting frequency (f): (f + 0.304)/0.008192. Remember to use only the whole number and
convert the result to 16‐bit binary, in which the lower byte goes in register 3 and the upper byte
goes in register 4.

For example:

 If 97.3 MHz:
o (97.3 + 0.304)/0.008192 = 11,914.55
o 11,914 = B0010111010001010
 Then:
o Reg 3 = B10001010
o Reg 4 = B00101110

Link: https://www.electroschematics.com/13133/build-digital-fm-radio-transmitter/
FM Receiver
This project is an FM receiver circuit radio based on Philips TEA5767 digital radio-receiver module. The
radio receiver uses I2C interface with Arduino UNO development board. The TEA5767 module offers
such features as stereo or mono outputs, radio station scanning and signal strength indication. The
author’s prototype on a breadboard is shown in Fig. 1.

Circuit and working

The circuit of the Arduino-based FM receiver, shown in Fig. 2, is built around Arduino UNO
board (board1), TEA5767 radio receiver module (FM1), LM386 low-power amplifier (IC1),
16×2 LCD (LCD1) and 8-ohm speaker (LS1).

Arduino UNO board


Arduino is an open source electronics prototyping platform based on flexible, easy-to-use
hardware and software. It is intended for artists, designers, hobbyists and anyone interested in
creating interactive objects or environments.

Arduino UNO is a board based on ATmega328 microcontroller. It has 14 digital input/output


pins, six analogue inputs, a USB connection for programming the on-board microcontroller,
power jack, an ICSP header and a reset button. Operation is with a 16MHz crystal oscillator and
contains everything needed to support the microcontroller. It is easy to use as the user simply
needs to connect it to a computer with a USB cable, or power it with an AC-to-DC adaptor or
battery, to get started. The microcontroller on the board is programmed using Arduino
programming language and Arduino development environment.

Pins A4 and A5 of the Arduino board are connected to DATA and CLOCK pins of the FM
module (FM1), respectively. 10 through 12 pins of the Arduino board are connected to EN, R/W
and RS pins of LCD1 while pins 2 through 5 are connected to data pins of the LCD. Pins 7 and 8
of the Arduino board are connected to tactile switches S1 and S2 to increase and decrease FM
frequency, respectively.

Link: https://electronicsforu.com/electronics-projects/hardware-diy/fm-receiver-circuit-using-
arduino

You might also like