Pages: [1]   Go Down
Author Topic: Help with digitalWrite  (Read 450 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Thanks
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

http://ruggedcircuits.com/html/circuit__7.html

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
Logged

Pages: [1]   Go Up
Jump to: