Go Down

Topic: Arduino powered I2C FM tuner repurposed from an old PC card (Read 139 times) previous topic - next topic

kingbeetle66

With a few basic commands, an I2C Philips or Philips clone FM tuner can easily be controlled with an Arduino.

I desoldered the tuner from the card, attached it to a solderless breadboard along with an LCD display, a few momentary pushbuttons and an IR receiver, and voila!  Instant FM radio with an infrared remote!


Link to image

Link to YouTube video

If anyone is interested, I can provide the code.

janvier123

We are looking for Arduino Projects. Register today and post your project.

kingbeetle66

Here's the basic info on controlling the tuner and setting the desired frequency:
Direct shortcut to section of the video that deals with controlling the FM tuner

Here's a basic, set-one-frequency-and-that's-it example:

Code: [Select]
/*
This is a bare bones basic sketch that sets the FM tuner to 96.3 MHz and displays it on a LCD.

Feel free to email me at kingbeetle66(at)gmail(dot)com with any questions.
*/

#include <Wire.h>
#include <LiquidCrystal_I2C.h> //(this is the fmalpartida I2C LCD library)

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  //These are the values for my Sain Smart I2C 20x4 LCD; different values may be needed for your particular LCD

//default values for the tuner; default freqency of 96.3 MHz
byte f_high = 0x08;
byte f_low = 0x5C;
byte c_1 = B10001000;
byte c_2 = 0xA4;

//custom characters for the signal strength meter and antenna symbols
byte antenna[8] = {
  B11111,
  B10101,
  B10101,
  B01110,
  B00100,
  B00100,
  B00100,
  B00100
};
byte signal_3[8] = {
  B00001,
  B00111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B11111
};

byte signal_2[8] = {
  B00000,
  B00000,
  B00000,
  B00001,
  B00111,
  B11111,
  B11111,
  B11111
};

byte signal_1[8] = {
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00000,
  B00001,
  B00111
};

void setup()
{
  lcd.begin(20,4);      //initiate the LCD
 
  lcd.createChar(1,signal_1);           
  lcd.createChar(2,signal_2);
  lcd.createChar(3,signal_3);
  lcd.createChar(4,antenna);

  send_data();
}

void loop()
{
    Wire.beginTransmission(0x61);
    Wire.requestFrom(0x61,1);
    byte s = Wire.read() & 7;
    lcd.setCursor(16,3);
    if (s > 0) {lcd.write(1);} else {lcd.print(" ");}
    lcd.setCursor(17,3);
    if (s > 1) {lcd.write(2);} else {lcd.print(" ");}
    lcd.setCursor(18,3);
    if (s > 2) {lcd.write(3);} else {lcd.print(" ");}
}

// subroutine to send the four bytes of data to the tuner and display frequency on the LCD
void send_data()
{
  Wire.beginTransmission(0x61);
  Wire.write(f_high);           
  Wire.write(f_low);             
  Wire.write(c_1);           
  Wire.write(c_2);           
  Wire.endTransmission();
 
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("  Arduino FM Radio");
  String dec_freq = String(word(((f_high << 8) + f_low) / 2) - 107);
  char decimal = dec_freq.charAt(dec_freq.length() - 1);
  dec_freq = "Frequency: " + dec_freq + decimal;
  dec_freq.setCharAt(dec_freq.length() - 2,'.');
  lcd.setCursor(2, 2);
  lcd.print(dec_freq);
  lcd.setCursor(19,3);
  lcd.write(4);
}



Attached is a sketch that provides a more complete solution, with IR remote control and programmable presets.  (It was too long to fit in the body of this reply)


janvier123

We are looking for Arduino Projects. Register today and post your project.

miker00lz

Cool! Clever. I've got a few of the cards with those WinTV tuners around. I might give this a try some time. Thanks for sharing.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy