Audio Receiver and Channel Selector

by jandb86 in Circuits > Audio

1386 Views, 5 Favorites, 0 Comments

Audio Receiver and Channel Selector

00_Overview.jpg

This is the complete outcome of the project utilizing "Audio MUX with PIC-microprocessor circuit" as details are described in the Instructable below.

***

https://www.instructables.com/Audio-Multiplexer-MUX-Circuit-With-PIC-16F84A/

***

Although I described the circuit above as audio MUX (Multiplexer), actually it is more like an audio channel selector supporting the following functions.

***

-     Any auxiliary (AUX) audio input from PC (or Notebook) can be selected and forwarded to the power amplifier

-     The second channel can allow audio streaming from the smartphone to the power amplifier via Bluetooth

-     When the third channel is selected, the selected FM radio signal can be transferred to the power amplifier (Actually it becomes an audio source) 

***

Therefore, I rename this device as "Audio receiver and channel selector (Hereinafter shall be referring as SELECTOR)".

And this device is interfaced with the power amplifier using the LM1875 chip.

Let's look into more detail of the Audio receiver and channel selector circuit.

Block Diagram and Circuit Components

01_Block_diagram.jpg

As SELECTOR consists of multiple circuits, a block diagram is shown in the picture above to show the high-level interaction among the circuit components.

The major function of SELECTOR is switching three audio inputs and sending the only selected single audio signal to the LM1875 power amplifier.

The role of each circuit component is as follows.

***

-     A (Arduino pro-mini selector control circuit): waiting for channel selection through tact switch, turn on LED of the selected audio channel, and activating control line to send the selected audio signal to the power amplifier

-     B (AUX channel selector circuit): send stereo audio signal from PC (or notebook) to LM1875 power amplifier by activating two 5V relays

-     C (MH-M18 Bluetooth audio receiver module): Support smartphone pairing. connection, and streaming audio to the power amplifier

-     D (TEA5767 FM radio module): support FM radio station selection with a potentiometer, show selected radio station information to LCD and forward broadcasting audio signal to the power amplifier

***

The stereo outputs (L/R channel and GND) of three audio sources (AUX/Auxiliary, BTL/Bluetooth, RADIO/FM radio) are connected together to the audio input terminals of the LM1875 power amplifier.

But only a single audio source will be activated by user selection from pressing a certain tact switch button.

Schematics and Circuit Operation

02_Schematics.jpg

This is the schematics of the SELECTOR circuit. 

The key control component of selecting a single audio source (AUX, BTL, and RADIO) is supported by the 5V relays as follows.

***

-     A (Arduino pro-mini selector control circuit) activating two 5V relays for connecting PC (or notebook) audio signal lines (Stereo L/R and GND) to the power amplifier audio input terminals

-     A turn-on 5V relay of C (MH-M18 Bluetooth audio receiver module) to supply power (5V and GND) to C and turn off all other 5V relays of B and D

-     A turn-on 5V relay of D (TEA5767 FM radio module) to supply power (5V and GND) to D and turn off all other 5V relays of B and C

***

The AUX audio signal is special as the PC uses its own power supply for producing stereo audio voltage (signal).

When PC audio output is connected to SELECTOR and subsequently with power amplifier as daisy-chaining style, a possible ground loop can be created.

If the ground loop is forming, unwanted big noise can be entered into the power amplifier.

Therefore, AUX audio input is physically connected or completely disconnected with dedicated two 5V relays to prevent the possible ground loop.

Then let's look at more details of each circuit component.

PCBs of SELECTOR

03_PCBs.jpg

This is the overall mounting layout of PCBs that look at the top side of the SELECTOR chassis.

For housing several numbers of different circuit PCBs within the small space of acrylic chassis, each PCB is closely packed together.

The major controller of A (Arduino pro-mini) is mounted under the PCB B (AUX channel selector circuit).

The B part consists of two small PCBs including the 3.5mm stereo jack (connecting PC audio output) and circuit of two 5V relays.

The C part (Bluetooth audio receiver module) also consists of two PCBs including the small MH-M18 break-out board and one 5V relay circuit.

Part D includes relatively many sub-components.

The main controller (Arduino pro-mini) is located under the TEA5767 FM radio PCB.

I2C 16x2 LCD and potentiometer are mounted at the front acrylic panel.

5V relay PCB is mounted at the backside of the FM radio PCB.

The control lines and power supply cables are wired together among all PCBs of A, B, C, D parts.

Mounting PCBs and Assembling Components

04_Assembling.jpg

For packing many SELECTOR components, each circuit is wired and soldered on the independent small universal PCB.

Each circuit component (A, B, C, D parts) will be explained in detail at each step below.

For powering all these circuits, the following electric components are mounted and assembled together into acrylic boards.

***

-     220V input 5V 3A output SMPS (RD-25 Meanwell)

-     Power socket (220V 15A) and slid power switch (220V 15A)

-     3A fast blown fuse

-     Power cables 22 AWG red and black

-     24 AWG 1A interconnection cable wires (red and blue) and AMP pinhead connectors

-     3 pin headers and universal PCB for 5V power distribution board

-     M4 bolts, nuts, and metallic PCB supporters for the mounting bottom and top acrylic boards (20cm W x 15cm H)

-     M3 bolts, nuts, and metallic PCB supporters for mounting and fixing PCBs

***

The 22 AWG thick cables are used for all wirings where 220V current is flowing.

Somehow the Meanwell 5V 3A SMPS is no longer available in the internet store.

But if any SMPS can supply more than 300mA of current and 5V power output, any power supply can be utilized.

The 5V power input terminals of all SELECTOR circuits are connected to power distribution PCB with 24 AWG cables, pinhead, and AMP pinhead connectors.

A (Arduino Pro-mini Selector Control Circuit) Details

05_New_A_circuit.jpg
06_Old_A_circuit.jpg

Originally 16F84A PIC microprocessor is used for making selector control circuit as shown in the Instructable below and old schematics drawing above.

***

https://www.instructables.com/Audio-Multiplexer-MUX-Circuit-With-PIC-16F84A/

***

But finally, Arduino pro-mini is used as shown in the new schematics drawing above

If I had enough knowledge and experience for utilizing 16F84A PIC, MPLAB development environment, and XC8 C-compiler, I don’t need to change the main controller into Arduino.

But I’m more comfortable with the Arduino board and IDE development environment.

By utilizing the Arduino board as the SELECTOR controller, the following benefits can be attained.

***

-     As more digital ports are available for Arduino, a total of nine ports are assigned for independently controlling RGB LEDs, getting tact button input, and driving 5V relays of B/C/D circuit parts

-     More detail and sophisticated LED control is possible as Arduino C-compiler support diverse control functions

-     More accurate input acquisition and circuit control is possible as timing process logic is Arduino sketch is flexible and more convenient for coding

***

If I'm more comfortable with the PIC microprocessor, MPLAB IDE, and XC8 C-compiler, I can replace Arduino pro-mini with 16F84A MPU later.

But for making SELECTOR at now, I chose the more familiar Arduino controller and program developing environment.

The program operation logic of the selector control circuit is not complex as described in the control flows in the list below.

***

-     Three LEDs (Red, Green, Yellow) sequentially blink 5 times at the turn on the SELECTOR and all three LEDs are on for waiting of audio channel selection by pressing any of tact button switch in the setup routine

-     When entering the loop routine, endlessly do-while loop is staring for getting audio selection input

-     When the AUX channel is selected, only the Red LED is turned on and BTL/RADIO control port status becomes LOW (BTL and RADIO audio channels are safely turned off after 1 second later, AUX control line status changed as HIGH for connecting PC audio output to power amplifier audio input)

-     If the BTL button is pressed, turn on only Green LED and AUX/RADIO control lines are turned off (After safely closing AUX/RADIO audio channels to the power amplifier, BTL board power supply is turned on for activating MH-M18 Bluetooth receiver module)

-     When the RADIO button is pressed, Yellow LED is turned on and AUX/BTL control lines status become LOW (After 1 second later RADIO control line is activated for supplying power to TEA5767 FM radio circuit and Arduino pro-mini controller)

***

Please look at the sketch program file attached to this step for more details.

If you play the video file attached to this step, you may understand what is detailed and sophisticated LED control I described above.

B (AUX Channel Selector Circuit) Details

07_B_AUX.JPG

The AUX selector (B) is a simple switching circuit utilizing two 5V relays as shown in the wiring diagram above.

This circuit is inserted between two 3.5mm stereo jacks that are connected with a PC and power amplifier.

I mentioned the worry about ground loop forming among PC, SELECTOR, and power amplifier in the step above.

Actually, a ground loop is a very difficult signal processing problem, and remedying the issue is not easy.

Also, any wiring problems (short between L/R channel and ground) can be produced a possible damaging effect to PC.

Therefore, I'm considering the audio signal lines should be physically isolated from any other SELECTOR circuit.

Also, connection and disconnection of the signal paths should be clearly segregated for preventing any audio quality degradation.

That is why I'm using dedicated physical contact between PC and power amplifier using two 5V relays.

C (MH-M18 Bluetooth Audio Receiver Module)

08_BTL_C.jpg

This is Bluetooth audio stream receiver module utilizing the MH-M18 module.

As the audio stream is directly transferred from the smartphone to this receiver module via Bluetooth, no physical audio cable wiring is necessary.

When the BTL button is pressed, the 5V relay connected to the selector controller (A) is activated and power is supplied to this circuit.

Please refer to the following Instructable regarding technical and functional details about the MH-M18 Bluetooth receiver module.

***

https://www.instructables.com/Bluetooth-Audio-Receiver/

***

As details are described in the Instructable above, I'll not explain further about this circuit.

When MH-M18 is turned on, you can see the Bluetooth device (e.g. XFW-M18) for connection.

When pairing and connection are finished, you can play MP3 on the smartphone for audio sound can be heard from the power amplifier.

D (TEA5767 FM Radio Module)

09_TEA5767.jpg

The first challenge you facing with the TEA5767 FM module is its size.

As you can see in the picture above, the chip is very tiny for soldering.

When you complete soldering of this chip on some kind of socket or mounting frame, you are successful more than 70% for making FM radio.

I think soldering the TEA5767 chip is more difficult than soldering a tiny IC chip on a delicate SMD PCB.

Usually, I'm using 3M magic tape for fixing the TEA5767 chip on A4 size paper while soldering.

When the chip is fixed on something, each contact of the TEA5767 is soldered with tin wire for easy mounting on the universal PCB as shown in the picture above.

Then look at the FM radio module for more detail.

D (TEA5767 FM Radio Circuit) Schematics

10_FM_Radio.jpg

As mentioned in the step above, wiring of TEA5767 is the most difficult part.

When TEA5767 chip wiring is completed, other components (Potentiometer, I2C LCD, Arduino pro-mini) can be easily connected as shown in the wiring diagram above.

For the selection of radio stations, you can use the tact switches to increase or decrease FM frequency.

But I'm using a potentiometer to support the old analog-style radio operation scheme.

As the value of the potentiometer is not much critical, you can use any resistance value (1K ~ 1M) for this project.

Although hardwiring is not much difficult, making TEA5767 chip controlling sketch programming requires some considerations.

At the minimum level, the following three lines are enough for receiving FM broadcasting from the TEA5767 chip.

***

#include <TEA5767Radio.h>

TEA5767Radio radio = TEA5767Radio();

radio.setFrequency(89.1);

***

When you know the exact FM frequency of the radio station, simply writing frequency value through I2C lines (SDA, SCL) can make TEA5767 tune to that radio station.

There are more than 10 radio stations are available in the region where I live.

Somebody carefully cataloged all these radio stations of my region on the Internet.

Therefore, I know the frequencies of these radio stations.

To select a radio station by turning a potentiometer, the following programming logic is utilized.

***

-     Let's assume I know exactly three radio stations (Signal reception strength is high and stable) such as 80.1MHz (station A), 90.1MHz (station B), and 100.1MHz (station C)

-     As the maximum input value of the potentiometer is 1023 (0~1023), I'm assigning three radio station frequencies as follows.

-     If the potentiometer input value is 0~341, writing station A frequency (90.1MHz) to TEA5767 (1023/3 is about 341)

-     If turning the potentiometer (So trying to change different radio station) and increasing resistance value between 342~682, then station B frequency (90.1MHz) is written to data ports of the TEA5767

-     Finally, the resistance value becomes 683~1023, station C (100.1MHz) is written to the TEA5767 to change the radio station

***

While writing different radio station frequency data to the TEA5767 port, you can show the station information on LCD.

The Arduino sketch program controlling the TEA5767 can be seen in the attached text file of this step.

The program support selection of radio stations as described logic flow explained above.

When you look at the video, you can see more than 10 radio stations are selectable by turning the potentiometer.

As I’m using short (less than 3 meters) indoor wire antenna, the sound quality of the FM radio reception is not quite good.

Anyway, the TEA5767 FM radio module supports casual FM radio program hearing in my room.

Finalization

11_Final.jpg

Most times I'm using the SELECTOR and amplifier for watching Youtube videos.

Therefore, the direct audio cable connection from PC to amplifier is more efficient and easy.

But sometimes I'm tired to see Youtube videos and from time to time listening to music from my smartphone or simply turning on the radio.

Then SELECTOR is quite useful and convenient for changing audio channels.

Therefore, I'm utilizing SELECTOR and the amplifier like a small music center in my room.

***

Thank you for reading.