8 channel quiz buzzer circuit using 8051 microcontrollerBaud-rate for 8051 MicrocontrollerAVR Button Interfacing8051 Microcontroller & OscillatorBuzzer Driver CircuitDetecting Switch input in ARM 7 and multiplexing two seven segment displaysCountdown Timer on Switch Input ARM 7PIC16F1783 Inclinometer Project using Accelerometer 12-bit ADC issueUsing timers 8051 Assembly MicrocontrollerCan this circuit validate AT89Cx051 micro if best valued components are used?

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

What do you call a Matrix-like slowdown and camera movement effect?

Can I interfere when another PC is about to be attacked?

TGV timetables / schedules?

Prevent a directory in /tmp from being deleted

A Journey Through Space and Time

Japan - Plan around max visa duration

What is the command to reset a PC without deleting any files

Why is "Reports" in sentence down without "The"

Copenhagen passport control - US citizen

The use of multiple foreign keys on same column in SQL Server

Is Social Media Science Fiction?

What would the Romans have called "sorcery"?

How much RAM could one put in a typical 80386 setup?

Why is this code 6.5x slower with optimizations enabled?

How does one intimidate enemies without having the capacity for violence?

Circuitry of TV splitters

New order #4: World

Banach space and Hilbert space topology

Are tax years 2016 & 2017 back taxes deductible for tax year 2018?

I see my dog run

Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)

N.B. ligature in Latex

Why are 150k or 200k jobs considered good when there are 300k+ births a month?



8 channel quiz buzzer circuit using 8051 microcontroller


Baud-rate for 8051 MicrocontrollerAVR Button Interfacing8051 Microcontroller & OscillatorBuzzer Driver CircuitDetecting Switch input in ARM 7 and multiplexing two seven segment displaysCountdown Timer on Switch Input ARM 7PIC16F1783 Inclinometer Project using Accelerometer 12-bit ADC issueUsing timers 8051 Assembly MicrocontrollerCan this circuit validate AT89Cx051 micro if best valued components are used?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3












$begingroup$


Project: 8 channel quiz buzzer circuit using 8051 microcontroller from this site.



For the first candidate who presses their button, their number will show on the 7-segment display and the buzzer will make a sound.I am using peizo-buzzer in the circuit.



After making all the connections, the display is working but the buzzer is not making any sound. Buzzer delay time in code in 1ms. When we give direct 5V supply to the buzzer it works, but not in the circuit.



Please give me some solution for this.



circuit diagram



#include<reg51.h>

#define SEGMENT P2 // PORT2 to Segments of 7-Segment Display
#define SWITCH P1 // Input Switches (buttons) to PORT1

sbit buzz=P3^0; // Buzzer
sbit rst=P3^3; // Reset Switch (Reset the display) - not the microcontroller
sbit digit=P3^7; // 7-Segment Display Common Pin (to enable)


void delay (int); // Delay function

int x=0,y,z;
unsigned char ch[]=0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98; // Hexadecimal values from 0 to 9.

void delay (int d)

unsigned char i;
for(;d>0;d--)

for(i=250;i>0;i--);
for(i=248;i>0;i--);



void main()

SWITCH=0xff;
SEGMENT=0xff;
digit=1;
buzz=0;
rst=1;

while(1)

while(SWITCH==0xff); // wait until any button is pressed.

while (SWITCH==0xfe) // Button 1 is pressed.

SEGMENT=ch[1];
buzz=1;
delay(1000); // Activate buzzer for 1 second.
buzz=0;
while(rst!=0); // display the digit until the reset is pressed.


while (SWITCH==0xfd) // Button 2 is pressed.

SEGMENT=ch[2];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xfb) // Button 3 is pressed.

SEGMENT=ch[3];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xf7) // Button 4 is pressed.

SEGMENT=ch[4];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xef) // Button 5 is pressed.

SEGMENT=ch[5];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xdf) // Button 6 is pressed.

SEGMENT=ch[6];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xbf) // Button 7 is pressed.

SEGMENT=ch[7];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0x7f) // Button 8 is pressed.

SEGMENT=ch[8];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


SEGMENT=0xff;
rst=1;












share|improve this question











$endgroup$







  • 1




    $begingroup$
    it sounds like the microcontroller output is too weak to drive the buzzer, measure the voltage on the buzzer
    $endgroup$
    – Jasen
    Mar 27 at 8:19






  • 2




    $begingroup$
    Can you remove disconnect the resistor from pin 10 of the AT89C51 and drive it manually with 5V? (P.S. do use reference names as well for components, it is easier to refer to them that way)
    $endgroup$
    – Huisman
    Mar 27 at 8:58







  • 1




    $begingroup$
    P3^3 What language is this? It is nonsense in C, ^ being the bitwise XOR operator.
    $endgroup$
    – Lundin
    Mar 27 at 9:07






  • 3




    $begingroup$
    @Lundin It is no nonsense. Please read keil.com/support/man/docs/c51/c51_le_sbit.htm
    $endgroup$
    – Huisman
    Mar 27 at 9:23






  • 1




    $begingroup$
    @Huisman Of course it is nonsense in C, since the ^ operator is already taken and perfectly valid to use inside an initializer. This is clearly not valid C but non-standard extensions. There are of course many other reasons why Keil has such a bad reputation, this is just one of them.
    $endgroup$
    – Lundin
    Mar 27 at 9:39


















3












$begingroup$


Project: 8 channel quiz buzzer circuit using 8051 microcontroller from this site.



For the first candidate who presses their button, their number will show on the 7-segment display and the buzzer will make a sound.I am using peizo-buzzer in the circuit.



After making all the connections, the display is working but the buzzer is not making any sound. Buzzer delay time in code in 1ms. When we give direct 5V supply to the buzzer it works, but not in the circuit.



Please give me some solution for this.



circuit diagram



#include<reg51.h>

#define SEGMENT P2 // PORT2 to Segments of 7-Segment Display
#define SWITCH P1 // Input Switches (buttons) to PORT1

sbit buzz=P3^0; // Buzzer
sbit rst=P3^3; // Reset Switch (Reset the display) - not the microcontroller
sbit digit=P3^7; // 7-Segment Display Common Pin (to enable)


void delay (int); // Delay function

int x=0,y,z;
unsigned char ch[]=0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98; // Hexadecimal values from 0 to 9.

void delay (int d)

unsigned char i;
for(;d>0;d--)

for(i=250;i>0;i--);
for(i=248;i>0;i--);



void main()

SWITCH=0xff;
SEGMENT=0xff;
digit=1;
buzz=0;
rst=1;

while(1)

while(SWITCH==0xff); // wait until any button is pressed.

while (SWITCH==0xfe) // Button 1 is pressed.

SEGMENT=ch[1];
buzz=1;
delay(1000); // Activate buzzer for 1 second.
buzz=0;
while(rst!=0); // display the digit until the reset is pressed.


while (SWITCH==0xfd) // Button 2 is pressed.

SEGMENT=ch[2];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xfb) // Button 3 is pressed.

SEGMENT=ch[3];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xf7) // Button 4 is pressed.

SEGMENT=ch[4];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xef) // Button 5 is pressed.

SEGMENT=ch[5];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xdf) // Button 6 is pressed.

SEGMENT=ch[6];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xbf) // Button 7 is pressed.

SEGMENT=ch[7];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0x7f) // Button 8 is pressed.

SEGMENT=ch[8];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


SEGMENT=0xff;
rst=1;












share|improve this question











$endgroup$







  • 1




    $begingroup$
    it sounds like the microcontroller output is too weak to drive the buzzer, measure the voltage on the buzzer
    $endgroup$
    – Jasen
    Mar 27 at 8:19






  • 2




    $begingroup$
    Can you remove disconnect the resistor from pin 10 of the AT89C51 and drive it manually with 5V? (P.S. do use reference names as well for components, it is easier to refer to them that way)
    $endgroup$
    – Huisman
    Mar 27 at 8:58







  • 1




    $begingroup$
    P3^3 What language is this? It is nonsense in C, ^ being the bitwise XOR operator.
    $endgroup$
    – Lundin
    Mar 27 at 9:07






  • 3




    $begingroup$
    @Lundin It is no nonsense. Please read keil.com/support/man/docs/c51/c51_le_sbit.htm
    $endgroup$
    – Huisman
    Mar 27 at 9:23






  • 1




    $begingroup$
    @Huisman Of course it is nonsense in C, since the ^ operator is already taken and perfectly valid to use inside an initializer. This is clearly not valid C but non-standard extensions. There are of course many other reasons why Keil has such a bad reputation, this is just one of them.
    $endgroup$
    – Lundin
    Mar 27 at 9:39














3












3








3





$begingroup$


Project: 8 channel quiz buzzer circuit using 8051 microcontroller from this site.



For the first candidate who presses their button, their number will show on the 7-segment display and the buzzer will make a sound.I am using peizo-buzzer in the circuit.



After making all the connections, the display is working but the buzzer is not making any sound. Buzzer delay time in code in 1ms. When we give direct 5V supply to the buzzer it works, but not in the circuit.



Please give me some solution for this.



circuit diagram



#include<reg51.h>

#define SEGMENT P2 // PORT2 to Segments of 7-Segment Display
#define SWITCH P1 // Input Switches (buttons) to PORT1

sbit buzz=P3^0; // Buzzer
sbit rst=P3^3; // Reset Switch (Reset the display) - not the microcontroller
sbit digit=P3^7; // 7-Segment Display Common Pin (to enable)


void delay (int); // Delay function

int x=0,y,z;
unsigned char ch[]=0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98; // Hexadecimal values from 0 to 9.

void delay (int d)

unsigned char i;
for(;d>0;d--)

for(i=250;i>0;i--);
for(i=248;i>0;i--);



void main()

SWITCH=0xff;
SEGMENT=0xff;
digit=1;
buzz=0;
rst=1;

while(1)

while(SWITCH==0xff); // wait until any button is pressed.

while (SWITCH==0xfe) // Button 1 is pressed.

SEGMENT=ch[1];
buzz=1;
delay(1000); // Activate buzzer for 1 second.
buzz=0;
while(rst!=0); // display the digit until the reset is pressed.


while (SWITCH==0xfd) // Button 2 is pressed.

SEGMENT=ch[2];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xfb) // Button 3 is pressed.

SEGMENT=ch[3];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xf7) // Button 4 is pressed.

SEGMENT=ch[4];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xef) // Button 5 is pressed.

SEGMENT=ch[5];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xdf) // Button 6 is pressed.

SEGMENT=ch[6];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xbf) // Button 7 is pressed.

SEGMENT=ch[7];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0x7f) // Button 8 is pressed.

SEGMENT=ch[8];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


SEGMENT=0xff;
rst=1;












share|improve this question











$endgroup$




Project: 8 channel quiz buzzer circuit using 8051 microcontroller from this site.



For the first candidate who presses their button, their number will show on the 7-segment display and the buzzer will make a sound.I am using peizo-buzzer in the circuit.



After making all the connections, the display is working but the buzzer is not making any sound. Buzzer delay time in code in 1ms. When we give direct 5V supply to the buzzer it works, but not in the circuit.



Please give me some solution for this.



circuit diagram



#include<reg51.h>

#define SEGMENT P2 // PORT2 to Segments of 7-Segment Display
#define SWITCH P1 // Input Switches (buttons) to PORT1

sbit buzz=P3^0; // Buzzer
sbit rst=P3^3; // Reset Switch (Reset the display) - not the microcontroller
sbit digit=P3^7; // 7-Segment Display Common Pin (to enable)


void delay (int); // Delay function

int x=0,y,z;
unsigned char ch[]=0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x98; // Hexadecimal values from 0 to 9.

void delay (int d)

unsigned char i;
for(;d>0;d--)

for(i=250;i>0;i--);
for(i=248;i>0;i--);



void main()

SWITCH=0xff;
SEGMENT=0xff;
digit=1;
buzz=0;
rst=1;

while(1)

while(SWITCH==0xff); // wait until any button is pressed.

while (SWITCH==0xfe) // Button 1 is pressed.

SEGMENT=ch[1];
buzz=1;
delay(1000); // Activate buzzer for 1 second.
buzz=0;
while(rst!=0); // display the digit until the reset is pressed.


while (SWITCH==0xfd) // Button 2 is pressed.

SEGMENT=ch[2];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xfb) // Button 3 is pressed.

SEGMENT=ch[3];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xf7) // Button 4 is pressed.

SEGMENT=ch[4];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xef) // Button 5 is pressed.

SEGMENT=ch[5];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xdf) // Button 6 is pressed.

SEGMENT=ch[6];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0xbf) // Button 7 is pressed.

SEGMENT=ch[7];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


while (SWITCH==0x7f) // Button 8 is pressed.

SEGMENT=ch[8];
buzz=1;
delay(1000);
buzz=0;
while(rst!=0);


SEGMENT=0xff;
rst=1;









microcontroller 8051 piezo-buzzer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 15:51







Shrutika Jagtap

















asked Mar 27 at 8:08









Shrutika JagtapShrutika Jagtap

262




262







  • 1




    $begingroup$
    it sounds like the microcontroller output is too weak to drive the buzzer, measure the voltage on the buzzer
    $endgroup$
    – Jasen
    Mar 27 at 8:19






  • 2




    $begingroup$
    Can you remove disconnect the resistor from pin 10 of the AT89C51 and drive it manually with 5V? (P.S. do use reference names as well for components, it is easier to refer to them that way)
    $endgroup$
    – Huisman
    Mar 27 at 8:58







  • 1




    $begingroup$
    P3^3 What language is this? It is nonsense in C, ^ being the bitwise XOR operator.
    $endgroup$
    – Lundin
    Mar 27 at 9:07






  • 3




    $begingroup$
    @Lundin It is no nonsense. Please read keil.com/support/man/docs/c51/c51_le_sbit.htm
    $endgroup$
    – Huisman
    Mar 27 at 9:23






  • 1




    $begingroup$
    @Huisman Of course it is nonsense in C, since the ^ operator is already taken and perfectly valid to use inside an initializer. This is clearly not valid C but non-standard extensions. There are of course many other reasons why Keil has such a bad reputation, this is just one of them.
    $endgroup$
    – Lundin
    Mar 27 at 9:39













  • 1




    $begingroup$
    it sounds like the microcontroller output is too weak to drive the buzzer, measure the voltage on the buzzer
    $endgroup$
    – Jasen
    Mar 27 at 8:19






  • 2




    $begingroup$
    Can you remove disconnect the resistor from pin 10 of the AT89C51 and drive it manually with 5V? (P.S. do use reference names as well for components, it is easier to refer to them that way)
    $endgroup$
    – Huisman
    Mar 27 at 8:58







  • 1




    $begingroup$
    P3^3 What language is this? It is nonsense in C, ^ being the bitwise XOR operator.
    $endgroup$
    – Lundin
    Mar 27 at 9:07






  • 3




    $begingroup$
    @Lundin It is no nonsense. Please read keil.com/support/man/docs/c51/c51_le_sbit.htm
    $endgroup$
    – Huisman
    Mar 27 at 9:23






  • 1




    $begingroup$
    @Huisman Of course it is nonsense in C, since the ^ operator is already taken and perfectly valid to use inside an initializer. This is clearly not valid C but non-standard extensions. There are of course many other reasons why Keil has such a bad reputation, this is just one of them.
    $endgroup$
    – Lundin
    Mar 27 at 9:39








1




1




$begingroup$
it sounds like the microcontroller output is too weak to drive the buzzer, measure the voltage on the buzzer
$endgroup$
– Jasen
Mar 27 at 8:19




$begingroup$
it sounds like the microcontroller output is too weak to drive the buzzer, measure the voltage on the buzzer
$endgroup$
– Jasen
Mar 27 at 8:19




2




2




$begingroup$
Can you remove disconnect the resistor from pin 10 of the AT89C51 and drive it manually with 5V? (P.S. do use reference names as well for components, it is easier to refer to them that way)
$endgroup$
– Huisman
Mar 27 at 8:58





$begingroup$
Can you remove disconnect the resistor from pin 10 of the AT89C51 and drive it manually with 5V? (P.S. do use reference names as well for components, it is easier to refer to them that way)
$endgroup$
– Huisman
Mar 27 at 8:58





1




1




$begingroup$
P3^3 What language is this? It is nonsense in C, ^ being the bitwise XOR operator.
$endgroup$
– Lundin
Mar 27 at 9:07




$begingroup$
P3^3 What language is this? It is nonsense in C, ^ being the bitwise XOR operator.
$endgroup$
– Lundin
Mar 27 at 9:07




3




3




$begingroup$
@Lundin It is no nonsense. Please read keil.com/support/man/docs/c51/c51_le_sbit.htm
$endgroup$
– Huisman
Mar 27 at 9:23




$begingroup$
@Lundin It is no nonsense. Please read keil.com/support/man/docs/c51/c51_le_sbit.htm
$endgroup$
– Huisman
Mar 27 at 9:23




1




1




$begingroup$
@Huisman Of course it is nonsense in C, since the ^ operator is already taken and perfectly valid to use inside an initializer. This is clearly not valid C but non-standard extensions. There are of course many other reasons why Keil has such a bad reputation, this is just one of them.
$endgroup$
– Lundin
Mar 27 at 9:39





$begingroup$
@Huisman Of course it is nonsense in C, since the ^ operator is already taken and perfectly valid to use inside an initializer. This is clearly not valid C but non-standard extensions. There are of course many other reasons why Keil has such a bad reputation, this is just one of them.
$endgroup$
– Lundin
Mar 27 at 9:39











2 Answers
2






active

oldest

votes


















6












$begingroup$

The 8051 and clones typically use an I/O configuration that is described as "pseudo-bidirectional". They have active pull-down but quasi-passive pull-up (there's a transistor that is turned on briefly to improve the rise time). This means that they can only source a tiny amount of continuous current to an external device. The datasheet (DC Characteristics, page 10) shows that VOH drops to 2.4V at just 60 µA of current.



This is not enough current to drive your NPN transistor. Instead, try putting a logic-level N-channel MOSFET there.




Note also that your other NPN (the one attached to pin 17 — you really do need to use reference designators in your schematics!) should actually be a PNP. This requires inverting the logic in your code that drives pin 17.






share|improve this answer











$endgroup$












  • $begingroup$
    There's only one digit of display so the transistor attached to pin 17 is not even needed at all. The SEGMENT=0xFF line at the end of the loop blanks the display.
    $endgroup$
    – Finbarr
    Mar 27 at 13:04











  • $begingroup$
    @Dave Tweed any reference for MOSFET ...I want MOSFET number.
    $endgroup$
    – Shrutika Jagtap
    Apr 2 at 10:26










  • $begingroup$
    You could try the 2N7000 or the BSS138.
    $endgroup$
    – Dave Tweed
    Apr 2 at 11:04


















0












$begingroup$

You don't say what type of device the buzzer is (electromechanical, piezo, etc.) or how much current it requires to operate, but I don't think either of those is the problem.



One millisecond is too short a time for the buzzer to wake up and make enough noise to be heard. Increase the on-time to 1 second to verify that the code is working, then adjust to taste.



BTW, what type of buzzer is it? Datasheet or link?






share|improve this answer









$endgroup$








  • 1




    $begingroup$
    Hi, "One millisecond is too short a time for the buzzer to wake up" FYI the OP isn't claiming to drive the buzzer for 1ms. The code (I added a link to the original source page) is supposed to switch on the buzzer, delay for 1000 x 1ms = 1s (hence the delay(1000);), then switch the buzzer off. There are comments in the original code which I linked (not included by the OP) which make this clearer. That doesn't answer all of your questions, but I hope their intent is now clearer.
    $endgroup$
    – SamGibson
    Mar 27 at 12:18












Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");

StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "135"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f429274%2f8-channel-quiz-buzzer-circuit-using-8051-microcontroller%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









6












$begingroup$

The 8051 and clones typically use an I/O configuration that is described as "pseudo-bidirectional". They have active pull-down but quasi-passive pull-up (there's a transistor that is turned on briefly to improve the rise time). This means that they can only source a tiny amount of continuous current to an external device. The datasheet (DC Characteristics, page 10) shows that VOH drops to 2.4V at just 60 µA of current.



This is not enough current to drive your NPN transistor. Instead, try putting a logic-level N-channel MOSFET there.




Note also that your other NPN (the one attached to pin 17 — you really do need to use reference designators in your schematics!) should actually be a PNP. This requires inverting the logic in your code that drives pin 17.






share|improve this answer











$endgroup$












  • $begingroup$
    There's only one digit of display so the transistor attached to pin 17 is not even needed at all. The SEGMENT=0xFF line at the end of the loop blanks the display.
    $endgroup$
    – Finbarr
    Mar 27 at 13:04











  • $begingroup$
    @Dave Tweed any reference for MOSFET ...I want MOSFET number.
    $endgroup$
    – Shrutika Jagtap
    Apr 2 at 10:26










  • $begingroup$
    You could try the 2N7000 or the BSS138.
    $endgroup$
    – Dave Tweed
    Apr 2 at 11:04















6












$begingroup$

The 8051 and clones typically use an I/O configuration that is described as "pseudo-bidirectional". They have active pull-down but quasi-passive pull-up (there's a transistor that is turned on briefly to improve the rise time). This means that they can only source a tiny amount of continuous current to an external device. The datasheet (DC Characteristics, page 10) shows that VOH drops to 2.4V at just 60 µA of current.



This is not enough current to drive your NPN transistor. Instead, try putting a logic-level N-channel MOSFET there.




Note also that your other NPN (the one attached to pin 17 — you really do need to use reference designators in your schematics!) should actually be a PNP. This requires inverting the logic in your code that drives pin 17.






share|improve this answer











$endgroup$












  • $begingroup$
    There's only one digit of display so the transistor attached to pin 17 is not even needed at all. The SEGMENT=0xFF line at the end of the loop blanks the display.
    $endgroup$
    – Finbarr
    Mar 27 at 13:04











  • $begingroup$
    @Dave Tweed any reference for MOSFET ...I want MOSFET number.
    $endgroup$
    – Shrutika Jagtap
    Apr 2 at 10:26










  • $begingroup$
    You could try the 2N7000 or the BSS138.
    $endgroup$
    – Dave Tweed
    Apr 2 at 11:04













6












6








6





$begingroup$

The 8051 and clones typically use an I/O configuration that is described as "pseudo-bidirectional". They have active pull-down but quasi-passive pull-up (there's a transistor that is turned on briefly to improve the rise time). This means that they can only source a tiny amount of continuous current to an external device. The datasheet (DC Characteristics, page 10) shows that VOH drops to 2.4V at just 60 µA of current.



This is not enough current to drive your NPN transistor. Instead, try putting a logic-level N-channel MOSFET there.




Note also that your other NPN (the one attached to pin 17 — you really do need to use reference designators in your schematics!) should actually be a PNP. This requires inverting the logic in your code that drives pin 17.






share|improve this answer











$endgroup$



The 8051 and clones typically use an I/O configuration that is described as "pseudo-bidirectional". They have active pull-down but quasi-passive pull-up (there's a transistor that is turned on briefly to improve the rise time). This means that they can only source a tiny amount of continuous current to an external device. The datasheet (DC Characteristics, page 10) shows that VOH drops to 2.4V at just 60 µA of current.



This is not enough current to drive your NPN transistor. Instead, try putting a logic-level N-channel MOSFET there.




Note also that your other NPN (the one attached to pin 17 — you really do need to use reference designators in your schematics!) should actually be a PNP. This requires inverting the logic in your code that drives pin 17.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 27 at 11:33

























answered Mar 27 at 11:24









Dave TweedDave Tweed

123k9152266




123k9152266











  • $begingroup$
    There's only one digit of display so the transistor attached to pin 17 is not even needed at all. The SEGMENT=0xFF line at the end of the loop blanks the display.
    $endgroup$
    – Finbarr
    Mar 27 at 13:04











  • $begingroup$
    @Dave Tweed any reference for MOSFET ...I want MOSFET number.
    $endgroup$
    – Shrutika Jagtap
    Apr 2 at 10:26










  • $begingroup$
    You could try the 2N7000 or the BSS138.
    $endgroup$
    – Dave Tweed
    Apr 2 at 11:04
















  • $begingroup$
    There's only one digit of display so the transistor attached to pin 17 is not even needed at all. The SEGMENT=0xFF line at the end of the loop blanks the display.
    $endgroup$
    – Finbarr
    Mar 27 at 13:04











  • $begingroup$
    @Dave Tweed any reference for MOSFET ...I want MOSFET number.
    $endgroup$
    – Shrutika Jagtap
    Apr 2 at 10:26










  • $begingroup$
    You could try the 2N7000 or the BSS138.
    $endgroup$
    – Dave Tweed
    Apr 2 at 11:04















$begingroup$
There's only one digit of display so the transistor attached to pin 17 is not even needed at all. The SEGMENT=0xFF line at the end of the loop blanks the display.
$endgroup$
– Finbarr
Mar 27 at 13:04





$begingroup$
There's only one digit of display so the transistor attached to pin 17 is not even needed at all. The SEGMENT=0xFF line at the end of the loop blanks the display.
$endgroup$
– Finbarr
Mar 27 at 13:04













$begingroup$
@Dave Tweed any reference for MOSFET ...I want MOSFET number.
$endgroup$
– Shrutika Jagtap
Apr 2 at 10:26




$begingroup$
@Dave Tweed any reference for MOSFET ...I want MOSFET number.
$endgroup$
– Shrutika Jagtap
Apr 2 at 10:26












$begingroup$
You could try the 2N7000 or the BSS138.
$endgroup$
– Dave Tweed
Apr 2 at 11:04




$begingroup$
You could try the 2N7000 or the BSS138.
$endgroup$
– Dave Tweed
Apr 2 at 11:04













0












$begingroup$

You don't say what type of device the buzzer is (electromechanical, piezo, etc.) or how much current it requires to operate, but I don't think either of those is the problem.



One millisecond is too short a time for the buzzer to wake up and make enough noise to be heard. Increase the on-time to 1 second to verify that the code is working, then adjust to taste.



BTW, what type of buzzer is it? Datasheet or link?






share|improve this answer









$endgroup$








  • 1




    $begingroup$
    Hi, "One millisecond is too short a time for the buzzer to wake up" FYI the OP isn't claiming to drive the buzzer for 1ms. The code (I added a link to the original source page) is supposed to switch on the buzzer, delay for 1000 x 1ms = 1s (hence the delay(1000);), then switch the buzzer off. There are comments in the original code which I linked (not included by the OP) which make this clearer. That doesn't answer all of your questions, but I hope their intent is now clearer.
    $endgroup$
    – SamGibson
    Mar 27 at 12:18
















0












$begingroup$

You don't say what type of device the buzzer is (electromechanical, piezo, etc.) or how much current it requires to operate, but I don't think either of those is the problem.



One millisecond is too short a time for the buzzer to wake up and make enough noise to be heard. Increase the on-time to 1 second to verify that the code is working, then adjust to taste.



BTW, what type of buzzer is it? Datasheet or link?






share|improve this answer









$endgroup$








  • 1




    $begingroup$
    Hi, "One millisecond is too short a time for the buzzer to wake up" FYI the OP isn't claiming to drive the buzzer for 1ms. The code (I added a link to the original source page) is supposed to switch on the buzzer, delay for 1000 x 1ms = 1s (hence the delay(1000);), then switch the buzzer off. There are comments in the original code which I linked (not included by the OP) which make this clearer. That doesn't answer all of your questions, but I hope their intent is now clearer.
    $endgroup$
    – SamGibson
    Mar 27 at 12:18














0












0








0





$begingroup$

You don't say what type of device the buzzer is (electromechanical, piezo, etc.) or how much current it requires to operate, but I don't think either of those is the problem.



One millisecond is too short a time for the buzzer to wake up and make enough noise to be heard. Increase the on-time to 1 second to verify that the code is working, then adjust to taste.



BTW, what type of buzzer is it? Datasheet or link?






share|improve this answer









$endgroup$



You don't say what type of device the buzzer is (electromechanical, piezo, etc.) or how much current it requires to operate, but I don't think either of those is the problem.



One millisecond is too short a time for the buzzer to wake up and make enough noise to be heard. Increase the on-time to 1 second to verify that the code is working, then adjust to taste.



BTW, what type of buzzer is it? Datasheet or link?







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 27 at 11:42









AnalogKidAnalogKid

2,78837




2,78837







  • 1




    $begingroup$
    Hi, "One millisecond is too short a time for the buzzer to wake up" FYI the OP isn't claiming to drive the buzzer for 1ms. The code (I added a link to the original source page) is supposed to switch on the buzzer, delay for 1000 x 1ms = 1s (hence the delay(1000);), then switch the buzzer off. There are comments in the original code which I linked (not included by the OP) which make this clearer. That doesn't answer all of your questions, but I hope their intent is now clearer.
    $endgroup$
    – SamGibson
    Mar 27 at 12:18













  • 1




    $begingroup$
    Hi, "One millisecond is too short a time for the buzzer to wake up" FYI the OP isn't claiming to drive the buzzer for 1ms. The code (I added a link to the original source page) is supposed to switch on the buzzer, delay for 1000 x 1ms = 1s (hence the delay(1000);), then switch the buzzer off. There are comments in the original code which I linked (not included by the OP) which make this clearer. That doesn't answer all of your questions, but I hope their intent is now clearer.
    $endgroup$
    – SamGibson
    Mar 27 at 12:18








1




1




$begingroup$
Hi, "One millisecond is too short a time for the buzzer to wake up" FYI the OP isn't claiming to drive the buzzer for 1ms. The code (I added a link to the original source page) is supposed to switch on the buzzer, delay for 1000 x 1ms = 1s (hence the delay(1000);), then switch the buzzer off. There are comments in the original code which I linked (not included by the OP) which make this clearer. That doesn't answer all of your questions, but I hope their intent is now clearer.
$endgroup$
– SamGibson
Mar 27 at 12:18





$begingroup$
Hi, "One millisecond is too short a time for the buzzer to wake up" FYI the OP isn't claiming to drive the buzzer for 1ms. The code (I added a link to the original source page) is supposed to switch on the buzzer, delay for 1000 x 1ms = 1s (hence the delay(1000);), then switch the buzzer off. There are comments in the original code which I linked (not included by the OP) which make this clearer. That doesn't answer all of your questions, but I hope their intent is now clearer.
$endgroup$
– SamGibson
Mar 27 at 12:18


















draft saved

draft discarded
















































Thanks for contributing an answer to Electrical Engineering Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f429274%2f8-channel-quiz-buzzer-circuit-using-8051-microcontroller%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







-8051, microcontroller, piezo-buzzer

Popular posts from this blog

Frič See also Navigation menuinternal link

Identify plant with long narrow paired leaves and reddish stems Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is this plant with long sharp leaves? Is it a weed?What is this 3ft high, stalky plant, with mid sized narrow leaves?What is this young shrub with opposite ovate, crenate leaves and reddish stems?What is this plant with large broad serrated leaves?Identify this upright branching weed with long leaves and reddish stemsPlease help me identify this bulbous plant with long, broad leaves and white flowersWhat is this small annual with narrow gray/green leaves and rust colored daisy-type flowers?What is this chilli plant?Does anyone know what type of chilli plant this is?Help identify this plant

fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank” The 2019 Stack Overflow Developer Survey Results Are In“tar: unrecognized option --warning” during 'apt-get install'How to fix Fontconfig errorHow do I figure out which font file is chosen for a system generic font alias?Why are some apt-get-installed fonts being ignored by fc-list, xfontsel, etc?Reload settings in /etc/fonts/conf.dTaking 30 seconds longer to boot after upgrade from jessie to stretchHow to match multiple font names with a single <match> element?Adding a custom font to fontconfigRemoving fonts from fontconfig <match> resultsBroken fonts after upgrading Firefox ESR to latest Firefox