На базе Arduino и аудиопроцессоре BD37033FV можно собрать довольно качественный регулятор тембра и громкости. В качестве органов управления регулятором тембра и громкости применены кнопки, энкодер и ИК пульт. На LCD экран 1602 (I2C) выводятся значения регулируемых параметров.
Аудиопроцессор BD37033FV имеет несколько входов и выходов, в данном случае будет использовано только три стерео входа и шесть выходов (ПК ЛК фронт, ПК ЛК тыл, два выхода сабвуфера).
Регулятор тембра и громкости на BD37033FV имеет следующие характеристики:
- Напряжение питания от 7.0 до 9.5 В
- Ток потребления 31 мА
- КНИ 0,002% (VOUT=1Vrms BW=400-30KHz)
- Выходное напряжение шума 5,5 µVrms
- Перекрестные помехи между каналами -100 дБ
- Входное сопротивление 100 кОм
- Максимальное входное напряжение 2,1 Vrms
- Перекрестные помехи между селекторами -100 дБ
- Входной предварительный усилитель (независимый для каждого входа) 0…16 дБ
- Диапазон регулировки громкости от -79 до +15 дБ
- Режим MUTE — 100 дБ
- Регулировка тембра по ВЧ СЧ и НЧ -15…+15 дБ, регулируемые частотные полосы и скважность
- Тонкомпенсация 0…15 дБ, регулируемые частотные полосы
- ФНЧ сабвуфера — регулируемые частотные полосы
- Независимый для каждого выхода аттенюатор -79…15 дБ
- Выход STANDBY
- Управление:
- Энкодер — все параметры кроме MUTE, POWER, IN, MENU2
- Кнопки — MUTE, POWER, IN
- ИК пульт — все параметры
Управление параметрами регулятора тембра и громкости очень простое, основные параметры выделены в основном меню (громкость, тембр). Кнопки отведены под функции быстрого доступа — MUTE, POWER, IN, MENU2.
При нажатии на кнопку POWER происходит активация режима STANDBY, гаснет экран и на выходе D7 Arduino появляется лог. единица. Во втором меню, в разделах предварительного усилителя входов и аттенюаторов выхода для переключения входов\выходов дополнительно используется кнопка IN.
#define IR_1 0x2FDD02F // Кнопка вверх #define IR_2 0x2FD32CD // Кнопка вниз #define IR_3 0x2FD906F // Кнопка > #define IR_4 0x2FDF20D // Кнопка < #define IR_5 0x2FD708F // Кнопка IN #define IR_6 0x2FD6A95 // Кнопка MUTE #define IR_7 0x2FD00FF // Кнопка POWER #define IR_8 0x2FDB24D // Кнопка MENU2 #include <Wire.h> #include <LiquidCrystal_I2C.h> #include <BD37033FV.h> #include <Encoder.h> #include <EEPROM.h> #include <MsTimer2.h> #include <boarddefs.h> #include <IRremote.h> BD37033FV tda; LiquidCrystal_I2C lcd(0x27,16,2); // Устанавливаем дисплей IRrecv irrecv(12); // указываем вывод модуля IR приемника Encoder myEnc(9, 8);// DT, CLK decode_results ir; byte a1[8] = {0b00000,0b10101,0b10101,0b10101,0b10101,0b10101,0b10101,0b00000}; byte a2[8] = {0b00000,0b10100,0b10100,0b10100,0b10100,0b10100,0b10100,0b00000}; byte a3[8] = {0b00000,0b10000,0b10000,0b10000,0b10000,0b10000,0b10000,0b00000}; unsigned long time,oldPosition = -999,newPosition; int vol,vol_d,bass,bass_d,middle,middle_d,treb,treb_d,menu,menu2=100,in,gain0,gain1,gain2,gain3,gain_d,lon_f,lon,lon_d; int out,vol_out,rf,lf,rt,lt,sab1,sab2,treb_c,mid_c,bas_c,sab_f,treb_q,mid_q,bas_q,faza; byte z,z0,z1; boolean w,w2,gr1,gr2,power,www,mute; void setup() { irrecv.enableIRIn();lcd.init();lcd.backlight(); lcd.setCursor(0,0);lcd.print(" BD37033FV ");delay(2000); Serial.begin(9600); lcd.createChar(0,a1);lcd.createChar(1,a2);lcd.createChar(2,a3); pinMode(10,INPUT); // МЕНЮ КНОПКА SW энкодера pinMode(2,INPUT); // ВЫБОР ВХОДА КНОПКА IN pinMode(3,INPUT); // КНОПКА MUTE pinMode(4,INPUT); // КНОПКА POWER pinMode(7,OUTPUT); // ВЫХОД STANDBY pinMode(5,INPUT); // КНОПКА MENU2 MsTimer2::set(3, to_Timer);MsTimer2::start(); if(EEPROM.read(100)!=0){for(int i=0;i<101;i++){EEPROM.update(i,0);}}// очистка памяти при первом включении vol = EEPROM.read(0)-79;treb = EEPROM.read(1)-15;middle = EEPROM.read(2)-15;bass = EEPROM.read(3)-15;in = EEPROM.read(4); gain1 = EEPROM.read(5);gain2 = EEPROM.read(6);gain3 = EEPROM.read(7);lon = EEPROM.read(8);lon_f = EEPROM.read(9); rf = EEPROM.read(10)-79;lf = EEPROM.read(11)-79;rt = EEPROM.read(12)-79;lt = EEPROM.read(13)-79;sab1 = EEPROM.read(14)-79;sab2 = EEPROM.read(24)-79; treb_c = EEPROM.read(15);mid_c = EEPROM.read(16);bas_c = EEPROM.read(17);sab_f = EEPROM.read(18); treb_q = EEPROM.read(19);mid_q = EEPROM.read(20);bas_q = EEPROM.read(21);faza = EEPROM.read(22); cl();audio();} void loop() { if(digitalRead(10)==LOW&&power==0&&menu2==100){menu++;cl();time=millis();w=1;w2=1;if(menu>3){menu=0;}}// меню if(digitalRead(2)==HIGH&&power==0&&menu2!=3&&mute==0){in++;;cl();time=millis();w=1;w2=1;www=1;if(in>2){in=0;};lcd.setCursor(0,0);lcd.print(" INPUT ");lcd.print(in+1);audio();delay(2000);}// КНОПКА ВЫБОРА ВХОДА I if(digitalRead(3)==HIGH&&mute==0&&power==0){mute=1;cl();w=0;w2=1;lcd.print(" MUTE ");menu=100;menu2=100;audio();}// mute on if(digitalRead(3)==HIGH&&mute==1&&power==0){mute=0;cl();time=millis();w=1;w2=1;menu=0;myEnc.write(0);audio();}// mute off if(digitalRead(4)==HIGH&&power==0){power=1;mute=1;audio();lcd.clear();lcd.setCursor(0,0);lcd.print(" POWER OFF ");w=0;menu=100;menu2=100;delay(3000);lcd.noBacklight();}// power off if(digitalRead(4)==HIGH&&power==1){power=0;mute=0;audio();lcd.backlight();lcd.clear();lcd.setCursor(0,0);lcd.print(" POWER ON ");menu=0;time=millis();w=1;w2=1;myEnc.write(0);delay(3000);lcd.clear();}// power on if(power==0){digitalWrite(7,HIGH);}else{digitalWrite(7,LOW);} // выход STANDBY if(digitalRead(5)==HIGH&&power==0&&menu<4){menu2=0;menu=100;cl();time=millis();w=1;w2=1;lcd.setCursor(0,0);lcd.print(" MENU 2 ");delay(2000);}// menu 2 on if(digitalRead(5)==HIGH&&power==0&&menu>3){menu2=100;menu=0;cl();time=millis();w=1;w2=1;}// menu2 off if(digitalRead(10)==LOW&&power==0&&menu>3){menu2++;cl();time=millis();w=1;w2=1;if(menu2>11){menu2=0;}}// меню 2 ////////////////////// IR ///////////////////////////////////////////////// if ( irrecv.decode( &ir )) {Serial.print("0x");Serial.println( ir.value,HEX);irrecv.resume();time=millis();w=1;}// IR приемник - чтение, в мониторе порта отображаются коды кнопок if(ir.value==0){gr1=0;gr2=0;}// запрет нажатий не активных кнопок пульта if(power==0){ if(ir.value==IR_1&&menu2==100){menu++;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;if(menu>3){menu=0;}}// меню кнопка вверх if(ir.value==IR_2&&menu2==100){menu--;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;if(menu<0){menu=3;}}// меню кнопка вниз if(ir.value==IR_1&&menu==100){menu2++;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;if(menu2>11){menu2=0;}}// меню2 кнопка вверх if(ir.value==IR_2&&menu==100){menu2--;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;if(menu2<0){menu2=11;}}// меню2 кнопка вниз if(ir.value==IR_5&&power==0&&menu2!=3&&mute==0){in++;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;www=1;if(in>2){in=0;};lcd.setCursor(0,0);lcd.print(" INPUT ");lcd.print(in+1);audio();delay(2000);}// КНОПКА ВЫБОРА ВХОДА IN if(ir.value==IR_6&&mute==0){mute=1;gr1=0;gr2=0;cl();w=0;w2=1;lcd.print(" MUTE ");menu=100;menu2=100;audio();}// mute on if(ir.value==IR_6&&mute==1){mute=0;gr1=0;gr2=0;cl();time=millis();w=1;w2=1;menu=0;myEnc.write(0);audio();}// mute off if(ir.value==IR_8&&menu<4){menu2=0;gr1=0;gr2=0;menu=100;cl();time=millis();w=1;w2=1;lcd.setCursor(0,0);lcd.print(" MENU 2 ");delay(2000);}// menu 2 on if(ir.value==IR_8&&menu>3){menu2=100;gr1=0;gr2=0;menu=0;cl();time=millis();w=1;w2=1;}// menu2 off } if(ir.value==IR_7&&power==0){power=1;mute=1;audio();gr1=0;gr2=0;cl();lcd.setCursor(0,0);lcd.print(" POWER OFF ");w=0;menu=100;menu2=100;delay(3000);lcd.noBacklight();}// power off if(ir.value==IR_7&&power==1){power=0;mute=0;audio();gr1=0;gr2=0;lcd.backlight();cl();lcd.setCursor(0,0);lcd.print(" POWER ON ");menu=0;time=millis();w=1;w2=1;myEnc.write(0);delay(3000);lcd.clear();}// power on /////////////////////////////// VOLUME -79 ... +15 дБ //////////////////////////////////////////////// if(menu==0){ if(ir.value==IR_3){vol++;gr1=1;gr2=0;cl1();w2=1;vol_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){vol++;gr2=0;cl1();w2=1;vol_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){vol--;gr1=0;gr2=1;cl1();w2=1;vol_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){vol--;gr1=0;cl1();w2=1;vol_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition){oldPosition = newPosition; vol=vol+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;vol_func();audio();} lcd.setCursor(0,0);lcd.print("VOLUME "); lcd.print(" ");lcd.print(vol);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");vol_d=vol/2+40; if(w2==1){ for(z=0,z0=0,z1=0;z<=vol_d;z++,z1++){if(z1>2){z1=0;z0++;} if(z1==1){lcd.setCursor(z0,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1,1);lcd.print(" ");}} if(z1==3){lcd.setCursor(z0,1);lcd.write((uint8_t)1);} if(z1==2){lcd.setCursor(z0,1);lcd.write((uint8_t)2);}w2=0;}} ///////////////////////// TREBLE +/-20 dB ///////////////////////////////////////////////////////// if(menu==1){ if(ir.value==IR_3){treb++;gr1=1;gr2=0;cl1();w2=1;treb_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){treb++;gr2=0;cl1();w2=1;treb_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){treb--;gr1=0;gr2=1;cl1();w2=1;treb_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){treb--;gr1=0;cl1();w2=1;treb_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; treb=treb+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;treb_func();audio();} lcd.setCursor(0,0);lcd.print("TREBLE "); lcd.print(" ");lcd.print(treb);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");treb_d=treb+15; if(w2==1){ for(z=0,z0=0,z1=0;z<=treb_d;z++,z1++){if(z1>2){z1=0;z0++;} if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print(" ");}} if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);} if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w2=0;}} /////////////////////////// MIDDLE +/-20 dB //////////////////////////////////////////////////////// if(menu==2){ if(ir.value==IR_3){middle++;gr1=1;gr2=0;cl1();w2=1;middle_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){middle++;gr2=0;cl1();w2=1;middle_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){middle--;gr1=0;gr2=1;cl1();w2=1;middle_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){middle--;gr1=0;cl1();w2=1;middle_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; middle=middle+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;middle_func();audio();} lcd.setCursor(0,0);lcd.print("MIDDLE "); lcd.print(" ");lcd.print(middle);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");middle_d=middle+15; if(w2==1){ for(z=0,z0=0,z1=0;z<=middle_d;z++,z1++){if(z1>2){z1=0;z0++;} if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print(" ");}} if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);} if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w2=0;}} /////////////////////// BASS +/-20 dB /////////////////////////////////////////////////////////// if(menu==3){ if(ir.value==IR_3){bass++;gr1=1;gr2=0;cl1();w2=1;bass_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){bass++;gr2=0;cl1();w2=1;bass_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){bass--;gr1=0;gr2=1;cl1();w2=1;bass_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){bass--;gr1=0;cl1();w2=1;bass_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; bass=bass+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;bass_func();audio();} lcd.setCursor(0,0);lcd.print("BASS "); lcd.print(" ");lcd.print(bass);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");bass_d=bass+15; if(w2==1){ for(z=0,z0=0,z1=0;z<=bass_d;z++,z1++){if(z1>2){z1=0;z0++;} if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print(" ");}} if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);} if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w2=0;}} ////////////////////////// MENU 2 ////////////////////////////////////////////////////////////////////// //////////////// IN + GAIN ///////////////////////////////////////////////////////////// if(menu2==0){ switch(in){ case 0: gain0 = gain1;break; case 1: gain0 = gain2;break; case 2: gain0 = gain3;break; } if(ir.value==IR_3){gain0++;gr1=1;gr2=0;cl1();w2=1;gain_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){gain0++;gr2=0;cl1();w2=1;gain_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){gain0--;gr1=0;gr2=1;cl1();w2=1;gain_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){gain0--;gr1=0;cl1();w2=1;gain_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; gain0=gain0+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;gain_func();audio();} switch(in){ case 0: gain1 = gain0;break; case 1: gain2 = gain0;break; case 2: gain3 = gain0;break; } if(www==1){audio();www=0;} lcd.setCursor(0,0);lcd.print("Gain IN ");lcd.print(in+1); lcd.setCursor(10,0);lcd.print(" ");lcd.print(gain0);lcd.print(" ");lcd.setCursor(14,0);lcd.print("dB");gain_d=gain0*2; if(w2==1){ for(z=0,z0=0,z1=0;z<=gain_d;z++,z1++){if(z1>2){z1=0;z0++;} if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print(" ");}} if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);} if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}}w2=0;} ////////////////////////////// loudness //////////////////////////////////////////////////// if(menu2==1){ if(ir.value==IR_3){lon_f++;gr1=1;gr2=0;cl1();w2=1;lon_f_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){lon_f++;gr2=0;cl1();w2=1;lon_f_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){lon_f--;gr1=0;gr2=1;cl1();w2=1;lon_f_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){lon_f--;gr1=0;cl1();w2=1;lon_f_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; lon_f=lon_f+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;lon_f_func();audio();} lcd.setCursor(0,0);lcd.print("Loudness: "); switch(lon_f){ case 0: lcd.print("400Hz ");break; case 1: lcd.print("800Hz ");break; case 2: lcd.print("2.4kHz");break; case 3: lcd.print("FLAT ");break;}} //////////////////////////// loudness gain //////////////////////////////////////////////// if(menu2==2){ if(ir.value==IR_3){lon++;gr1=1;gr2=0;cl1();w2=1;lon_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){lon++;gr2=0;cl1();w2=1;lon_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){lon--;gr1=0;gr2=1;cl1();w2=1;lon_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){lon--;gr1=0;cl1();w2=1;lon_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; lon=lon+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;lon_func();audio();} lcd.setCursor(0,0);lcd.print("Loud gain"); lcd.print(" ");lcd.print(lon);lcd.print(" ");lcd.setCursor(13,0);lcd.print("dB");lon_d=lon*2; if(w2==1){ for(z=0,z0=0,z1=0;z<=lon_d;z++,z1++){if(z1>2){z1=0;z0++;} if(z1==1){lcd.setCursor(z0+3,1);lcd.write((uint8_t)0);lcd.setCursor(z0+1+3,1);lcd.print(" ");}} if(z1==3){lcd.setCursor(z0+3,1);lcd.write((uint8_t)1);} if(z1==2){lcd.setCursor(z0+3,1);lcd.write((uint8_t)2);}w2=0;}} ////////////////////////////////////////// out ///////////////////////////////////////////////// if(menu2==3){ if(digitalRead(2)==HIGH){out++;cl();time=millis();www=1;w=1;if(out>5){out=0;}audio();} // перебор выходов кнопкой IN if(ir.value==IR_5){out++;cl();time=millis();www=1;w=1;if(out>5){out=0;}audio();} // перебор выходов кнопкой IN switch(out){ case 0:vol_out=rf;break; case 1:vol_out=lf;break; case 2:vol_out=rt;break; case 3:vol_out=lt;break; case 4:vol_out=sab1;break; case 5:vol_out=sab2;break; } if(ir.value==IR_3){vol_out++;gr1=1;gr2=0;cl1();w2=1;vol_out_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){vol_out++;gr2=0;cl1();w2=1;vol_out_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){vol_out--;gr1=0;gr2=1;cl1();w2=1;vol_out_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){vol_out--;gr1=0;cl1();w2=1;vol_out_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; vol_out=vol_out+newPosition;myEnc.write(0);newPosition=0;time=millis();www=1;w=1;w2=1;vol_out_func();audio();} lcd.setCursor(0,0);lcd.print("Volume OUT");lcd.setCursor(0,1); switch(out){ case 0:rf=vol_out;lcd.print("RF: ");lcd.print(rf);break; case 1:lf=vol_out;lcd.print("LF: ");lcd.print(lf);break; case 2:rt=vol_out;lcd.print("RT: ");lcd.print(rt);break; case 3:lt=vol_out;lcd.print("LT: ");lcd.print(lt);break; case 4:sab1=vol_out;lcd.print("SUBW_1: ");lcd.print(sab1);break; case 5:sab2=vol_out;lcd.print("SUBW_2: ");lcd.print(sab2);break; } if(www==1){audio();www=0;} lcd.print(" dB ");} /////////////////////////////////treble center////////////////////////////////////////////////// if(menu2==4){ if(ir.value==IR_3){treb_c++;gr1=1;gr2=0;cl1();w2=1;treb_c_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){treb_c++;gr2=0;cl1();w2=1;treb_c_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){treb_c--;gr1=0;gr2=1;cl1();w2=1;treb_c_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){treb_c--;gr1=0;cl1();w2=1;treb_c_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; treb_c=treb_c+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;treb_c_func();audio();} lcd.setCursor(0,0);lcd.print("Treble Center "); lcd.setCursor(1,6); switch(treb_c){ case 0: lcd.print(" 7.5 kHz");break; case 1: lcd.print("10.0 kHz");break; case 2: lcd.print("12.5 kHz");break; case 3: lcd.print("15.0 kHz");break;}} /////////////////////////////////middle center////////////////////////////////////////////////// if(menu2==5){ if(ir.value==IR_3){mid_c++;gr1=1;gr2=0;cl1();w2=1;mid_c_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){mid_c++;gr2=0;cl1();w2=1;mid_c_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){mid_c--;gr1=0;gr2=1;cl1();w2=1;mid_c_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){mid_c--;gr1=0;cl1();w2=1;mid_c_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; mid_c=mid_c+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;mid_c_func();audio();} lcd.setCursor(0,0);lcd.print("Middle Center "); lcd.setCursor(1,6); switch(mid_c){ case 0: lcd.print("0.5 kHz");break; case 1: lcd.print("1.0 kHz");break; case 2: lcd.print("1.5 kHz");break; case 3: lcd.print("2.5 kHz");break;}} ////////////////////////////////////bass center/////////////////////////////////////////// if(menu2==6){ if(ir.value==IR_3){bas_c++;gr1=1;gr2=0;cl1();w2=1;bas_c_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){bas_c++;gr2=0;cl1();w2=1;bas_c_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){bas_c--;gr1=0;gr2=1;cl1();w2=1;bas_c_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){bas_c--;gr1=0;cl1();w2=1;bas_c_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; bas_c=bas_c+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;bas_c_func();audio();} lcd.setCursor(0,0);lcd.print("Bass Center "); lcd.setCursor(1,6); switch(bas_c){ case 0: lcd.print("60 Hz ");break; case 1: lcd.print("80 Hz ");break; case 2: lcd.print("100 Hz");break; case 3: lcd.print("120 Hz");break;}} //////////////////////////////////////subw//////////////////////////////////////////////// if(menu2==7){ if(ir.value==IR_3){sab_f++;gr1=1;gr2=0;cl1();w2=1;sab_f_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){sab_f++;gr2=0;cl1();w2=1;sab_f_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){sab_f--;gr1=0;gr2=1;cl1();w2=1;sab_f_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){sab_f--;gr1=0;cl1();w2=1;sab_f_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; sab_f=sab_f+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;sab_f_func();audio();} lcd.setCursor(0,0);lcd.print("Subwoofer Freq."); lcd.setCursor(1,6); switch(sab_f){ case 0: lcd.print("FLAT ");break; case 1: lcd.print("55 Hz ");break; case 2: lcd.print("85 Hz ");break; case 3: lcd.print("120 Hz");break; case 4: lcd.print("160 Hz");break;}} /////////////////////////////////treble Q////////////////////////////////////////////////// if(menu2==8){ if(ir.value==IR_3){treb_q++;gr1=1;gr2=0;cl1();w2=1;treb_q_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){treb_q++;gr2=0;cl1();w2=1;treb_q_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){treb_q--;gr1=0;gr2=1;cl1();w2=1;treb_q_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){treb_q--;gr1=0;cl1();w2=1;treb_q_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; treb_q=treb_q+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;treb_q_func();audio();} lcd.setCursor(0,0);lcd.print("Treble Q "); lcd.setCursor(1,6); switch(treb_q){ case 0: lcd.print("0.75");break; case 1: lcd.print("1.25");break;}} /////////////////////////////////middle Q////////////////////////////////////////////////// if(menu2==9){ if(ir.value==IR_3){mid_q++;gr1=1;gr2=0;cl1();w2=1;mid_q_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){mid_q++;gr2=0;cl1();w2=1;mid_q_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){mid_q--;gr1=0;gr2=1;cl1();w2=1;mid_q_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){mid_q--;gr1=0;cl1();w2=1;mid_q_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; mid_q=mid_q+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;mid_q_func();audio();} lcd.setCursor(0,0);lcd.print("Middle Q "); lcd.setCursor(1,6); switch(mid_q){ case 0: lcd.print("0.75");break; case 1: lcd.print("1.00");break; case 2: lcd.print("1.25");break; case 3: lcd.print("1.50");break;}} /////////////////////////////////bass Q////////////////////////////////////////////////// if(menu2==10){ if(ir.value==IR_3){bas_q++;gr1=1;gr2=0;cl1();w2=1;bas_q_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){bas_q++;gr2=0;cl1();w2=1;bas_q_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){bas_q--;gr1=0;gr2=1;cl1();w2=1;bas_q_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){bas_q--;gr1=0;cl1();w2=1;bas_q_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; bas_q=bas_q+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;bas_q_func();audio();} lcd.setCursor(0,0);lcd.print("Bass Q "); lcd.setCursor(1,6); switch(bas_q){ case 0: lcd.print("0.5");break; case 1: lcd.print("1.0");break; case 2: lcd.print("1.5");break; case 3: lcd.print("2.0");break;}} /////////////////////////////////LPF Phase////////////////////////////////////////////////// if(menu2==11){ if(ir.value==IR_3){faza++;gr1=1;gr2=0;cl1();w2=1;faza_func();audio();}// кнопка > if(ir.value==0xFFFFFFFF and gr1==1){faza++;gr2=0;cl1();w2=1;faza_func();audio();}// кнопка >>>>>> if(ir.value==IR_4){faza--;gr1=0;gr2=1;cl1();w2=1;faza_func();audio();}// кнопка < if(ir.value==0xFFFFFFFF and gr2==1){faza--;gr1=0;cl1();w2=1;faza_func();audio();}// кнопка <<<<<< if (newPosition != oldPosition) { oldPosition = newPosition; faza=faza+newPosition;myEnc.write(0);newPosition=0;time=millis();w=1;w2=1;faza_func();audio();} lcd.setCursor(0,0);lcd.print("LPF Phase "); lcd.setCursor(1,6); switch(faza){ case 0: lcd.print(" 0");break; case 1: lcd.print("180");break;}} ///////////////////// EEPROM /////////////////////////////////////////////////////////////// if(millis()-time>10000 && w==1 && power==0){ EEPROM.update(0,vol+79);EEPROM.update(1,treb+15);EEPROM.update(2,middle+15);EEPROM.update(3,bass+15);EEPROM.update(4,in); EEPROM.update(5,gain1);EEPROM.update(6,gain2);EEPROM.update(7,gain3); EEPROM.update(8,lon);EEPROM.update(9,lon_f); EEPROM.update(10,rf+79);EEPROM.update(11,lf+79);EEPROM.update(12,rt+79);EEPROM.update(13,lt+79);EEPROM.update(14,sab1+79);EEPROM.update(24,sab2+79); EEPROM.update(15,treb_c);EEPROM.update(16,mid_c);EEPROM.update(17,bas_c);EEPROM.update(18,sab_f);EEPROM.update(19,treb_q); EEPROM.update(20,mid_q);EEPROM.update(21,bas_q);EEPROM.update(22,faza); menu2=100;menu=0;w=0;w2=1;cl();} }//loop void faza_func(){if(faza>1){faza=0;}if(faza<0){faza=1;}} void bas_q_func(){if(bas_q>3){bas_q=0;}if(bas_q<0){bas_q=3;}} void mid_q_func(){if(mid_q>3){mid_q=0;}if(mid_q<0){mid_q=3;}} void treb_q_func(){if(treb_q>1){treb_q=0;}if(treb_q<0){treb_q=1;}} void sab_f_func(){if(sab_f>4){sab_f=0;}if(sab_f<0){sab_f=4;}} void bas_c_func(){if(bas_c>3){bas_c=0;}if(bas_c<0){bas_c=3;}} void mid_c_func(){if(mid_c>3){mid_c=0;}if(mid_c<0){mid_c=3;}} void treb_c_func(){if(treb_c>3){treb_c=0;}if(treb_c<0){treb_c=3;}} void vol_out_func(){if(vol_out>15){vol_out=15;}if(vol_out<-79){vol_out=-79;}} void lon_func(){if(lon>15){lon=15;}if(lon<0){lon=0;}} void lon_f_func(){if(lon_f>3){lon_f=0;}if(lon_f<0){lon_f=3;}} void gain_func(){if(gain0<0){gain0=0;}if(gain0>16){gain0=16;}} void bass_func(){if(bass>15){bass=15;}if(bass<-15){bass=-15;}} void middle_func(){if(middle>15){middle=15;}if(middle<-15){middle=-15;}} void treb_func(){if(treb>15){treb=15;}if(treb<-15){treb=-15;}} void vol_func(){if(vol<-79){vol=-79;}if(vol>15){vol=15;}} void cl(){ir.value=0;delay(300);lcd.clear();} void cl1(){ir.value=0;delay(100);} void to_Timer(){newPosition = myEnc.read()/4;} void audio(){ tda.setInitial(); tda.setSub_setup(sab_f,3,faza); // off 55hz 85hz 120hz 160hz pass = int sub_f(0...5) || LPF front rear sub = int sub_out(0...3) 0 - default || 0 180 = int faza(0...1) tda.setLoud_f(3,lon_f,1,1); // mix_in 0...3 (3=OFF) || 400hz 800hz 2400hz Prohibition = int loud_f(0...3) || MIXING 1ch 2ch -- on off = mix_ch1(0...1) mix_ch2 (0..1) tda.setIn(in); // in1 in2 in3 = int in(0...2) tda.setIn_gain(gain0,mute); // 0...16 dB = int in_gain(0...16) || off on = int mute(0...1) tda.setVol(vol); // -79...+15 dB = int vol(-79...15) tda.setFront_1(rf); // -79...+15 dB = int -79...15 tda.setFront_2(lf); // -79...+15 dB = int -79...15 tda.setRear_1(rt); // -79...+15 dB = int -79...15 tda.setRear_2(lt); // -79...+15 dB = int -79...15 tda.setSub1(sab1); // -79...+15 dB = int -79...15 tda.setSub2(sab2); // -79...+15 dB = int -79...15 tda.setBass_setup(bas_q,bas_c); // 0.5 1.0 1.5 2.0 --- int 0...3, 60Hz 80Hz 100Hz 120Hz --- int 0...3 tda.setMiddle_setup(mid_q,mid_c); // 0.75 1.0 1.25 1.5 --- int 0...3, 500Hz 1kHz 1.5kHz 2.5kHz --- int 0...3 tda.setTreble_setup(treb_q,treb_c); // 0.75 1.25 --- int 0...1, 7.5kHz 10kHz 12.5kHz 15kHz --- int 0...3 tda.setBass_gain(bass); // --15 ... +15 dB = int -15 ... 15 tda.setMiddle_gain(middle); // --15 ... +15 dB = int -15 ... 15 tda.setTreble_gain(treb); // --15 ... +15 dB = int -15 ... 15 tda.setLoudness_gain(lon); // 0 ... 15 dB = int 0 ... 15 }
Форум — http://forum.rcl-radio.ru/viewtopic.php?id=53
Библиотеки — http://forum.rcl-radio.ru/viewtopic.php?pid=308#p308
Dear Sir,
can you make the same design with ROHM BD34701KS2.Iam want to make a 5.1 channel preamplifier with OLED display and rotary encoder with bluetooth. your example will help my design. Also i want to register in the forum but iam not able to register myself. kindly help.
I don’t have these components.
thank you for your reply. but please try in future if u can. Iam an electronics hobbyist and pretty new in this i just wanted to ask you if u can advice me. what kind of capacitors can i use for non polarized capacitors shown in the BD37033 circuit diagram. ceramic capacitor or film capacitor or any other suggestion ? can i use polarized aluminum electrolytic capacitor? if yes, which side should i place the positive pin of the capacitor. Thanks in Advance. Wish You a happy & prosperous New year.
At the input and output, you can use film capacitors with a capacity of 1 UF
That 1uf and 10uf are showing polarized capacitor. so iam using aluminum electrolytic capacitor. Iam asking for that 100nf capacitor which has no polarity.
10 nF is very small, at least 1 UF, if there is no such capacitor, it is better to use polar capacitors, plus the capacitor is always directed to the chip
pfa