driving a speaker

Discussion in 'Homework Help' started by nearownkira, Apr 1, 2008.

  1. nearownkira

    Thread Starter Member

    Feb 19, 2008
    20
    0
    is a 8051 controller pin output is enough to drive a 8ohm 2 W speaker, do u need additional resistor to pull up or transistor to drive it.
     
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    i dont think a microcontroller can drive a speaker directly. make a small amplifier and connect it to the 8051 to drive the speaker.
     
  3. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    In addition to the above, the 8051's output pin is only capable of two states, a logic high and a logic low. You may need some additional intervening device like a digital to analog converter to reproduce sound.
     
  4. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    i dont know the microcontroller but maybe it has an analogue output so it will be possible to connect the amplifier directly
     
  5. cumesoftware

    Senior Member

    Apr 27, 2007
    1,330
    10
    You might fry the 8051 by connecting a speaker, with or without decoupling capacitor. I think you might need a DAC to make sound (unless you want a square wave output).
     
  6. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    A straight 8051 only has logic-level pins. Ones with built-in functions do exist, but the OP just said 8051.
     
  7. nearownkira

    Thread Starter Member

    Feb 19, 2008
    20
    0
    http://www.iguanalabs.com/sound/


    i wanted to make the circuit something like this, although my IC is a AT89S52.can I just use a resistor or something.
     
  8. nearownkira

    Thread Starter Member

    Feb 19, 2008
    20
    0

    yeah, you are right. I actually write a program using timer to create tone for my project,just some simple tone, no need to use a ADC.
     
  9. cumesoftware

    Senior Member

    Apr 27, 2007
    1,330
    10
    You might solve the problem if you use a piezo speaker.
     
  10. nearownkira

    Thread Starter Member

    Feb 19, 2008
    20
    0
    sorry to be ignorant, what is the big difference between piezo and normal speaker?
     
  11. mrmeval

    Distinguished Member

    Jun 30, 2006
    833
    2
  12. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    An 8 ohm speaker draws a high current. It can produce most audio frequencies.
    A piezo speaker draws a very low current. It produces only high audio frequencies.

    The max allowed output current from a PIC is 25mA. It will try to feed 60mA to an 8 ohm speaker which will cause the PIC to overheat.
    A 25mA peak square-wave into an 8 ohm speaker is a power of only 200mW. It will sound like a low level buzzer.
     
  13. RmACK

    Active Member

    Nov 23, 2007
    54
    0
    A standard dynamic speaker has a magnet and a coil of wire (electromagnet). Current through the coil makes it move in relation to the fixed magnet. The cone is physically connected to the coil so moves and makes sound. A piezo speaker uses a piece of piezoelectric material. This type of material is used in ignitors on gas cookers because it is essentially two rocks that when rubbed together make a high voltage. The piezo speaker is more or less this in reverse. I suspect they operate on the principle of capacitive plates being moved in relation to each other by an electrostatic field but cannot be sure. The important thing here is that the impedance of a piezo speaker is much higher than the 8 ohms of a typical coil & magnet speaker. They are often used in toys to drive them from a micro like you are trying to do.
     
Loading...