Piezzo siren/alarm



  • Hi guys

    I would be sooooo grateful if you could show me the path to get my piezzo buzzer up and running!

    This is what i bought

    0_1554806591772_Capture.JPG

    My plan is to re-use the enclosure, solar panel (6V), siren, battery (3.7V 2200mAh) and possibly the LEDs.

    But i'm already having some troubles with the piezzo siren module...

    0_1554800122288_IMG_0309[1].JPG

    Schematic

    As it looks like a naked piezzo module (no oscillator inside, unknown voltage) I conected it to a PMW pin on Arduino with a Tone() sketch
    There are some datasheets out there for similar buzzers, some are 5V others 12V... less than 200mA seems a good average. So i used a TIP120 (and even a BC238 but looked a bit undersized for 200mA)
    0_1554805667055_Capture.JPG

    What did I expect to happen?

    A hell of a noise!!! (same as when i power the original unit)

    What happened instead?

    At best i get a cheap watch alarm noise when playing with different levels of Tone()
    Applying different voltage doesn't change a thing: 1S, 2S and 3S generate the same amount of noise...

    The original board

    From that picture can you tell if the voltage is boosted to a high voltage? Or any trickery that would explain my silent buzzer?
    0_1554824059739_IMG_0310[1].JPG

    Nasty part

    I also tried to inject DC current to the poor piezzo unit 😇 😈
    Just made a "tic" sound when connected. And a "tic" every time a different voltage is applied. I went up to 12V (1S, 2S and 3S LiPo battery, from balancing plug)

    Any idea chaps? Thanks for your help.



  • Adafruit have this one, can you try to make your setup similar? Notice that you need to oscillate it at resonance frequency to provide loudest beep.
    Piezo buzzers are used for making beeps, tones and alerts. This one is petite but loud! Drive it with 3-30V peak-to-peak square wave. To use, connect one pin to ground (either one) and the other pin to a square wave out from a timer or microcontroller. For the loudest tones, stay around 4 KHz, but works quite well from 2KHz to 10KHz. For extra loudness, you can connect both pins to a microcontroller and swap which pin is high or low ('differential drive') for double the volume.
    https://www.adafruit.com/product/160
    And maybe your piezo is just a quiet buzzer - try to scavenge a piezo from a smoke alarm, that will give you around 105dB, and notice they have 3 pins and not only 2 pins
    https://electronics.stackexchange.com/questions/18212/whats-the-third-wire-on-a-piezo-buzzer


  • Mod

    @ben999 can't you just measure the output signal from the original board?



  • @mfalkvidd hi thank you for your answer.

    I did try to take measurment with my voltmeter but it is kinda slow to react.
    The 'welcome' tone when powering the board lasts about half a second... so no luck there.

    Might be time to buy one of those very affordable oscilloscope from eBay or aliExpress... do you own one?



  • @bjacobse great thanks a lot for this links!

    Up to 30V then... I then need to know what voltage comes out of the board...

    Second link is very interresting, thanks for sharing!


  • Mod

    @ben999 I bought a cheap oscilloscope kit a while ago. Photos: https://forum.mysensors.org/topic/7836/what-did-you-build-today-pictures/603
    Graphs: https://forum.mysensors.org/topic/7836/what-did-you-build-today-pictures/614

    This kit is very basic, but works for most of my needs.



  • @mfalkvidd oh thanks for quick reply and links.

    A bit off-topic here: would you rather go for a computer version or a portable one ?


  • Mod

    @ben999 I am not sure I know the difference between portable and computer version, but I'll try to answer anyway. As with most things, it depends on the use case.

    Last weekend I went to a hackathon. I brought my oscilloscope since it doesn't weigh much and doesn't take up much space. Most "real" oscilloscopes would have been too large and heavy to bring, especially since I don't travel by car.

    I usually have a computer when messing with electronics, so I don't mind using the computer's screen instead of a built-in screen. Having the user interface on my computer makes it easy to take screen shots.


  • Hardware Contributor

    For portable usage I have a https://pokitmeter.com/ which is really small and lightweight.



  • @fotofieber woooooooooooooooow 😻 😻 😻

    I searched last night for something similar (iOS and BT) but couldn't find one

    So i bought a cheap portable one on aliExpress

    https://fr.aliexpress.com/item/JYE-Tech-DSO138-13805K-Mini-Digital-Oscilloscope-DIY-Kit-SMD-Parts-Pre-soldered-Electronic-Learning-Set/32919633946.html?spm=a2g0w.10010108.1000016.1.6349de7cOC8Hnf&isOrigTitle=true

    We're not talking about the same amount of money there...

    But i'm now deeeeeeeeeply in love and will consider PokitMeter for my next workshop toy 😍

    Thank you for the link 👊 👍



  • @mfalkvidd Something puzzling me here, can i please borrow your brain for a sec ?

    @bjacobse mentionned that his small piezzo buzzer could take up to 30V...

    So i had a go with my own buzzer and the previous schematic with 1S LiPo up to 6S LiPo (close to 25V) and 440Hz up to 32kHz (max Tone() )

    No change there. Still the same noise i got with a smaller transistor and a 5V power supply.

    Tone() changes the width of the modulation (X scale), so i get different tones.
    Voltage of the power suppy changes the power going through the piezzo disc... but it doesn't get any louder.

    So what is the magic to get a loud buzzer? I shall get my oscilloscope within a month, so until then i keep scratching my head !!



  • @ben999
    I guess you don't hit resonance frequency.
    Why not scavenge a piezo from a smokealarm, then you you know that the circuit is made for resonance frequency.
    BTW I did not write MY piezo is working at 30V, I directed to a piezo that Adafruit is using, and that uses up to 30V - just to correct that I hvae not used the pieo myself



  • @bjacobse thanks for clarification 😄

    No smoke came out of mine under 25V DC so i guess it's ok

    And yes, i shall cut open an old smoke alarm, you're right.

    Thanks a lot



  • @ben999
    But also look careful at the smokealarm PCB, as you might be able to reuse this to ensure that you are using resonance frequency


  • Hardware Contributor

    AFAIK the piezo acts like a capacitor. If you don't use AC, you may have to discharge it with a parallel resistor or discharge it with a transistor.

    You could find some useful information on eevblog, e.g. http://www.eevblog.com/forum/projects/how-to-connect-a-piezo-speaker-to-a-microcontroller/

    toneAC:
    https://bitbucket.org/teckel12/arduino-toneac/wiki/Home



  • @fotofieber hi thank you for your message

    I was coming back here to share my findings.... been playing with... ToneAC 😂

    Yes you're right, differential drive makes a hell of a difference! each pin of the piezo speaker are connected to its own arduino output (serial resistor on one pin though) that send the same signal in opposition as to get a differential movment.

    But i don't quite get it :

    • driving the piezo speaker with up to 25V doesn't improve noise level at all
    • switching to differential drive @5V (so it's a 10V potential peak-to-peak) opens hell's doors wide open

    That's the part i dont understand. I'll carry on investigating.

    Still: noise level is a bit below as compared to same pizeo speaker connected to original alarm enclosure...
    I might have a go with transistors and try a differential of 2S or 3S LiPo.
    Also waiting for my oscilloscope to find out!

    And lastly: ToneAC uses pins 9 and 10... so it's a NO-NO with nRF24 😢
    Enters... ToneAC2. It's inferior (CPU cycle, accuracy, lower freq) in many points except that pins are configurable.

    More soon... 🤓


  • Mod

    @ben999 nice work, thanks for sharing.

    To change pins for the nrf24, use the following in your sketch

    #define MY_RF24_CE_PIN 7
    #define MY_RF24_CS_PIN 8
    

  • Hardware Contributor

    @ben999 said in Piezzo siren/alarm:

    But i don't quite get it :

    driving the piezo speaker with up to 25V doesn't improve noise level at all
    switching to differential drive @5V (so it's a 10V potential peak-to-peak) opens hell's doors wide open

    You may try to use a 1kOhm resistor parallel to the piezo (as suggested on eevblog).



  • @mfalkvidd oh yeah I forgot about that one!!! Thanks a lot! I have used this with a Mega for who-knows-what-reason in the past but completely forgot about it! ToneAC still in the race then, thanks again

    @fotofieber thanks a lot, but that thread is for high-level hobbyists!!! 😱 Schematics, yummy!!!
    "replace the resistor with an inductor then you double the swing" but no figures... i'll google that and see where it gets me...
    I dont even know the specs of my piezo 🤐


  • Hardware Contributor

    @ben999 said in Piezzo siren/alarm:

    @fotofieber thanks a lot, but that thread is for high-level hobbyists!!! Schematics, yummy!!!
    "replace the resistor with an inductor then you double the swing" but no figures... i'll google that and see where it gets me...
    I dont even know the specs of my piezo

    I try to simplify: Take a 1 kOhm resistor and attach each side of it to another pin of the piezo. Don't change anything else.



  • @fotofieber 😁 oh yes i got that one correct 😜

    It was more about how to size the inductor and stuff. Guys on these forums know their sh*t, they dont go into much details: "just stick a thing there and you'll be good" 😂



  • Guys,

    Thanks all a lot for your input.

    Seems sorted :

    • differential drive (ToneAC)
    • transistor (TIP120 in my case, not sure it's my best move)
    • 3S louder than 2S, itself louder than 1S

    Schematic TIP120 and 1k resistors

    0_1555413823315_Capture.JPG
    I did also put a 1k resistor in between the piezo speaker pins... but it lowered the tone by quite a lot... 🤔

    To be tested

    I'll have a go with an inductance to see what " then you double the swing" means... double the loudness or double the speed ?

    Thanks again, people involved 😉


  • Hardware Contributor

    @ben999 said in Piezzo siren/alarm:

    I did also put a 1k resistor in between the piezo speaker pins... but it lowered the tone by quite a lot..

    Cool, you sorted it out! The resistor may only help in an DC setup (one output from the arduino). In your AC setup it is useless.



  • @fotofieber gosh that a good analysis 👍 that makes a lot of sense
    Then i can picture things better:

    • one output with 0 et +5V is considered as DC
    • two output pulling differentially -5V to +5V... looks like a sin curbe... so it's AC !

    Breadboard is out and still cabled, i'll have a go asap and confirm

    Thanks again for your knowledge


  • Hardware Contributor

    @ben999
    You could try DC (one output) with 12V to the piezo. If you want to use only 5V, the AC solution should be louder, as it gets 10V difference to the piezo.

    I usually stop optimizing, when it is good enough. If AC is enough, go with it. 🙂



  • @fotofieber DC+ one output is really poor and voltage has no impact on noise. I have tested with up to 6S LiPo and there's absolutely no gain as compared to 5V DC

    AC+ two outputs is a game changer! Much louder right from +/-5V and really a killer @ +/-12V.

    So that's it: the first iteration of this project will go for a step-up converter from 5V up to 12V for the piezo speaker.

    Thanks folks!

    EDIT: could someone suggest a MOSFET (or transistor) that could be used in lieu of the huge (and probably over-sized) TIP120 (that where there, waiting in the drawer 🙂 ). Through-hole is my league. SMD is a bit of a struggle (welding, machining pcb, ...)

    Thanks again 😃


 

164
Online

8.7k
Users

9.5k
Topics

99.9k
Posts