SOS Signal With an Arduino
Intro: SOS Signal With an Arduino
This project is perfect for bigginers (like me)
This is my first instructable and first arduino project so feel free to improve some stuff (like the programming) and correct me.
STEP 1: Gather Your Parts
An Arduino (i have a duemilanove) Cost about 30 dollars
An LED (if you have the arduino that i have you can use the on board LED on pin 13) Cost about 2 dollars
A USB cable (for the arduino DUHHHH)
The tools that need are:
a Brain :) ,the most powerfull tool of all time
STEP 2: Learn a Bit of Morse Code
First you need to learn a bit of Morse Code (to id the S and O)
-first of all a O reprents 3 long flashes
-secondly when you add a new letter thiere will be a 3 second delay
-thirdly a S is 3 short flashes
STEP 3: Connecting Up Stuff and Uploading
Connect the usb to your arduino and cannect the led to pin 12 (13 if your using the on board led)
Than when your done that copy and paste the sketch
// This sketch will allow cause a led to do a SOS signal
int ledPin = 12; // LED connected to digital pin 12
// The setup() method runs once, when the sketch starts
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(3000); // 3 second delay wich acts 1: before loop to make sure your ready and 2: act as a delay for when it starts all over again :)
digitalWrite(ledPin, HIGH); //"S" signal starts after the one second delay
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(3000); //3 second delay for the second letter (fisrt of 2)
digitalWrite(ledPin, HIGH);
delay(3000); // First dash of 3 wich represents the O
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(3000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(3000);
digitalWrite(ledPin, LOW);
delay(3000); //second 3 second delay for the third letter
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(500);
digitalWrite(ledPin, HIGH);
}
9 Comments
BrunoG 14 years ago
scratchndent 7 years ago
handy
Asik 8 years ago
It is a short code and more convenient to adjust !
// This sketch will allow cause a led to do a SOS signal
int ledPin = 5; // LED connected to digital pin 12
int s = 300; // 0,3 second delay for 'S' letter
int o = 800; // 0,8 second delay for 'O' letter
int pause = 100; // 0,1 second delay between letters
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT);
}
void character(int speed, int pause) {
for (int i = 1; i <= 3; i++) {
digitalWrite(ledPin, HIGH);
delay(speed);
digitalWrite(ledPin, LOW);
delay(300);
}
delay(pause); //delay between letters
}
void loop() {
character(s,pause);
character(o,pause);
character(s,pause);
delay(2000); //2 seconds delay for after the word SOS
}
geniusbomberman 14 years ago
D5quar3 14 years ago
boghy933. 9 years ago
I paid 3$ for arduino nano, lol. I saw on amazon 100 led's for 2$...
arduino=awsome 14 years ago
i would never pay 2 dollars 1 led :)
Vaidotas 12 years ago
https://www.instructables.com/id/EWOQX31H0OJ0WDP/?ALLSTEPS
leotcol 14 years ago
Good instructable.