Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get no Sound from Buzzer #8794

Closed
10 tasks
ChrisVonFrosta opened this issue Jun 26, 2020 · 11 comments
Closed
10 tasks

Get no Sound from Buzzer #8794

ChrisVonFrosta opened this issue Jun 26, 2020 · 11 comments
Labels
troubleshooting Type - Troubleshooting

Comments

@ChrisVonFrosta
Copy link

PROBLEM DESCRIPTION

an installed piezo buzzer is setup as Buzzer. If send Command Buzzer 2,3,4 i can recognize super silent knocks. but no beeps.
When set this Buzzer/Port as PWM i can contoll is channel to do beeps.
What ist to do to get the piezo buzzer works as "Tasmota's Buzzer"?

REQUESTED INFORMATION

  • [x ] Read the Contributing Guide and Policy and the Code of Conduct
  • [ x] Searched the problem in issues
  • [ x] Searched the problem in the docs
  • [ x] Searched the problem in the forum
  • Searched the problem in the chat
  • [ x] Device used (e.g., Sonoff Basic): NodeMCU V3 ESP 8266
  • Tasmota binary firmware version number used: 8.3.1
    • Pre-compiled
    • Self-compiled
      • IDE / Compiler used: _____
  • Flashing tools used: _____
  • Provide the output of command: Backlog Template; Module; GPIO 255:
  Configuration output here:


  • If using rules, provide the output of this command: Backlog Rule1; Rule2; Rule3:
  Rules output here:


  • Provide the output of this command: Status 0:
  STATUS 0 output here:


  • Provide the output of the Console log output when you experience your issue; if applicable:
    (Please use weblog 4 for more debug information)
  Console output here:


TO REPRODUCE

Steps to reproduce the behavior:

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

@ascillato2 ascillato2 added the troubleshooting Type - Troubleshooting label Jun 27, 2020
@arendst
Copy link
Owner

arendst commented Jun 28, 2020

You may have a power issue with your buzzer. Depending on the buzzer voltage you may need an amplifier to use. A simple transister could do the trick.

@ChrisVonFrosta
Copy link
Author

But it do sounds if i configure the output as pwm. So i thought it shouldn’t be a voltage issue.

@Lawrencezarb
Copy link

you probably have the wrong type of buzzer. You are using one that requires a square wave/PWM signal. You should be using one that only requires the trigger pin to go high to sound, ie a KY-012 buzzer.

@ascillato2
Copy link
Collaborator

Closing this issue as it has been answered.


Support Information (Guide)

See Wiki for more information.
See FAQ for common questions/answers and links if none of your question is in the list.
See Chat for more user experience.
See Community for forum.
See Code of Conduct

@ChrisVonFrosta
Copy link
Author

ChrisVonFrosta commented Jul 1, 2020

I could be wrong but this is not described in the wiki anyway. Maybe a little hint could be helpfull there.

Btw. It would be a nice feature to let the buzzer output “speak” pwm beeps.

Thanks for explanation and the example.

@hello-world-dot-c
Copy link
Contributor

I am working on it:
#8994

@BroBan
Copy link

BroBan commented Dec 1, 2020

@ChrisVonFrosta Could you please tell me how you setup a buzzer with the sonoff basic? Like what GPIO pins you used, did you need to add a resistor? Is the 3.3V out pin from the sonoff enough to power the active piezzo buzzer? Thanks!

@ChrisVonFrosta
Copy link
Author

ChrisVonFrosta commented Dec 1, 2020

@BroBan
hard to remamber.
the result was that i use a ws28xx for indication.
But for tests my buzzer was one with intergrated transistor i think.
so it could powered 5 V and was able to switch "activ low" with gpio.
But u need one which work without pwm signal.

@Bobatwork
Copy link

Found this thread when searching myself. You can use the PWM Buzzer, just do setoption111 1. Works like a charm.
If you need more voltage than 3.3V from your ESP, you can use an NPN transistor, with a approx. 220Ohm resistor before the base and a flyback diode across the buzzer, if you really want to get serios about it.

@ozett
Copy link

ozett commented May 12, 2022

stumbled into the same problem as thread-starter described.
would be glad to find solution to use such a "buzzer" as pwm-buzzer with tasmota-cmd..

edit: found an example in the issueshere
#8994 (comment)

maybe this is documented anywhere else?

@thomas374b
Copy link

I had the same Problem and I dug deeper.

It seems to be that the function
analogWrite(pin, duty);
in method
BuzzerSet()
in file
xrdv_24_buzzer.ino
is wrapping the duty to 8 bits.

I verified it with a scope and customized self-compiled firmware
with
duty := 254 I get sound with a 8µs long L-Pulse
duty := 255 I get nothing, but one click
duty := 256 I get nothing, but one click
duty := 257 I get sound with a 4µs long H-pulse

The argument in the original code id pwm_range/2. But pwm_range is 1023 and 511 folded to 8bit is 255
Thats why, the buzzer is only silent clicking instead of buzzing

I reworked the buzzer code already for me and added some alarm-noise patterns with changing frequencies and allowed
the user to change frequency and duty (for loudness) via extra commands.
The code is all ready but not yet under git control.

I might give you a pull request if I find the time to cleanup and checkin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
troubleshooting Type - Troubleshooting
Projects
None yet
Development

No branches or pull requests

9 participants