Adafruit Si4713 FM Radio Transmitter with RDS/RDBS Support Created by lady ada Last updated on 2018-08-22 03:42:13 PM UTC
Guide Contents Guide Contents Overview Pinouts Audio Inputs Power Pins Interface Pins 2 3 6 6 6 6 Extra GPIO Pins 7 Assembly 8 Prepare the header strip: Add the breakout board: And Solder! 8 9 9 Arduino Code Arduino Wiring Download Adafruit_Si4713 Load Demo Using the RPS Scanning function Library Reference 12 12 12 12 15 16 Radio Transmitter control RPS (Radio Power Sensing) RDS/RBDS (Radio Data Broadcast) GPIO Control Advanced! 16 17 17 18 18 Python & CircuitPython CircuitPython Microcontroller
Overview Yaaar! Become your very own pirate radio station with this FM radio transmitter. This breakout board, based on the best-of-class Si4713, is an all-in-one stereo audio FM transmitter that can also transmit RDS/RBDS data! Wire up to your favorite microcontroller (we suggest an Arduino) to the I2C data lines to set the transmit frequency and play line-level audio into the stereo headphone jack. Boom! Now you are the media.
This transmitter even has RDS/RBDS support - that's text/data transmissions that many modern FM receivers support. (It's how some car radios can display the FM station and current song playing). You can transmit just about any text you want, set the station identifier as well as the 'freeform' buffer. © Adafruit Industries https://learn.adafruit.
Best of all, you'll be up and running in minutes with our awesome Arduino library, example code and tutorial! © Adafruit Industries https://learn.adafruit.
Pinouts There's a couple pins on this here breakout, lets cover them all in groupings by 'type' Audio Inputs LIN - this is the line level LEFT input. Its connected to the headphone jack as well but in case you want to wire directly without a chunky cable, pipe line level (~0.7 Vpp) audio into here. There's an AC blocking capacitor on board so it can be DC biased RIN - same as LIN but the RIGHT input. Power Pins Vin - this is the power input pin. You can power the chip from 3-5VDC.
Extra GPIO Pins There's also two "GPIO" pins, you can use these to blink LEDs. The initial state of these pin sets up the chip for Analog Mode so don't short them to ground or VCC during reset. They are 3V output only! GP1 - this is GPIO #1 GP2 - this is GPIO #2 GPIO #3 is used for the 32Khz clock generator onboard. © Adafruit Industries https://learn.adafruit.
Assembly Prepare the header strip: Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down © Adafruit Industries https://learn.adafruit.
Add the breakout board: Place the breakout board over the pins so that the short pins poke through the breakout pads © Adafruit Industries https://learn.adafruit.
And Solder! Be sure to solder all pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the antenna An antenna is required! We provide a 1meter long wire but you can also use a shorter or longer piece as desired. Strip a few mm from the end Hook the exposed wire end into the ANT hole © Adafruit Industries https://learn.adafruit.
Solder it in! Done! © Adafruit Industries https://learn.adafruit.
Arduino Code Arduino Wiring You can easily wire this breakout to any microcontroller, we'll be using an Arduino. For another kind of microcontroller, just make sure it has I2C, then port the code - once the low level i2c functions are adapted the rest should 'fall into place' (https://adafru.it/dBn) (https://adafru.it/pOA) Connect Vin to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of.
You may want to update the FM station transmission. By default the library transmits on 102.3MHz FM, but that might be 'taken' in your area. Find this line #define FMSTATION 10230 // 10230 == 102.30 MHz And change it to an unused frequency. This number is in 10KHz so for example 88.1MHz is written as 8810 Upload it to your Arduino and open up the Serial console at 9600 baud © Adafruit Industries https://learn.adafruit.
As long as you get to the RDS On! message that means everything works, pipe some audio into the 3.5mm jack and make sure you see the InLevel audio volume range from 0 to about -10 (dB) © Adafruit Industries https://learn.adafruit.
The fastest way to test the RDS message sending is using an RTL-SDR (that's how we debugged the breakout!) (https://adafru.it/dBr) or a phone/radio that can do RDS decoding Using the RPS Scanning function The Si4713 has the ability 'scan' the FM band and measure the input power. You can use the RPS functionality to locate a good unused station. Find this section in the adaradio demo and uncomment the for loop: // Uncomment below to scan power of entire range from 87.5 to 108.
The larger the number the higher the transmission power. For example, 96.3MHz is a higher number than the others (FYI, its Univision 96.3 FM (https://adafru.it/dBs)!) whereas 95.1 MHz is nice as low, that's not used for any transmission. Try to find a number that's also not surrounded by high numbers, since it can get 'drowned out' by the nearby frequencies. Library Reference Radio Transmitter control Start out by initializing the Si4713 chipset with begin() © Adafruit Industries https://learn.adafruit.
This will return true if the radio initialized, and false if the radio was not found. Check your wiring if its not 'showing up' Then you can turn on the radio transmitter with setTXpower(txpwr) the txpwr number is the dBμV transmission power. You can set this to 88-115dBμV or 0 (for off) Of course, you'll want to tune the transmitter! Do that with tuneFM(freq) That will set the output frequency, in 10's of KHz. So if you want to tune to 101.
GPIO Control There's two GPIO pins you can use to blink LEDs. They are GPIO1 and GPIO2 - GPIO3 is used for the oscillator. To set them to be outputs call setGPIOctrl(bitmask) where the bitmask has a 1 bit for each of the two pins. For example to set GPIO2 to be an output use setGPIOctrl((1<<2)) to set both outputs, use setGPIOctrl((1<<2) || (1<<1)) Then you can set the output with setGPIO( bitmask) same idea with the bitmask, to turn both on, use setGPIOctrl((1<<2) || (1<<1)).
Python & CircuitPython It's easy to use the Si4713 FM transmitter with Python or CircuitPython, and the Adafruit CircuitPython SI4713 (https://adafru.it/Bq7) module. This module allows you to easily write Python code that controls the transmitter and sends RDS data. You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility library (https://adafru.it/BSN).
adafruit_si4713.mpy adafruit_bus_device Before continuing make sure your board's lib folder or root filesystem has the adafruit_si4713.mpy, and adafruit_bus_device files and folders copied over. Next connect to the board's serial REPL (https://adafru.it/Awz) so you are at the CircuitPython >>> prompt. Python Installation of SI4713 Library You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python.
The higher the dBuV noise value the stronger the signal and better chance there's a real station broadcasting there. The exact values will differ based on your area and the nearby stations but in general a small value under 32 is probably unused, and a large value above 40 is a strong radio signal. Notice in the screen shot above 107.7mhz has a strong signal with noise value of 45 dBuV, this makes sense because a nearby FM station, Seattle's 107.7mhz FM The End (https://adafru.
print('Audio level: {0} dB'.format(si4713.input_level)) print('Audio signal status: 0x{0:02x}'.format(si4713.audio_signal_status)) Notice the input level is around -16 dB which is a typical value for audio (lower values mean less volume / input level and higher values up to 0 or more mean very loud input).
That's all there is to the basic Si4713 usage with CircuitPython! Below is a complete demo that will configure the board for FM transmission at a specified frequency (see the FREQUENCY_KHZ variable at the top). It will broadcast RDS data and periodically print audio input level and signal quality status.
# Configure RDS broadcast with program ID 0xADAF (a 16-bit value you specify). # You can also set the broadcast station name (up to 96 bytes long) and # broadcast buffer/song information (up to 106 bytes long). Setting these is # optional and you can later update them by setting the rds_station and # rds_buffer property respectively. Be sure to explicitly specify station # and buffer as byte strings so the character encoding is clear. si4713.
Python Docs Python Docs (https://adafru.it/C5B) © Adafruit Industries https://learn.adafruit.
Downloads Datasheets & Files Si4713 Datasheet (https://adafru.it/dBc)(this does not include any software interfacing details) Si47xx Programming guide (https://adafru.it/Bqa) - contains all the nitty-gritty details on command data packets etc. Fritzing object in Adafruit Fritzing library (https://adafru.it/c7M) EagleCAD PCB files in GitHub (https://adafru.