Shop OBEX P1 Docs P2 Docs Learn Events
Driving an audio speaker with one or more pins of a UNL2803 — Parallax Forums

Driving an audio speaker with one or more pins of a UNL2803

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2009-12-14 17:50 in General Discussion
Has anyone tried using a UNL2803 to drive a 4ohm or 8ohm speaker.?

It seems that if I were to put a 10uf capacitor between the speaker and the UNL2803, it would be okay (and a very simple driver).

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?

aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-10 20:01
    A 10uF capacitor isn't enough. The ULN2803 is an open collector driver. It grounds anything connected to it when on. There's no source of power for the speaker if you just use the capacitor. What you could do is use a small audio transformer, maybe with a 1K primary and an 8 Ohm secondary (RadioShack carries one), connect the primary between the ULN2803 collector and a source of 5 to 12V and connect the secondary to the speaker.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2009-12-11 12:07
    Thanks Mike. I'll see if I can locate a 1k/8ohm transformer locally. Mainly I was hoping to get away from the higher part count of using an audio amp chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ain't gadetry a wonderful thing?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-12-11 13:05
    A ULN2803 isn't meant for linear amplification.

    If you're angling at "amplifying" FREQOUT (which is·just AF swinging at·logic-level) or something then this·idea might do, but not for anything else (a Walkman, iPod, &c.)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2009-12-12 07:46
    PJ Allen
    Understood. But any one pin output to a speaker is highly imperfect audio, so I am just looking for a simple way to drive such. A DAC approach might require the parallel output of 8 bits (meaning 8 I/0 pins) and related software complexities. IT would just be nice to get a louder tone as output than a piezoelectric speaker offers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ain't gadetry a wonderful thing?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-12-12 13:17
    DAC?· What DAC?·

    Honestly,·what's the struggle here?

    The LM386N-3·is an 8-pin IC, an audio amplifier qua audio amplifier.· Its minimal configuration requires a resistor,·two capacitors and a potentiometer (log/audio).· What's the big deal?· Capacitively coupling the source to the amp's input, recommended (unless you·desire DC gain)·although not shown, will require·another capacitor.

    Maxim has headphone amp ICs (SMT) which require no external components, but they use digital volume control, etc.

    Try your posted idea and inform us as to your success.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2009-12-14 17:06
    I said 'understood' above. I am driving square waves as audio frequency, not an iPod or Walkman input. I just want an indicator tone that is loud enough to hear, a beep.

    Don't have a cow, PJ.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ain't gadetry a wonderful thing?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-12-14 17:50
    Cow?· What cow?

    Did you implement your idea or not?· Post, post, post, post, post.

    What do you want?· Validation, explanation, consolation?
    PJ said...· Try your posted idea and inform us as to your success.
Sign In or Register to comment.