I’ve created a simple trip alarm using a 12 volts, Piezo buzzer. It’s a monotonous buzzer so I’ve driven it using PWM to make a rising and falling sound effect. Just like a siren.
On the breadboard, it was working as I have expected. I am using Arduino Uno by the way. Then I transferred it to stand alone version, whenever the alarm comes off, the circuit would reset itself. Sometimes it just hang.
The connection was simple, the positive terminal of the buzzer is connected to 12 volts, the negative terminal buzzer is connected to the Collector pin of BC547, the Emitter of the transistor is connected to ground. I have a 1K resistor connected to the base which is then connected to a PWM pin of my ATMEGA328P.
I am all lost, what am I dong wrong. The circuit would work if I leave the buzzer out and replace it with a power LED instead.