This is an old revision of the document!
Car FM Modulator
Useful links
Introduction
This project consists of building a portable FM modulator, to be used for music playing in cars which don't have Bluetooth connectivity.
This idea occured to me when I had a long drive in my Dacia Logan, having no CDs or Bluetooth speakers, and barely any radio signal.
Features: Bluetooth pairing, frequency selection (using the potentiometer), information display, audio play from SD memory.
General description
Hardware Design
List of components:
Arduino UNO R3
Breadboard + dupont wires
3.5mm jack wire
KT0803K FM transmitter (I2C)
MH-M28 BLE stereo receiver
LCD 1602 (I2C)
Push button
10K potentiometer
1K resistor
Pin connections:
Software Design
External libraries used:
Lab concepts used:
Lab 0 - GPIO
Lab 2 - Interrupts
Lab 4 - ADC
Lab 6 - I2C
Arduino GPIO configuration:
Flow
Synopsis: A button is pressed to toggle the frequency selection. While in frequency selection mode, the ADC is continuously running and reading values from a voltage divider containing a potentiometer (knob), while the LCD is displaying the current selected value (read from the ADC on interrupts) and the transmitter is playing on the previous established frequency. While not selecting, the ADC is turned off in order to save energy, and the transmitter is playing on the established frequency (selected when the mode changes), while the LCD displays it.
On setup, several registers are configured:
DDRC, DDRD and PORTD for GPIO configuration (as above);
EICRA and EIMSK for enabling interrupt on falling edge for pin PD2, in order to detect button presses.
ADMUX, ADCSRA and ADCSRB for setting up the ADC with the following configuration: AVcc (5V) reference, interrupt enable, auto-trigger enable, free-running mode and channel 3 (input on ADC3/PC3).
Then, using library calls, LCD and FM transmitter are set up. A default transmitting Frequency of 90.0Hz is set, and the region is EUROPE.
Two interrupt handlers are set up, INT0 and ADC:
The main execution loop converts the ADC raw value into a transmitting frequency (between 87.5MHz and 108MHz) and displays it on the screen if in selection mode.
Results
Encountered challenges