Iredan
Posts: 6
Joined: Fri Nov 27, 2015 12:52 pm

Piezo buzzer barely audible with MCP23017

Sun Jan 17, 2016 2:36 pm

Hi guys

I'm using an MCP23017 expander to get some extra pins on my Raspberry Pi. It is powered by an external 5v power supply. I have a Piezo buzzer and a simple red led connected. When I turn on the circuit, the LED lights up fine, but the buzzer is very low. I understand this is something to do with frequency, but I'm pretty much a noob to electronics. I tested the buzzer previously to make sure it worked by connecting directly to the RPi and using software PWM with RPi.GPIO.
I really just need a more audible buzzer, not tunes or anything like that. Is this possible with the MCP23017?
I'm using the Python smbus module to write to the pins.
Thanks

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Piezo buzzer barely audible with MCP23017

Sun Jan 17, 2016 2:50 pm

If you have the LED in series with the buzzer then you are reducing the voltage across the buzzer (some is being used by the LED). Try just connecting the buzzer to one of the MCP23017 gpio pins and see if that improves the volume.

Another possibility is to attach noth legs of the piezo buzzer to seperate pins and alternate them from high to low, that should also increase the volume.
Doug.
Building Management Systems Engineer.

Iredan
Posts: 6
Joined: Fri Nov 27, 2015 12:52 pm

Re: Piezo buzzer barely audible with MCP23017

Sun Jan 17, 2016 3:14 pm

Hi Doug, thanks for replying.
They are definitely on separate pins, i.e., I can turn them on and off independently.
Your other suggestion sounds interesting. I'll give that a shot later once I get time!

Iredan
Posts: 6
Joined: Fri Nov 27, 2015 12:52 pm

Re: Piezo buzzer barely audible with MCP23017

Mon Jan 18, 2016 1:37 am

Hi again, just got to test your suggestion but it didn't seem to work.
I read the data sheet for the chip again and found out that it has different speeds.
So I increased the speed to 1.7MHz and that did help, but it's a pretty flaky sound.
Is it a lack of power from the pins? I'm testing it with no other pins on.
The chip is powered by an external 5v power supply and the buzzer works fine when connected directly to it.

stevech
Posts: 144
Joined: Sun Jul 15, 2012 11:53 pm

Re: Piezo buzzer barely audible with MCP23017

Mon Jan 18, 2016 5:41 am

a PWM signal at the resonant frequency of the piezo (see spec sheet) is needed. Also probably need a transistor on the GPIO output so the drive to the Piezo is more current. Mainly, it's getting the frequency correct. At best, Piezo is feeble as a buzzer.

Iredan
Posts: 6
Joined: Fri Nov 27, 2015 12:52 pm

Re: Piezo buzzer barely audible with MCP23017

Mon Jan 18, 2016 7:50 am

Hi stevech,

Yes a transistor does the trick. I was just trying to get my head around what the chip is outputting and I think I understand it now so thanks for all the help!

Return to “Python”