Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

buzzer connection with at89c51

Status
Not open for further replies.

tsea

Member level 2
Joined
Jul 25, 2011
Messages
50
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Location
India
Activity points
1,826
hello friends... i am using a buzzer in my project. i want it to produce sound when the incoming voltage from a sensor(through ADC) exceeds a particular value and stop when that voltage gets reduced below that threshold value. i have been searching on net for buzzer connection to MCU(at89c51) from yesterday and came across another thread on this same board https://www.edaboard.com/thread229158.html . i have also connected my buzzer in same way but i used a dc source of +12V to my buzzer(firstly is that correct???? as using the same power source that is given the diagram in that thread,i could not turn on my buzzer so i just randomly put there a dc +12V source and it worked).but now the problem is that it keeps producing sound whether i give the corresponding pin of MCU a high or a low that i couldn't understand. please help me in this and also tell me the correct connections and that whether it is required to clear or set the corresponding pin of MCU to turn on buzzer and how much supply voltage does buzzer require.my buzzer look like this
thanks in advance.
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
Use this circuit:


Your buzzer will probably work from a range of voltages. 5V should be enough. 12V should be okay too.

Hope this helps.
Tahmid.
 
  • Like
Reactions: Navgun and tsea

    tsea

    points: 2
    Helpful Answer Positive Rating

    Navgun

    points: 2
    Helpful Answer Positive Rating

tsea

Member level 2
Joined
Jul 25, 2011
Messages
50
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Location
India
Activity points
1,826
thanks for the reply tahmid.... then to turn off the buzzer,what value should I send to microcontroller's pin....a high or a low??...or is there some other way to turn off it..??
in my one similar circuit(using uln2803) once buzzer starts it keeps sounding...and whatever value I send to uC's pin(to turn it off) has no effect on buzzer's operation.....what should I do to turn It off..?? also it starts sounding soon I turn on the simulation, no matter there is a high or low in corresponding pin of uC and then keeps sounding forever. other people also, please give your valuable replies .thanks In advance
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
You have to send 0 to buzzer to turn OFF buzzer, and 1 to turn ON buzzer.
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
thanks for the reply tahmid.... then to turn off the buzzer,what value should I send to microcontroller's pin....a high or a low??...or is there some other way to turn off it..??
To turn buzzer on, send 1 to the base of the transistor.
To turn buzzer off, send 0 to the base of the transistor.

in my one similar circuit(using uln2803) once buzzer starts it keeps sounding...and whatever value I send to uC's pin(to turn it off) has no effect on buzzer's operation.....what should I do to turn It off..?? also it starts sounding soon I turn on the simulation, no matter there is a high or low in corresponding pin of uC and then keeps sounding forever. other people also, please give your valuable replies .thanks In advance
Upload the circuit diagram.
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
If you are using 2N2222 transistor in proteus simulation, it has problems. It is always turned ON.
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Yes there is problem with my proteus 2n2222. That's why I use 2n2222a part in proteus. I have checked that. I use Proteus 7.10 SP0.
 

Attachments


Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
@ Tahmid

Can you zip and post your proteus models and library folders. Some of my proteus parts doesn't work properly.
 

tsea

Member level 2
Joined
Jul 25, 2011
Messages
50
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,298
Location
India
Activity points
1,826
thanks for the replies friends, actually my design which keeps producing sound was with connecting the buzzer through uln2803 ic. but now when I connected in the same manner as suggested by tahmid...it gives no sound at all.. I don't know where I did mistake but I just connected it to P2.0 of uC and set that bit in my code...but no response..i am posting simulation image here.. please help...
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Double click buzzer and set its voltage as 5V and not 12V. I checked that proteus BC547 is not working, So use 2N2222A Part in Proteus instead of BC547.
 

    V

    points: 2
    Helpful Answer Positive Rating

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
Double click on the buzzer. Change voltage to 5V as you are working with 5V in your circuit. Change the resistance of the buzzer to 1200 instead of 12.

There isn't supposed to be any problem with the BC547. It works fine for me.
 
  • Like
Reactions: adwait.pande

    V

    points: 2
    Helpful Answer Positive Rating

    adwait.pande

    points: 2
    Helpful Answer Positive Rating
Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
@ Tahmid

BC547 doesn't work for me. See the video there is no sound coming from buzzer.
 

Attachments


    V

    points: 2
    Helpful Answer Positive Rating
Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Ye. It worked. What happens when resistance is increase to 1200 Ohms?
 

    V

    points: 2
    Helpful Answer Positive Rating

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
If resistance is increased, current is decreased. BC547 is rated at 100mA.

When resistance of buzzer = 12Ω, current is (5/12)A = 0.417A = 417mA.

When resistance of buzzer = 1200Ω, current is (5/1200)A = 0.00417A = 4.17mA

I assumed that the transistor does not drop any voltage. Even though it does, the above points explain why it's okay when the resistance of buzzer is increased to 1200Ω.

Place a voltmeter across the transistor collector-emitter and another across the buzzer. Adjust the values of the buzzer resistance. Experiment and see what happens.
 

    V

    points: 2
    Helpful Answer Positive Rating
Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Actully I want to know why the buzzer worked when I used 1200 Ohm resistor and reducing the current to buzzer. More current to buzzer means it should sound loud. Isn't it?
 

    V

    points: 2
    Helpful Answer Positive Rating

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
But the transistor can't take the more current. BC547 is rated to withstand 100mA. You can't sink more current with BC547. But that is what you're attempting to do when resistance = 12Ω.
 

    V

    points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top