??? 08/06/06 16:49 Read: times |
#121751 - Yes, but... Responding to: ???'s previous message |
Leonardo said:
The correct way to drive a buzzer is using a transistor. You can use any PNP or NPN with hFE higher than 100 (a BC547 or BC557 would fit). Not necessarily. If the buzzer is a piezo you don't need a transistor. Leonardo said:
Using a NPN transistor: connect a 10k resistor between to the port pin of the MCU and the transistor's base. The emitter goes to ground and the collector is tied to the buzzer(-). The buzzer(+) is tied directly to +5V (no resistor is needed).
Using a PNP transistor: connect a 10k resistor between to the port pin of the MCU and the transistor's base. The emitter goes to +5V and the collector is tied to the buzzer(+). The buzzer(-) is tied to GND (no resistor is needed). Yes, but if the buzzer contains a coil, then you should add a free wheeling diode! Again, we should exactly know what type of buzzer Eugene is using, first. Kai |