Shop OBEX P1 Docs P2 Docs Learn Events
Prop output to tiny speaker — Parallax Forums

Prop output to tiny speaker

BasilBasil Posts: 380
edited 2008-09-17 06:43 in Propeller 1
Hi All,

I need a tiny sound producing device which will only be 'beeping out numbers' for very short period of time. (Ie, 42 = beep beep beep beep, wait, beep beep, wait)

I came across the PUI 'SMT-0540' (Digikey 668-1192-1-ND) which seems suitable but I have a few questions because it is electromagnetic.

Do I need to put anything between the +ve input to the device and the prop output pin?
Also, im assuming to make a sound I just need to send whatever frequency out of the prop pin ive connected it to?

Sorry for all the silly questions, im used to devices with internal drivers but there arn't any this small [noparse];)[/noparse]

Thanks,

Alec

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Alec

My our page

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-16 03:39
    How about posting a datasheet?
  • LeonLeon Posts: 7,620
    edited 2008-09-16 03:44
    It will need a transistor to drive it.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • BasilBasil Posts: 380
    edited 2008-09-16 03:49
    Mike Green said...
    How about posting a datasheet?

    Good idea [noparse]:)[/noparse] Here it is. Sorry theres not much to it, this is all I could find for the time being.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page
  • BasilBasil Posts: 380
    edited 2008-09-16 03:52
    Leon said...
    It will need a transistor to drive it.

    Leon

    Any sort? Or does it need any specific specs to make it suitable? Im hoping theres something in the SOT-23 package...

    EDIT: Just clicked. Is the reason for the trans due to the current requirments exceeding what the prop can give out of 1 pin?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page

    Post Edited (Basil) : 9/16/2008 4:27:40 AM GMT
  • grasshoppergrasshopper Posts: 438
    edited 2008-09-16 06:01
    Well any transistor would work as long as you don't over drive it - meaning the speaker or 100ma according to the data sheet. It wont be loud, in fact depending on the Voltage/current your driving the speaker combined with 1 transistor may not be loud enough. I did this using a 5Volt power input into a transistor to a speaker and it was not loud enough to hear across the room 15 feet away.
  • DroneDrone Posts: 433
    edited 2008-09-16 07:23
    Hi Alec,

    The circuit shown in the attached diagram should drive the speaker you selected. In the circuit diagram the speaker is modeled as the 12 Ohm resistor R3. The speaker sees approximately 50 mA peak drive current. If you want to drive the speaker closer to it's rated 100 mA, simply change resistor R2 to something like 27 Ohms. Remember the speaker must be driven with 4000 Hz +/- 500 Hz as stated in the data sheet. Most any NPN switching transistor should work in-place of the 2N2222 part shown.

    You might want to search for a small SMT Piezo transducer or buzzer. They can be driven directly from a pin and consume far less current. Beware though, Piezo transducers typically resonate in a narrow frequency range, so you might want to try "sweeping" your frequency to find the sweet-spot where the output is loudest.

    Good Luck, David

    Post Edited (Drone) : 9/16/2008 7:35:05 AM GMT
    640 x 297 - 12K
  • BasilBasil Posts: 380
    edited 2008-09-16 07:40
    Thanks guys [noparse]:)[/noparse]

    I have had a good look for a small piezo/buzzer but couldn't find one small enough :\ given the amoutn of external comps needed to drive this speaker though I may relook at it as in the end the PCB real estate is much the same.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page
  • grasshoppergrasshopper Posts: 438
    edited 2008-09-16 15:13
    I think that schematic is wired wrong. The Speaker is connected to common on both ends.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2008-09-16 16:11
    One end is marked 3.3v the other is connected to ground via the transistor, its not overly clear perhaps but I think it is correct.

    Graham
  • DroneDrone Posts: 433
    edited 2008-09-16 16:56
    Grasshopper; Graham is right - the LTSpice schematic is correct. Look at the + and - in the voltage source V2 "circle". The V2 and 3.3V labels can be moved in LTSpice, but I didn't bother. I'll try to pay more attention to this next time.

    Thanks & Regards, David
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-16 17:39
    Here's a circuit that will drive the speaker:

    attachment.php?attachmentid=55829

    The diode should be rated for at least 500mA. If the Propeller pin that drives it remains in a high state, the transistor and speaker could get very hot. So try to avoid that situation. If in doubt, capacitively coupling the input can be used during debugging to prevent burnout.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!

    Post Edited (Phil Pilgrim (PhiPi)) : 9/16/2008 5:44:23 PM GMT
    213 x 300 - 1K
  • lonesocklonesock Posts: 917
    edited 2008-09-16 18:10
    Well, I haven't tried this yet, but off the top of my head...

    Those little piezo speakers can be modeled as a simple capacitor. They can be driven by a unipolar source (i.e. 10Vpp is +-5V, so 3.3V unipolar is fine). A typical values is ~15nF. You could connect one leg to ground, and the other leg via a 2k resistor to a pin on the prop. The 2k would limit the maximum current output, and the RC circuit ends up as a ~6kHz lowpass filter. You could just drive the single pin using the standard duty-cycle counter mode and play waveforms or whatever you desire.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-16 18:17
    The referenced speaker is not a piezo; it's magnetic and has a 12-ohm impedance. That's why a transistor drive is necessary and is also the reason for the protection diode.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • lonesocklonesock Posts: 917
    edited 2008-09-16 19:08
    Phil Pilgrim (PhiPi) said...
    The referenced speaker is not a piezo; it's magnetic and has a 12-ohm impedance. That's why a transistor drive is necessary and is also the reason for the protection diode.

    -Phil
    Understood. I was mentioning a possible (cheap) replacement solution, along the lines of Drone's post. I'm sorry if this was unclear.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • BasilBasil Posts: 380
    edited 2008-09-16 20:27
    Hmmm lots of possible ideas. The driver circuits is not too nasty. I will look for a small piezo and see what it offers in terms of current draw and physical size.

    Thanks for the input people [noparse]:)[/noparse] That answers my question perfectly [noparse]:)[/noparse]

    Alec

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page
  • DroneDrone Posts: 433
    edited 2008-09-16 20:58
    Phil, nice call on the coupling-cap - the 2N2222 can handle being on all the time in my circuit, but it's not ideal during debug as you pointed out. I'm not familiar off-hand with the NMOS part you specify; but venerable TO-92 NMOS parts like the 2N7000/7002 and BS170/270 would probably substitute.

    Alec, when and if you find your best solution for the small noise maker, please share it with us.

    Rgds, David
  • BasilBasil Posts: 380
    edited 2008-09-16 21:40
    Hi [noparse]:)[/noparse] I found the CUI CMT-1102 piezo which is only 11mm x 9mm x1.7mm! nice [noparse]:)[/noparse] Will use it as it only draws a few ma which is perfect [noparse]:)[/noparse]

    EDIT: Datasheet attached. I know 68db is not loud, but it only need to be heard from a few meters away anyway [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page

    Post Edited (Basil) : 9/16/2008 10:38:34 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-16 22:45
    Drone,

    Neither the BS170 nor the 2N7000 have a low enough VGS(on) to be of much use with the Propeller. The transistor I spec'd can sink significant current with a VGS of 2.5V.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • DroneDrone Posts: 433
    edited 2008-09-17 04:53
    Phil,

    You are right about the NMOS parts I cited; my-bad. The FDV303N is a nice part, I wish it were available in TO-92.

    Alec,

    Have a look at Mallory P/N AST1109MLTRQ (DigiKey P/N 458-1093-1-ND). The Mallory part has the same dimensions and footprint as the CUI part you cite but with 5 dB higher SPL and one-fifth the current at rated output. In unit qty. from DigiKey they're $2.82 USD ea. ($1.28 qty.-1k). You may find it cheaper elsewhere.

    Regards, David
  • BasilBasil Posts: 380
    edited 2008-09-17 06:43
    Hi David,

    Thanks for that. Will have a look at that one [noparse]:)[/noparse] same footprint is nice because I have already cramed my board as much as pos :P

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Alec

    My our page
Sign In or Register to comment.