Buzzer stops beeping when the motors are on

Post Reply
User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Buzzer stops beeping when the motors are on

Post by phenolic »

I have a simple piezo buzzer (apply power, it beeps) hooked up to pin A3 through a 220 ohm resistor (pulls about 26 mA without the resistor, 8 mA with). It works except whenever the motors are on, even just idling. I don't think it's a software issue per se because when I first turn on the motors I can still hear very faint beeps but then they go away after a few seconds or if I apply more power. Seems like some sort of power issue or I don't know. Maybe I need to take out the resistor because I noticed the buzzer is very sensitive to getting enough voltage/current or it won't work at all (26 mA seems a bit much to power directly off a pin though?).

The Pro Mini 328 is powered by the BEC off one of the ESC's. I wouldn't think the 5V line would sag just because of the motors running but something seems to be going on.

Any ideas?

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: Buzzer stops beeping when the motors are on

Post by doughboy »

I think the atmega spec for the pin current output is total for all pins, and not for one pin. I can't remember exactly the value, but there is definitely a limit for sure. Like if it says 50ma output current on one pin, does not mean it can output 50ma on each of the 20 output pins. Besides, the multiwii doc on buzzer said never connect directly to the arduino pin.

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: Buzzer stops beeping when the motors are on

Post by phenolic »

doughboy wrote:I think the atmega spec for the pin current output is total for all pins, and not for one pin. I can't remember exactly the value, but there is definitely a limit for sure. Like if it says 50ma output current on one pin, does not mean it can output 50ma on each of the 20 output pins. Besides, the multiwii doc on buzzer said never connect directly to the arduino pin.


Keep in mind, the buzzer is only pulling 8 mA, that should be no problem. Yes there is a limit for the whole chip (something like 200 mA) but it's nowhere near that limit.

The "never connect" is because the pin is either on (beep) or off (no beep). In other words, you can't hook a speaker directly to it, it's only an on/off switch which is exactly how my buzzer works. :)

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: Buzzer stops beeping when the motors are on

Post by doughboy »

phenolic wrote:
The "never connect" is because the pin is either on (beep) or off (no beep). In other words, you can't hook a speaker directly to it, it's only an on/off switch which is exactly how my buzzer works. :)


I'm pretty sure the never connect is due to the current load. it is a given the output is not a square wave tone signal. the instruction is there for a reason. you'll probably get more response if you follow it and still have problem.

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: Buzzer stops beeping when the motors are on

Post by phenolic »

Well a transistor or other switch is going to pull at least 8 mA. OK, maybe not but the diagrams specifically show an LED hooked up to it and that very well pulls at least 8 mA. :P

User avatar
phenolic
Posts: 81
Joined: Fri Sep 21, 2012 10:31 pm

Re: Buzzer stops beeping when the motors are on

Post by phenolic »

I tried a 100 ohm resistor, that definitely helps because it keeps beeping even when flying. There must be some sort of issue when it's under load and it's not delivering enough current/voltage. I'll probably end up using the 100 ohm or even 47 ohm resistor for now. The I/O pins are rated for 40 mA and currently the whole system is only pulling 50 mA.

Maybe eventually I'll stick a transistor in there and hook the buzzer directly to the lipo for more volume. I hate tacking on yet more parts.

Post Reply