Electronics > Beginners

ULN2003A and piezo buzzer

(1/1)

kirill578:
Hey, I'm using an AT89S52 which has internal pull-up resistor on all its port(according to the datasheet).When I attempt to control LEDs attached to ULN2003A it work perfectly.however,when I connect a piezo buzzer it doesn't work unless I connect a pull up resistor (I used 10Kohm) to the input of the ULN2003A.As far as I understand the ULN is the one which sicks the current from the piezo buzzer, with an open-collector input.

Basically, my question is why an external pull up resistor required just for the buzzer?

I've attached the internal circuit of the device.

TerminalJack505:
So are you driving the input of the ULN2003A by setting the pin as an output and setting it high?  Or are you just setting the pin as an input and relying on the pull-up resistor?

The pin's pull-up resistor is likely in the 47k range so it is probably just too weak.  Anyway, you should be using the pin as an output and outputting a high to drive the ULN2003A, in which case the pull-up doesn't come into play at all.

westfw:

--- Quote ---which has internal pull-up resistor on all its port
--- End quote ---
According to the datasheet, port 0 only has pullups when it's used to drive external memory.  Otherwise it's sink-only open-drain...

kirill578:
Fair enough, It can seek current only. But how does it work perfectly with the LEDs?

By the way, I've checked the datasheet once again. and it's exactly the opposite:
"Port 0 is an 8-bit open drain bidirectional I/O port....When 1s are written to port 0 pins, the pins can be used as high-impedance"
"Port 1 is an 8-bit bidirectional I/O port with internal pull-ups."
"Port 2 is an 8-bit bidirectional I/O port with internal pull-ups."
"Port 3 is an 8-bit bidirectional I/O port with internal pull-ups."
http://www.atmel.com/Images/doc1919.pdf

I've found the reason: the current the LEDs draws is about 10mA while the buzzer draw much more(due to its low resistance). The internal circuitry of the ULN2003 as a darlington transistor with certain gain.thus, we can understand that the input current is enough to drive an led but not a buzzer, so we add another pull up so the gain current will be enough to drive it

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version