Sunday, April 15, 2018

Carpc project - FM transmitter

I recently uploaded a new video to show my custom-made carpc based on a Raspberry Pi. In the video, I had to leave a lot of information out for the sake of runtime, so, I decided to write a little series of posts to explore thoughts and ideas about this project.

This episode is about the FM transmitter.

Disclaimer (sort of):
Be aware that this post is not self-contained. If you haven't seen the video, you probably won't get much out of this reading. Also, this is not a tutorial on how to build a carpc like the one I made. For that, I'd need much more time and space. I just want to document the thought process behind a few hardware and software choices, share some techno-ramblings, and provide you with some links to get you started using the components I used.

Have you ever modified your car with custom electronics? Are you planning to hack a Raspberry Pi into a device that was not intended to be modified? Have you ever started a simple project (such as adding music to your car), and somehow turned it into a huge, titanic undertaking?

FM transmitter

 

Adafruit FM transmitter.
Adafruit FM transmitter.
This is the crucial part of the project. I needed to find a component capable of transmitting an audio signal to a selectable FM channel, with a transmission range long enough to be picked up by my car radio, but short enough not to force-broadcast my music to the entire neighbourhood...

The device I used in this project is a stereo FM transmitter based on Si4713, from Adafruit. This little toy receives audio from a standard stereo audio jack and transmits it to an FM channel of choice. In open space I could get a transmission range of several meters, so I have good hope my car radio will be able to pick up the signal. The transmitter can be controlled via I2C, and again, Adafruit has a very good tutorial to get you started.

The media center interface.
The media center interface.
The most important point is the selection of the transmission channel. For the system to work, I need to transmit on a frequency that is not used by any other radio station. To achieve that, I wrote a script that abuses the FM transmitter as a (crappy) receiver, with the purpose of measuring the input power of each channel of the FM spectrum. The channel with the lowest detected power is probably free (low input power means that nobody is transmitting on that channel), and it is selected for the transmission. I hooked this script to a permanent button on the home screen of my carpc, to be able to change transmission frequency at all times with the push of a button. The GUI button always shows the frequency in use, to let me know what channel I should tune my car radio to.


In Kradion's car, radio follows you.

The FM transmitter also supports RDS. For fun, I decided to also transmit the name of the "radio channel" to my car, to make it appear on the display. The name of the station? KradioN (and I really hope you get the pun, or I'll be seriously disappointed).

Have fun,
Kradion

1 comment:

  1. Great idea to hook a button with the script that searches for available channels. Would be nice to see that script, please.

    ReplyDelete

Featured posts

Raspberry Pi Bluetooth speakers