FM Transmitter (NS73M based)
PIC | Last modified on: 03 Aug 2015 @ 15:15:42
It is nice to have a simple way to take the audio output of an iPod, CD player,
or other source of audio and transmit it to a nearby FM radio. A number of products
(both commercial and homebrew) have been tried over the years with varying results.
All of the solutions tried to date suffered from one or more of the following
problems: frequency drift (especially in cold weather), excessive battery drain
that required changing batteries frequently, or such low output power that the
effective range was only a few (under 10) feet. There are some nice commercial
add-ons for the iPod featuring digital frequency synthesis and even digital
displays. However, an iPod isn't the only device that is used here at the Works and
the cost of purchasing and adapting multiple units exceeded our comfort level and
budget.
Enter the NS73M FM Transmitter module from Niigata Seimitsu Co. This wonder chip is able to generate a rock solid FM signal anywhere in the FM broadcast band with an RF output of up to 2 mW. It is a nearly complete solution only requiring two external components (a 32 KHz crystal and a filter capacitor). Best of all, the device has a maximum current drain of 45 mA ensuring long battery life. One little "gotcha" for some is that it is a surface mount device (SMD) and it can be a little tricky to solder. However, it can be done as the photos in the links in acknowledgments section illustrate. The good news is that SparkFun Electronics not only offers the NS73M chip, but a breakout board that is ready to use.
Although the NS73M handles all the details for generating and modulating the RF signal, it does require a microcontroller to program the frequency, power output level, audio preemphasis, and a few other parameters each time the device is powered up. The NS73M supports two communication methods (two wire I2C or three wire SPI) between it and the microcontroller. The microcontroller used in this project (12F675) uses I2C.
Battery holder modification
The battery holder/case chosen for this project starts life off as a 4 cell
battery holder for AA batteries. It also includes a convenient power switch and
a cover. Using a screwdriver, remove the cover and set it aside for the moment.
Remove the screw that holds the panel covering the red and green wires. Carefully
pry off the panel and set that aside as well.
Remove the jumper plate between cells 2 and 3, and move the positive connection to cell 2. Using a Dremel or similar tool, carefully remove the divider between cells 3 and 4 to make room for the circuit board. Route the red and black wires to the space just created. Prepare a 31" piece of wire, which will be used as the antenna. Insert one end into the hole where the power leads use to exit the battery holder. Tie a knot about 2" from the end of the antenna wire to prevent the wire from being pulled out of the battery holder. Replace the panel and retaining screw. After the circuit board is completed, the Dremel will be used to cut a notch for the navigation switch.
The photo shows a partially modified battery holder. The cover and panel at the top of the photo have been removed. The jumper panel has been removed and the positive terminal moved to the left. The divider between cells 3 and 4 has been removed to create room for the circuit board.
Circuit board
The circuit is built using point-to-point wiring on a 1.25" x 2" piece of perfboard with solder pads on the bottom. There is nothing particularly critical with the layout and you are free to adapt the layout to suit your needs. An especially satisfying addition was the use of a thumb operated navigation switch instead of three pushbutton switches. The navigation switch is also a SMD part, but the connectors are on .1" centers, making it compatible with the perfboard layout. Tin the connectors using a soldering iron, attach short leads (made from the discarded leads from the resistors) to the connectors, and solder the switch to the perfboard using the leads. In the photo of the prototype of the circuit board, it can be seen that the holes are off by one (you can see the leads coming off the switch). In subsequent builds we got it right, and you cannot see the leads as they are under the switch. The prototype board also used four capacitors instead of two for the audio inputs because two 1 uF non-polarized capacitors weren't on hand when the prototype was built.
One quirky bit of the design is the inclusion of a 10 uF capacitor across the MCLR (reset) line. Even though the PWRTE (power on timer) is enabled and an additional delay is added by the microcontroller code, the NS73M module would not properly initialize under some circumstances. To avoid having to add another switch for reset, the capacitor holds MCLR low long enough for the module to finish its initialization. You may find that this capacitor is unnecessary.

BASIC source code for transmitter (Proton BASIC)
Ready to program HEX file
NS73M Datasheet
Using the transmitter
When the transmitter powers up for the first time, the transmitter will be set to the frequency of 97.5 MHz (the center of the U.S. FM band). Using the navigation switch, you can move up and down the FM band. Each time the switch is operated, the frequency will change by 200 KHz. Be sure to release the switch and not hold it down. Once the desired frequency is reached, press the SET (center) switch to store the frequency in the non-volatile memory. Next time the board is powered up, the transmitter will operate on this frequency. After several seconds on inactivity, the PIC will enter the sleep state to conserve power. The transmitter will remain on the air.
To change the frequency after the PIC has gone to sleep, turn the transmitter off and then on. This is a nice feature if you are using the transmitter in the car and you travel to an area where the default frequency is in use. Power the board up and use the UP and DOWN switches to select a new frequency, but don't press the SET switch. This way, the new frequency will not be stored and the transmitter will start up on the old frequency. If you are unable to find the current transmitting frequency, holding the SET button for several seconds when the transmitter is powered up will reset the frequency to 97.5 MHz.
Acknowledgments
This project builds on the work of others who were able to do much of the "heavy lifting" wading through the NS73M datasheet and calculating the frequency ranges for the four bands. Our contribution was the port to the PIC 12F675 and the inclusion of a navigation switch. Besides the resources listed on the SparkFun site (under product number WRL-08482 ), much knowledge was gained from Mike Yancey's FM Transmitter Project and a NS73M page in Japan.
This project is solely intended for educational, hobbyist, and experimental purposes. It is illegal to interfere with other, legally transmitted signals. The device is not FCC certified and cannot be used in a commercial product. It is important that you check the regulations regarding unlicensed transmitters that may be applicable in your area. In the United States, please consult the FCC's Part 15 Regulations and the FCC's page on Low Power Broadcast Radio Stations.
Enter the NS73M FM Transmitter module from Niigata Seimitsu Co. This wonder chip is able to generate a rock solid FM signal anywhere in the FM broadcast band with an RF output of up to 2 mW. It is a nearly complete solution only requiring two external components (a 32 KHz crystal and a filter capacitor). Best of all, the device has a maximum current drain of 45 mA ensuring long battery life. One little "gotcha" for some is that it is a surface mount device (SMD) and it can be a little tricky to solder. However, it can be done as the photos in the links in acknowledgments section illustrate. The good news is that SparkFun Electronics not only offers the NS73M chip, but a breakout board that is ready to use.
Although the NS73M handles all the details for generating and modulating the RF signal, it does require a microcontroller to program the frequency, power output level, audio preemphasis, and a few other parameters each time the device is powered up. The NS73M supports two communication methods (two wire I2C or three wire SPI) between it and the microcontroller. The microcontroller used in this project (12F675) uses I2C.
Battery holder modification

Remove the jumper plate between cells 2 and 3, and move the positive connection to cell 2. Using a Dremel or similar tool, carefully remove the divider between cells 3 and 4 to make room for the circuit board. Route the red and black wires to the space just created. Prepare a 31" piece of wire, which will be used as the antenna. Insert one end into the hole where the power leads use to exit the battery holder. Tie a knot about 2" from the end of the antenna wire to prevent the wire from being pulled out of the battery holder. Replace the panel and retaining screw. After the circuit board is completed, the Dremel will be used to cut a notch for the navigation switch.
The photo shows a partially modified battery holder. The cover and panel at the top of the photo have been removed. The jumper panel has been removed and the positive terminal moved to the left. The divider between cells 3 and 4 has been removed to create room for the circuit board.
Circuit board
The circuit is built using point-to-point wiring on a 1.25" x 2" piece of perfboard with solder pads on the bottom. There is nothing particularly critical with the layout and you are free to adapt the layout to suit your needs. An especially satisfying addition was the use of a thumb operated navigation switch instead of three pushbutton switches. The navigation switch is also a SMD part, but the connectors are on .1" centers, making it compatible with the perfboard layout. Tin the connectors using a soldering iron, attach short leads (made from the discarded leads from the resistors) to the connectors, and solder the switch to the perfboard using the leads. In the photo of the prototype of the circuit board, it can be seen that the holes are off by one (you can see the leads coming off the switch). In subsequent builds we got it right, and you cannot see the leads as they are under the switch. The prototype board also used four capacitors instead of two for the audio inputs because two 1 uF non-polarized capacitors weren't on hand when the prototype was built.
One quirky bit of the design is the inclusion of a 10 uF capacitor across the MCLR (reset) line. Even though the PWRTE (power on timer) is enabled and an additional delay is added by the microcontroller code, the NS73M module would not properly initialize under some circumstances. To avoid having to add another switch for reset, the capacitor holds MCLR low long enough for the module to finish its initialization. You may find that this capacitor is unnecessary.



BASIC source code for transmitter (Proton BASIC)
Ready to program HEX file
NS73M Datasheet
Parts List | |
Resistors (rated at 1/8 watt, 10%) | |
R1-R3 | 10k |
Capacitors (rated at 10 volts or greater) | |
C1,C2 | 1 uF non-polarized |
C3 | 10 uF |
C4 | .1 uF |
Semiconductors | |
IC1 | PIC 12F675 8 Pin DIP |
MOD1 | NS73M breakout board (SparkFun WRL-08482) |
Miscellaneous | |
JACK1 | 3.5mm stereo jack |
SW1/BP1 | Battery holder with switch (Jameco 216187) |
SW2 | Thumb operated navigation switch (SparkFun COM-08184) |
Socket | 8 pin DIP socket for IC1 |
Project board | Any general purpose prototyping board with .1" spacing |
Notes | |
1) Do not allow VDD to exceed 3.7 volts. | |
2) NS73M breakout board available at www.sparkfun.com. | |
3) Battery holder and other components available at www.jameco.com. | |
4) Battery holder was modified to use 2 instead of 4 AA batteries. The space that was formerly occupied by the remaining 2 AA batteries houses the electronics. |
Using the transmitter
When the transmitter powers up for the first time, the transmitter will be set to the frequency of 97.5 MHz (the center of the U.S. FM band). Using the navigation switch, you can move up and down the FM band. Each time the switch is operated, the frequency will change by 200 KHz. Be sure to release the switch and not hold it down. Once the desired frequency is reached, press the SET (center) switch to store the frequency in the non-volatile memory. Next time the board is powered up, the transmitter will operate on this frequency. After several seconds on inactivity, the PIC will enter the sleep state to conserve power. The transmitter will remain on the air.
To change the frequency after the PIC has gone to sleep, turn the transmitter off and then on. This is a nice feature if you are using the transmitter in the car and you travel to an area where the default frequency is in use. Power the board up and use the UP and DOWN switches to select a new frequency, but don't press the SET switch. This way, the new frequency will not be stored and the transmitter will start up on the old frequency. If you are unable to find the current transmitting frequency, holding the SET button for several seconds when the transmitter is powered up will reset the frequency to 97.5 MHz.
Acknowledgments
This project builds on the work of others who were able to do much of the "heavy lifting" wading through the NS73M datasheet and calculating the frequency ranges for the four bands. Our contribution was the port to the PIC 12F675 and the inclusion of a navigation switch. Besides the resources listed on the SparkFun site (under product number WRL-08482 ), much knowledge was gained from Mike Yancey's FM Transmitter Project and a NS73M page in Japan.
This project is solely intended for educational, hobbyist, and experimental purposes. It is illegal to interfere with other, legally transmitted signals. The device is not FCC certified and cannot be used in a commercial product. It is important that you check the regulations regarding unlicensed transmitters that may be applicable in your area. In the United States, please consult the FCC's Part 15 Regulations and the FCC's page on Low Power Broadcast Radio Stations.