Author Topic: ULN2003A and piezo buzzer  (Read 3815 times)

0 Members and 1 Guest are viewing this topic.

Offline kirill578

  • Contributor
  • Posts: 8
ULN2003A and piezo buzzer
« on: February 18, 2012, 12:03:47 pm »
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.
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: 00
Re: ULN2003A and piezo buzzer
« Reply #1 on: February 18, 2012, 12:34:54 pm »
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.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3840
  • Country: us
Re: ULN2003A and piezo buzzer
« Reply #2 on: February 18, 2012, 10:31:46 pm »
Quote
which has internal pull-up resistor on all its port
According to the datasheet, port 0 only has pullups when it's used to drive external memory.  Otherwise it's sink-only open-drain...
 

Offline kirill578

  • Contributor
  • Posts: 8
Re: ULN2003A and piezo buzzer
« Reply #3 on: February 19, 2012, 04:04:58 pm »
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
« Last Edit: February 20, 2012, 02:29:23 pm by kirill578 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf