Go Down

Topic: Help with digitalWrite (Read 1 time) previous topic - next topic


I am currently working on an alarm system, and I have gotten everything working except the alarm/siren. The siren works if i hook it straight to a 9v battery or to the 5v or 3v pin. Although in my sketch I use digitalWrite(pin, HIGH) and the alarm/siren thing makes a quiet weird humming noise. According to arduino digitalWrite(pin, HIGH) is supposed to output 5v, so I don't know what the problem is?


The problem is most likely current. The Arduino output pins can only output a handful of milliamps (20mA or so safely, more temporarily) while your alarm probably needs quite a bit more.

Here's a basic circuit for interfacing with higher-voltage/higher-current devices:


It was designed to illustrate turning on a motor or fan but should work just as well with your alarm. Replace 12V with 9V, D1 is optional, and you should be good to go. You can also do this using an NPN transistor (2n3904, 2n2222, etc.) instead of the NDP6060L MOSFET.

The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

Go Up