FM radio with TEA5767

I’d like to add the TEA5767 to my project. It looks like it’s already done.

I see this

which I’m trying to compare with


which is what I’m using.

I scoured the code and the only difference seems to be the radio. But I don’t want to break everything to pieces because at this point if anything happened to „the music box“ my kids would riot. I do know that I was using the wrong code the first time which made it not work so I’m nervous of breaking it.

Can I just drop this firmware on or am I asking for trouble?

The firmwares are based on each other, that’s why the only difference is the radio support. So yes, you can enable the radio in the first one you show, flash it to your box and everything should stay the same - plus the radio. BUT it requires three new speech files, which you need to generate and add to the mp3 folder:

Be aware though, the radio module is connected to the i2c bus on Pins A4/A5. A4 is the 5th Button (if you use 5 Buttons), so you need to go back to 3 Buttons or put that Button on another Pin. I’d ask @Michi how he did that (he’s the creator of the fork with the radio support). I don’t know how tech savvy you are, so this might be the point where you are asking for trouble. :wink:

I think I can follow that. I can use quick time to make the MP3.

I do have 5 buttons up and running at this point. I have a Uno so I am out of analog. Plenty of digital.

I don’t see analog read and slc and sla are only those two pins…so could I just move the button on A4 to a digital pin? Not as pretty but not that bad, either.

Yes you can absolutely do that. Just change the definition at the beginning of the sketch.

Perfect. I should be able to show you the result tomorrow. Also I am going to post a DIY video in English giving you full credit so my 4H students can do one if they want. Besides the obvious parts and tweaks I need to make to the code do you have any suggestions?

Stuck again because the diagram was for stero sound. is there a quick and dirty way to get it back to mono or do I need some sort of chip?

I’m not sure I follow you there. What diagram? All I know about the Radio stuff is in this Thread and I never built it myself:

Hi @Iseoni,

i’m using the following library for the radio module:

It provides some functions to initialize the receiver, which i put in the setup routine:

You can easily switch from stereo to mono if you replace lines 625, 626 like this:

radio.setMonoReception();
radio.setStereoNoiseCancellingOff();

Some months ago I built another box with 5 buttons and an audio mixer using digital potentiometers. And of course I had to adjust the button configuration accordingly. Not sure where I patched the 5th button through, but I can check that and give you this information later.

I’m changing both #4 and #5 buttons just for continuity. Digital 0 and 1 as I do not have a remote. I will make the code fixes to mono, thanks!

I got the library working with a bit of an issue (I had to redownload and restart arduino) but it looks like it’s good to go!

Spent all day wiring up my potentometers and resistors according to your diagram. It was quite the challenge.

I’m putting it together after the kids go to bed. If all goes well I will post some pictures and videos in the AM

Michi had a diagram of how to wire up all the core components. I made the changes to the code and got it to compile just fine. YAY. Recording the voice once the recipients of this device stop making noise for the day. Which is like never…anyway…

@Michi or @stephan

So I’ve run into a major issue…I don’t have an RFID card writer and despite my valiant efforts using the RFID MFRC522 reader sketches and my tags I cannot call up the radio.

I have used a sketch to edit the bites like the RFID program on the android but the rest of it is missing some of the FF

Blockquote2 11 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF [ 0 0 1 ]
10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
1 7 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF [ 0 0 1 ] **
** 6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ] **
** 5 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ] **
** 4 13 37 70 01 01 59 01 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]

0 3 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF [ 0 0 1 ]
2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 0 0 0 ]
0 02 8B 7C D4 21 08 04 00 69 73 73 69 35 36 34 30 [ 0 0 0 ]

I bolded sector 1 as the formatting is not cooperating. Also the Magic cookie and then my desired station which is 89.1 or 59 01

(I’ve also tried 13 37 B3 47 01 59 01 in sector 1 to no avail)

Is there a way I can read the tags and hard code the station right into the .ino code? Do I have to actually save the data on the tags?

I’m so close. so close.

Blockquote uint8_t writeNfcTagStatus = writeNfcTagData(bytesToWrite, sizeof(bytesToWrite)); //this is to make cards

I had someone help me. I uncommented out the above

// uint8_t radioBytesToWrite[] = {0x13, 0x37, 0x70, 0x01, 0x01, 88, 9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; //comment to make radio tags 89, 1 is 89.1 FM
// uint8_t writeNfcTagStatus = writeNfcTagData(radioBytesToWrite, sizeof(radioBytesToWrite)); //comment to make radio tags

then my friend wrote this for me. You change and upload and then save the tag. Then rinse and repeat for every tag.

It works very well, however, I’m now having terrible trouble getting the radio to play when the box is shut.

The kids, however, are rioting and want their box back. So I guess I will put TonUino 1 together and work on TonUino 2. That’s how this seems to go for everyone!

Hi @Iseoni,

you might want to take a look at the following post Vorstellung: ElTon - Elias' TonUINO mit FM Radio. There are also some generic NFC Apps available for iOS, but I’ve never tried them. @marc s TonUINO NFC Tools works best for me. Of course you’ll need either NFC capable device (Android Smartphone or iPhone) to use any of these NFC tools :wink:

BTW: i used pin D8 for the 5th button on my second box