I was searching on ebay.com for a TDA7052A (AF amplifier in a DIL package) and among the results I found a module of tiny stereo FM radio with an integrated circuit RDA5807M. It is a complete DSP receiver clocked with a 32 kHz watch crystal and controlled via the IIC (I2C, TWI) interface. So I bought it.
The DSP receiver is a smd integrated circuit RDA5807M, of size less than 3x3mm with ten pins (MSOP10 package). I suppose that its main use is as a FM radio in mobile phones. All that it needs is a 1.8-3.3V DC power, 32.768kHz crystal, antenna and headphones. The frequency range is 50-115 MHz in five sub-ranges. For us, the range of 87-108 MHz is useful. The tuning step is 100 kHz by default, but it can be set to 25 kHz, 50 kHz, 100 kHz or 200 kHz. The volume can be set in 16 steps (4 bits, ie 0-15) with a logarithmic curve. It has the option of switching to MONO, switching on BASS-Boost, and several other settings, see pdf datasheet. It can directly drive a low impedance (32 Ohms) stereo headphones. All settings are made using I2C (TWI) (two-wire interface / protocol). In the recommended circuit schematics there are two coils and a parallel LC resonant circuit for decoupling a shielding of headphones cable, which also serves as an antenna.
RDA5807 schematic from pdf datasheet
Module - dimensions
Pinout of the module
I have bought a module where the integrated circuit is already soldered on a tiny PCB (about 10x10mm), which also has a crystal, a filter capacitor on the power supply and a coupling capacitor on the antenna input. It is much easier to handle than it would be with a bare integrated circuit. (Just for information: price for 5 pieces was less than USD 3.0 including postage).
When I got the module, I checked that it really works with an Arduino and some simple program I downloaded from the Internet. Then I designed a PCB for my own version of the receiver with this module, MCU Atmega328PB (smd version), OLED graphic display (128x64 pixels, 0.96 inch), mechanical rotary encoder and three buttons.
See the video at the end of the article for more details.
A total of 20 spaces for presets are available (I think thats enough). Hold down the button on the encoder axis to store the currently tuned frequency and the currently displayed RDS text into the next free position. The presets can only be deleted all together - by holding down the BT3 button when switched power on ("ERASED" is displayed).
The currently set values - Frequency, Volume, Mono/Stereo and Bass-Boost On/Off are stored in the non-volatile memory of the MCU (Eeprom), so that when the radio is switched on, it plays the same as before. I do not use the volume adjustment directly in the RDA5807M but I use the voltage control inputs of the TDA7052A AF amplifiers.
I had quite a problem displaying RDS texts. Mainly because I don't understand it properly. I tried to study the RDS standards and tried to find out how it is applied in this circuit (RDA5807M). I found something in some discussions on the Internet, I found something myself by trial and error. In the end it somehow works, but it is far from perfection. However, it shows the names of the stations, if they are broadcasted in the standard way, and that's enough for me.
As a last function, I made a measurement of the supply voltage and an indication of low battery. After loading the program into a MCU, the value is about 4.0V (it depends on the resistances R8 and R9, I recomend at least 1% values), which is also at the lower limit of the indication. The stabilized supply voltage of the 3.3V for the MCU is also the reference voltage for the AD converter. And below the 4V of the supply voltage, the stabilization is not very perfect (about 0.7V "eats" the protective diode at the input) and so the measurement is not extra accurate. Any different indication value can be set by holding the BT1 button while turning power on. Set the desired voltage with the adjustable power supply and confirm and save it by pressing BT2.
The 3.3V supply voltage for RDA5807m, MCU and display is stabilized by "low_drop" stabilizer LE33A (manufacturer ST). Therefore, there is no problem to power the entire radio, for example, from a 4.5V flat battery. AF power-amplifiers are powered directly. The manufacturer guarantees their functionality from 4.5 volts but I have tried that they work without problems from 4.0V even when the volume is already falling. It could help a little to replace the protective diode D1 with a Schotky type, or to completely remove it (replacing it with a piece of wire).
All 3.3V circuits are powered through JP3.3V jumpers. This makes it possible to disconnect the necessary circuits, for example during programming. The IC RDA5807M can not withstand 5V power and if we have only 5V programmer, it could "pass away". (I myself destroyed 2 pieces).
In the previous version I had a problem with interference caused by the multiplex of OLED display. I solved this by adding a diode D2 and a capacitor C19 (220µF) to the display feed. The only filter capacitor itself was ineffective. However, this has slowed the rising-time of the voltage when power-on, and some displays are unable to reset properly at power-on. This should be remembered when purchasing the display. These 0.96 inches with one yellow line and the rest of the blue work well for me. On the other hand, some of 1.3 inches, all blue, without the ability to change the address are quite problematic. You also need to be careful about the order of the pins. Some 1.3-inch displays have swapped power pins (+ and -).
Since I didn't know how to get rid of interference from the display multiplex in the previous version, I had added the option to turn off the display. I retained this feature also in this release. This saves a few mA if necessary.
Audio power amplifier
I put two AF amplifiers TDA7052A in DIL package at the output. They can produce up to 1 Watt into 8 Ohms even at low supply voltage. In addition, they allow volume control via DC voltage. The control voltage is obtained from the PWM converter on one output pin of the MCU. They are powered directly from the input connector, only via a protective diode. According to the datasheet they can withstand a maximum of 18 Volts. The output of the amplifiers is symmetrical (BTL principle = Bridge-tied-load) and the output is blocked if the output current difference of each amplifier is higher than 100_mA. However, this allows us to connect, for example, stereo headphones via three conductors (L + P + Shield) through coupling capacitors to the + outputs. For headphones, the power at 100_mA is more than sufficient.
Resonant circuit at the antenna input
The L1/C16 resonant circuit at the antenna input is tuned approximately to the center of the band. I put it there just for a good feeling. Subjectively, there is no improvement (but also no degradation) in the sensitivity of the receiver after its addition. I have no equipment for objective measurement. (In the recommended circuit schematic from the manufacturer's datasheet, it is necessary to separate the shield of the headphone cable, which also serves as an antenna).
Coil L1 came out: 6 turns with 0.8mm wire for 5mm drill bit.
The printed circuit board also contains pads for potential soldering of SMD version of this coil.
Populated PCB front side
Populated PCB back side
The whole receiver is on one PCB with dimensions of 100x45mm. The PCB board serves also as a subpanel. From the front there are controls (buttons, rotary encoder) and the display. Almost all the other components are on the back side. Only 3 blocking capacitors 0.1µF/smd are there below the display on the front side.
All THT ceramic capacitors are 5mm pitch. Also, all resistors are 5mm pitch (resistors size 204). If larger resistors (207) are used, they must be soldered upright.
The rotary encoder can be soldered from the front (terminals directly to the PCB) or put from the rear and fastened to the PCB with a central nut. It is then necessary to connect its terminals with the PCB by pieces of wire. The advantage of this second option is that the encoder does not protrude too far from the other components.
The JP3 jumper allows you to swap the rotary encoder switches A and B if it works in reverse.
The front panel designed as PCB
I have drawn the front panel as a PCB and had it manufactured in China.
I have written the firmware in the MCS Bascom-AVR editor/compiler. To display the frequency, I have created my own font - such a pseudo seven-segment digits. The internal RC oscillator 8 MHz in Atmega is used for firmware running. Therefore, when programming a MCU, it is necessary to disable the division of the frequency by eight in the configuration bits. A .hex and .bin files for Atmega328PB are saved in one .zip file in the DOWNLOAD section of this web.
If someone would like to customize the program according to his ideas, I can post him the source code by e-mail. Please note that this is in MCS Bascom-AVR. Sometimes people don't understand that it is NOT Arduino (.INO file).
However, I also designed the printed circuit board for an alternative option of clocking from an external 16 MHz crystal. This allows you to write a complete program in Arduino (or in C++ or in anything else), export a hex file, and upload it via the ISP connector. As I have seen, there are very complex and certainly absolutely functional libraries in Arduino for the this circuit (also when it comes to RDS).
Video with operating instructions
I put a video on Youtube of how the radio works. I recorded the picture by phone and the sound directly from the headphones output of the radio to the PC sound card input. That's because I wanted a video with stereo sound.
As you can see in the video, the original way of storing stations into presets worked by storing the currently set frequency and the currently displayed RDS text at the next unoccupied position in the preset memory by holding the button of the rotary encoder for a longer time. There were some problems if the station name was not displayed correctly at the time of saving. So I made some change in the firmware, which is not in the video.
The new way works as follows:
Hold down the button of the encoder axis to display the number of the next available position in the preset memory and inverted (in negative) RDS text ready to be stored. At this moment we have three options:
Either briefly press this button again to save what is displayed.
Or using the rotary encoder you can set the number of a lower (already occupied) position and overwrite this position with a new station.
Or press BT3 (Display / SCN +) to cancel the saving. Nothing will be saved.
Removing stations from memory is still possible only all at once, by holding down the BT3 button when the power is turned on. Now, I am not in the mood to do it, but maybe during long winter evenings I will do some comfortable routine for storage and deletion of stations into memory, including entering your own text for the stored station.
Tento web site byl vytvořen prostřednictvím phpRS - redakčního systému napsaného v PHP jazyce.
Na této stránce použité názvy programových produktů, firem apod. mohou být ochrannými známkami
nebo registrovanými ochrannými známkami příslušných vlastníků.