I am working on a project of security alarm system using a PIR sensor. I wanted to connect a siren to a arduino UNO i have selected pin no 4 as output to the siren , I have used BC547 transistor for switching a siren ON when the motion is sensed , the code for the project is also working fine, i have tested using led instead of siren everything works fine.
when i connect the siren the siren starts to sound continuously it should work only when the output of pin 4 is HIGH .
The siren used is 12V ,300mA.
I have connected the siren between to 12V supply and emitter of transistor and to the the base the output of pin no 4 is given. the collector is connected to to the ground of 12v supply.