August 20th - Sound Sensor Unit Part 2

 Relays, Relays, Relays!

Other than that not much. Did some light soldering work, changed the board from a uno to a nano, and added the relay. Just routing the power out via a female plug connector I "borrowed" from an extension cord. So now my uncle can utilize anything that can be connected to a standard AC wall outlet. Plus, the relay is rated for 40 Amps, so there isn't much that can't be powered

I just am going to make a few functionality changes, so that if the sound ever goes over a certain point you would have to press a button to deactivate whatever device that has been connected. Not that hard, I can already imagine the code. Anyway speaking of the code, here's the script for this project. I didn't have time to draw a schematic, but I think it is very self explanatory.

  • int soundSensor = 2;
  • int relayPin = 3;
  • void setup() {
  •   pinMode(soundSensor, INPUT);
  •   Serial.begin(9600);
  •   pinMode(relayPin, OUTPUT);
  • }
  • void loop() {

  •   int SensorData = digitalRead(soundSensor);
  •   if (SensorData == 1) {

  •     digitalWrite(relayPin, HIGH);// set relay pin to HIGH
  •     Serial.println("Relay ON ");
  •   }
  •   else {
  •     digitalWrite(relayPin, LOW);// set relay pin to LOW
  •     Serial.println("Relay OFF ");
  •   }
  • }

  • Final Component List

    1 Arduino Nano

    1 Extension Cable
     
    A Bit of questionable soldering

    1 Relay (link)

    1 Sound Sensor (link)




    Comments

    Popular posts from this blog

    August 8th - My Custom Built PC

    May 25th - The Frog