problems with the connections in a buzzer, IR, potenciometer project

hello i have a problem, i dont know how to connect a potentiometer, a IR sensor and 2 buzzers, i think is a lot of voltage and i dont know how to make it work,
here is the code and a photo of how i thought it could work,thanks a lot

int buzzer = 6;
int buzzer2 = 5;
int irSensor = 0;
int potSensor = 1;
int valPot;
int valIR;

void setup(){
Serial.begin(9600);
pinMode(buzzer , OUTPUT);
pinMode(buzzer2 , OUTPUT);
pinMode(irSensor, INPUT);
pinMode(potSensor, INPUT);
}

void loop(){
valIR= analogRead(irSensor);
valIR= valIR*5/1024 ;
valPot= analogRead(potSensor);

tone( buzzer, irSensor, potSensor);
tone(buzzer2, potSensor, irSensor);

Serial.println("Potenciometro= ");
Serial.println(valPot);
Serial.println("Proximidad= ");
Serial.println(valIR);
delay(1000);

Note that the standard tone() function can only play a tone on one pin at a time. To play tones on two pins you need to download a more capable tone library.

thanks man, i didnt know that, but i will search it, and how you look the wiring? i connected all this and it started to smell like if the board was burning, and i disconected all, what it could be, or how can i fix that??

i connected all this and it started to smell like if the board was burning, and i disconected all, what it could be ...

Your potentiometer is connected incorrectly. After you buy a new one connect the end terminals to the power and connect the center terminal to the Arduino.

Don