You are on page 1of 6

Department of Electronics and Communication Engineering

2022– 2023

Project Based Learning (Hobby Project)

FM Transmitter using Arduino


IN

DIGITAL SIGNAL PROCESSING-LAB

NAME OF THE STUDENT: ROLL NO:

V.CHANDRA SURYA TEJA 208R1A0455

V.LIKHITHA 208R1A0456

V.SAI PREETHI 208R1A0457

C.VINEETH 208R1A0458

UNDER THE SUPERVISION OF


MR.B.PAPACHARY
ASSOCIATE PROFESSOR, DEPT OF ECE
Y PRASAD
ASSISTANT PROFESSOR,DEPT OF ECE
INDEX
• INTRODUCTION

• COMPONENTS

• PROGRAM/CODE

• DESCRIPTION

INTRODUCTION:
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.
COMPONENTS:

1. 2n2222 NPN Transistor x2


2. Condenser mic/ audio jack or any other Audio Input part
3. 100nf Ceramic capacitor x1
4. 10nf ceramic capacitor x1
5. 4 pf ceramic capacitor x1
6. 100 ohms resistor x1
7. 10k resistor x 3
8. 1k resistor x 1
9. 100k resistor x1
10. 1M resistor x1
11. Variable Capacitor 20pf
12. Gauge 18 - 22 copper wire
13. 9v battery
14. 9v battery Cap
15. Arduino UNO

CODE / PROGRAM:

#include "U8glib.h"
#include <FMTX.h>
U8GLIB_PCD8544 u8g(13, 11, 10, 9, 8);
int channel=0; float fm_freq = 90;
int reading=0; int last_reading=0; int Current_reading=0; int mapping_reading=000;
void setup(void)
{ pinMode(A0,INPUT); Serial.begin(9600); fmtx_init(fm_freq, USA); u8g.setRot180();
u8g.setColorIndex(1);
u8g.firstPage(); do{ set_screen(1); } while(u8g.nextPage() ); delay(1000);
. u8g.firstPage();
do{ set_screen(0); }
while(u8g.nextPage() ); delay(1000); Clear();
u8g.firstPage(); do{ intro(); } while(u8g.nextPage() ); delay(2500); u8g.firstPage(); do{ intro2(); }
while(u8g.nextPage() ); delay(2500);
Clear();
}
void Analog_pin_read(){
channel=mapping_reading; Current_reading=channel; fmtx_set_freq(channel);
}
void set_screen(int i){ u8g.setColorIndex(i);
for (int x_axis=0;x_axis<84;x_axis++)
{ for (int y_axis=0;y_axis<44;y_axis++){ u8g.drawPixel(x_axis,y_axis); } } }
void Clear(void)
{
u8g .setFont(u8g_font_04b_03); u8g.setFontRefHeightExtendedText();
u8g.setDefaultForegroundColor(); u8g.setFontPosTop();
}
void intro(void){ u8g.setColorIndex(1); u8g.drawFrame(0,0,83,47); u8g
.setFont(u8g_font_osr18); u8g.drawStr( 5, 25, "FM Tx "); u8g .setFont(u8g_font_tpss);
u8g.drawStr( 5, 40, " System");
}
void intro2(void){ u8g.setColorIndex(1); u8g.drawFrame(0,0,83,47); u8g
.setFont(u8g_font_04b_03); u8g.drawStr( 2, 7, "Build Your FM station! "); u8g.drawStr( 2, 15,
"Modify the frequency"); u8g.drawStr( 2, 26, "By Ammar"); u8g.drawStr( 2, 38, "Maker.PRO");
}
void number(int value){
u8g.setColorIndex(1); u8g.drawFrame(0,0,83,47); u8g .setFont(u8g_font_unifont); u8g.drawStr(
5, 15, "Frequency ");
u8g .setFont(u8g_font_osr18); u8g.setPrintPos(10,45); u8g.println(value,DEC); u8g
.setFont(u8g_font_unifont); u8g.drawStr( 45, 38, "MHz ");
}
void loop(){
reading=analogRead(A0); mapping_reading=map(reading,0,1023,90,100);
mapping_reading=constrain(mapping_reading,90,100);
if( mapping_reading!= Current_reading){
Clear();
Analog_pin_read(); u8g.firstPage();
do{ number(channel);
}
while(
u8g.nextPage()
);
delay(100); } }
CIRCUIT DIAGRAM:

DESCRIPTION:

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

1) If 97.3 MHz:
a. (97.3 + 0.304)/0.008192 = 11,914.55
b. 11,914 = B0010111010001010
2) Then:
a. Reg 3 = B10001010
b. Reg 4 = B00101110

The audio output signal from the microphone is usually small, the first transistor thus performs the
job of amplifying that signal to a level good enough for transmission. After amplification as
described earlier, the next stage of the FM transmitter is modulation. At this stage the amplified
audio signal is then mixed with the carrier frequency at with which the signal is to be transmitted.
This carrier frequency can be varied using the 20pF variable capacitor connected with the inductor,
and the typical frequency band of this particular design is between the 88MHz to 108MHz and
since there is no visual output to recognize the exact frequency at which the transmitter is working,
you will need to adjust your FM receiver radio within the range of the frequencies mentioned to
get the frequency at which the transmitter is transmitting. After modulating the Audio signal with
the carrier frequency, the signal is then sent out through the antenna.

RESULT: By the above code we can transmit the signal using frequency modulation using
arduino

You might also like