PEMBUATAN SINYAL KODE SOS MENGGUNAKAN UNOARDUSIM | KELOMPOK 2 INFORMATIKA KELAS XII.I

3 min read 4 hours ago
Published on Oct 02, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial guides you through creating a SOS signal using Arduino. The SOS signal is a universal distress signal and can be utilized in various projects, from simple educational demonstrations to emergency signaling devices. By following the steps in this tutorial, you'll gain practical experience in coding and working with Arduino hardware.

Step 1: Gather Necessary Components

Before you start, ensure you have the following components:

  • Arduino Uno board
  • Breadboard
  • LED lights (at least 3)
  • Resistors (220 ohm or appropriate for your LEDs)
  • Jumper wires
  • USB cable for Arduino

Tips

  • Make sure your Arduino is installed with the latest software.
  • Check that all components are functioning properly before assembling.

Step 2: Set Up the Circuit

Follow these steps to connect the components:

  1. Connect the LEDs:

    • Place the LEDs on the breadboard.
    • Connect the longer leg (anode) of each LED to a digital pin on the Arduino (e.g., pins 2, 3, and 4).
    • Connect the shorter leg (cathode) to the ground (GND) through a resistor.
  2. Wire the Resistors:

    • Attach a resistor to each cathode leg to prevent excess current from damaging the LEDs.
  3. Connect to Power:

    • Use a USB cable to connect the Arduino board to your computer for power and programming.

Common Pitfalls

  • Ensure that the LEDs are correctly oriented (anode and cathode).
  • Double-check your connections to avoid short circuits.

Step 3: Write the Code

You'll need to write a simple program to create the SOS signal. The SOS signal consists of three short pulses, three long pulses, and three short pulses.

Sample Code

#define LED1 2
#define LED2 3
#define LED3 4

void setup() {
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
}

void loop() {
  sosSignal();
  delay(5000); // Pause before repeating
}

void sosSignal() {
  // Short signals
  for (int i = 0; i < 3; i++) {
    digitalWrite(LED1, HIGH);
    delay(250);
    digitalWrite(LED1, LOW);
    delay(250);
  }
  // Long signals
  for (int i = 0; i < 3; i++) {
    digitalWrite(LED1, HIGH);
    delay(750);
    digitalWrite(LED1, LOW);
    delay(250);
  }
  // Repeat short signals
  for (int i = 0; i < 3; i++) {
    digitalWrite(LED1, HIGH);
    delay(250);
    digitalWrite(LED1, LOW);
    delay(250);
  }
}

Explanation

  • The sosSignal function emits the SOS pattern using the LED connected to pin 2.
  • Adjust the pin numbers if you are using different pins.

Step 4: Upload the Code

  1. Open Arduino IDE: Start the Arduino IDE on your computer.
  2. Select Board and Port: Make sure to select the correct board type (Arduino Uno) and the port where your Arduino is connected.
  3. Upload the Code: Click the upload button (right arrow icon) in the IDE to transfer the code to your Arduino.

Practical Advice

  • Monitor the IDE for any errors during the upload process and troubleshoot if necessary.

Conclusion

You have successfully created a SOS signal using Arduino. This project not only enhances your understanding of basic electronics but also provides a foundation for more complex Arduino projects. Consider experimenting with different LED configurations or integrating sound components for a more advanced signal system. Happy coding!