I have this project where I control a bluetooth audio module with an arduino. In this case, I have used an arduino nano. But then, I have been meaning to add volume control to the project so I use a pt2257. But the sounds that it gives to me is my audio plus heavy buzzing sound and no matter how much attenuation that I set the volume doesnt seems to change. Can anyone help me?

Here is the schematics that I use for the PT2257:

enter image description here

I have tried giving Vdd 5V from arduino, and also 5V from a seperate power supply. But it seems there is no difference.

Here is the code that i use:

    void setup() {
    void loop() {
      Wire.write(0b011100000);    // set low attenuation     
      Serial.print("result 1: ");
      Wire.write(0b11111111);  // set full attenuation           
      Serial.print("result 2: ");

Here is the link to PT2257 datasheet if you need it

EDIT: Here is how I connect CSR8645 Output to my active speaker, before I add a attenuation IC. It works like a charm like this, but I need to add a volume control.

enter image description here

  • Did you connect the ground of the PT2257 and your audio to the ground of your Nano? – StarCat Sep 15 '20 at 6:13
  • I have connected my pt2257 ground to arduino ground. But i didnt connect the audio ground to arduino ground. Since I have csr8645 as the audio source and it has Lp, Ln, Rp, and Rn, which one should i connect to the ground? I use Lp as left audio signal and Rp as right audio signal, Ln as audio ground. So does that mean I have to connect Ln to the ground? – shafiyyah Sep 15 '20 at 8:58
  • Yes, I would connect the audio Ln, Rn to ground. Not having them connected to a (common) ground would explain the buzzing sound (50 or 60Hz interference from the power grid, depending on where you lvie). – StarCat Sep 15 '20 at 9:04
  • 1
    Connecting any output direct to ground is very bad. Do not do it. You would normally connect the Ln and Rn inputs of a differential amplifier to ground through capacitors if you are using a single ended source. You would never connect the output to ground! Using Rp and GND will give you half the amplitude of using Rp and Rn. Leave Rn and Ln disconnected. – Majenko Sep 15 '20 at 11:03
  • So how should I connect the audio attenuation ICs with CSR8645 output? I have single ended active speaker to connect it to. So, without the attenuation IC I connect it like the schematics I add in the edits – shafiyyah Sep 15 '20 at 12:05

many amps and BT audio chips use differential input/outputs. none of the inputs nor outputs are considered grounds.

the Lp(left,postivie) Ln, Rp and Rn on your audio chip should be connected to loads directly. Ln or Rn are not audio grounds. so you can't use simple POT volume controls or any processor or amplifier chip that doesn't support differential IOs. so, you can't use PT2257 in this circuit.

for better understanding here are two audio signal types:

  1. the simple, well known one, which consists of GND and an audio IN per channel. you can use many amplifiers, processors (e.h. PT2257) and POT volume controls. and one end of the output (e.g. speaker) is connected to GND.
  2. the differntial audio signal which consists of a GND and a pair of IN+,IN- per channel. you can't use the soulutions mentioned above. for example, if you wanted to amplify the output signal of the bluetooth chip, you have to use something like PAM8302, 2.5W mono class D audio amp per channel. note the IOs:

enter image description here

  • Firstly, thanks for your kind explanation. Secondly, if i want to do volume attenuation which IC/Module do you suggest me to use? I have been searching for attenuation ICs that uses differential input. But I can't seem to find any that suits my usage. – shafiyyah Sep 15 '20 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.