Controlling UM3561 siren module from Arduino UNO

Upload the following program to your Arduino board. While uploading, Arduino board should be disconnected from the power source. While operating the siren, Arduino UNO and siren module should be powered from the same power source.

#define ENABLE 5  //  Control pin to BC847 base
#define SEL1_TRANS_BASE 2  // (CTRL1)  Base of transistor to which PIN 6 (SEL1) of UM3561 connected
#define SEL2_TRANS_BASE 3  // (CTRL2) Base of transistor to which PIN 1 (SEL2) of UM3561 connected
#define SEL1_BYPASS_GND 4  // (CTRL3) Base of transistor to which SEL1 connected for bypassing to GND

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(ENABLE, OUTPUT);
  pinMode(SEL1_TRANS_BASE, OUTPUT);
  pinMode(SEL2_TRANS_BASE, OUTPUT);
  pinMode(SEL1_BYPASS_GND, OUTPUT);
  
  digitalWrite(ENABLE, LOW);
}

// the loop function runs over and over again forever
void loop() {

  // Fire engine  SEL1 - HIGH, SEL2 - NC
  
  digitalWrite(SEL1_TRANS_BASE, LOW);    // UM3561 SEL1 becomes HIGH
  digitalWrite(SEL2_TRANS_BASE, HIGH);   // UM3561 SEL2 becomes NC
  digitalWrite(SEL1_BYPASS_GND, LOW);    // UM3561 SEL1 remains HIGH
  delay(6000);

  // Machine gun  SEL1 - LOW, SEL2 - HIGH
  
  digitalWrite(SEL1_TRANS_BASE, LOW);    // UM3561 SEL1 becomes HIGH
  digitalWrite(SEL2_TRANS_BASE, LOW);    // UM3561 SEL2 becomes HIGH
  digitalWrite(SEL1_BYPASS_GND, HIGH);   // UM3561 SEL1 becomes LOW
  delay(6000);

  // Ambulance    SEL1 - GND, SEL2 - NC
  
  digitalWrite(SEL1_TRANS_BASE, LOW);    // UM3561 SEL1 becomes HIGH
  digitalWrite(SEL2_TRANS_BASE, HIGH);   // UM3561 SEL2 becomes NC
  digitalWrite(SEL1_BYPASS_GND, HIGH);   // UM3561 SEL1 becomes GND
  delay(6000);

  // Police siren SEL1 - NC, SEL2 - NC

  digitalWrite(SEL1_TRANS_BASE, HIGH);   // UM3561 SEL1 becomes NC
  digitalWrite(SEL2_TRANS_BASE, HIGH);   // UM3561 SEL2 becomes NC
  digitalWrite(SEL1_BYPASS_GND, LOW);    // UM3561 SEL1 remains NC
  delay(6000);
}
0 0 vote
Article Rating

Published by

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
X