loading
This instructable will show you how to make a basic strobe light with an arduino.

You need
- 4 leds (the code can be modified for more if you want)
- an arduino (i am using the UNO r3)
- a paperclip
- a computer with the arduino ide installed
- an A/B USB cable to plug the arduino into the computer
- possibly some pliers to help bend the paperclip

(sorry for the lack of pictures)

Step 1: Assemble the Board and Leds

put a paperclip in the digital ground pin and bend it down and across  for the led leads to touch. next put the positive lead (the longer one) in pin 7 so it also touches the paperclip. Repeat for pins 9, 11, and 13.

Step 2: Install the Program

download the sketch or copy and paste it into the ide. here it is:

//leds in pins 13, 11, 9, and 7 (to make it easy to put them on i did every other pin)
//use a paperclip for ground
void setup() {
  unsigned int delayvar = 100;//You can chane this but it wont do much
 
  pinMode(13, OUTPUT);  //define pins as output
  pinMode(11, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(7, OUTPUT);
  digitalWrite(13, HIGH);  //blink twice
  digitalWrite(11, HIGH);
  digitalWrite(9, HIGH);
  digitalWrite(7, HIGH);
  delay(delayvar);
  digitalWrite(13, LOW);
  digitalWrite(11, LOW);
  digitalWrite(9, LOW);
  digitalWrite(7, LOW);
  delay(delayvar);
  digitalWrite(13, HIGH);
  digitalWrite(11, HIGH);
  digitalWrite(9, HIGH);
  digitalWrite(7, HIGH);
  delay(delayvar);
  digitalWrite(13, LOW);
  digitalWrite(11, LOW);
  digitalWrite(9, LOW);
  digitalWrite(7, LOW);
  delay(delayvar);
   

}

void loop() {
  unsigned int strobespeed = 150;  //change for a different strobe speed
  pinMode(13, OUTPUT);//defineing pins as output
  pinMode(11, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(7, OUTPUT);
  digitalWrite(7, HIGH);
  delay(strobespeed);
  digitalWrite(7, LOW);// the led on pin 7 turns off when
  digitalWrite(9, HIGH);//the led on pin 9 turns on
  delay(strobespeed);
  digitalWrite(9, LOW);// this pattern continues
  digitalWrite(11, HIGH);
  delay(strobespeed);
  digitalWrite(11, LOW);
  digitalWrite(13, HIGH);// the strobe stops
  delay(strobespeed);
  digitalWrite(13, LOW); //and starts going the other way
  digitalWrite(11, HIGH);
  delay(strobespeed);
  digitalWrite(11, LOW);
  digitalWrite(9, HIGH);
  delay(strobespeed);
  digitalWrite(9, LOW);// repeats

}

Step 3: Things to Remember

You can edit this code to fit your needs (please give me credit if you use it in another instructable, i worked hard to make it from scratch)

If you have any question feel free to comment or message me, i will get back to you as soon as i can.
<p>little adjust to the code so it works fine</p><p>void setup() {</p><p> pinMode(13, OUTPUT); //define pins as output</p><p> pinMode(11, OUTPUT);</p><p> pinMode(9, OUTPUT);</p><p> pinMode(7, OUTPUT);</p><p>}</p><p>void loop() {</p><p> unsigned int strobespeed = 150; //change for a different strobe speed</p><p> digitalWrite(7, HIGH);</p><p> delay(strobespeed);</p><p> digitalWrite(7, LOW);// the led on pin 7 turns off when</p><p> digitalWrite(9, HIGH);//the led on pin 9 turns on</p><p> delay(strobespeed);</p><p> digitalWrite(9, LOW);// this pattern continues</p><p> digitalWrite(11, HIGH);</p><p> delay(strobespeed);</p><p> digitalWrite(11, LOW);</p><p> digitalWrite(13, HIGH);// the strobe stops</p><p> delay(strobespeed);</p><p> digitalWrite(13, LOW); //and starts going the other way</p><p> digitalWrite(11, HIGH);</p><p> delay(strobespeed);</p><p> digitalWrite(11, LOW);</p><p> digitalWrite(9, HIGH);</p><p> delay(strobespeed);</p><p> digitalWrite(9, LOW);</p><p> unsigned int delayvar = 100;//You can chane this but it wont do much</p><p>digitalWrite(13, HIGH); //blink twice</p><p> digitalWrite(11, HIGH);</p><p> digitalWrite(9, HIGH);</p><p> digitalWrite(7, HIGH);</p><p> delay(delayvar);</p><p> digitalWrite(13, LOW);</p><p> digitalWrite(11, LOW);</p><p> digitalWrite(9, LOW);</p><p> digitalWrite(7, LOW);</p><p> delay(delayvar);</p><p> digitalWrite(13, HIGH);</p><p> digitalWrite(11, HIGH);</p><p> digitalWrite(9, HIGH);</p><p> digitalWrite(7, HIGH);</p><p> delay(delayvar);</p><p> digitalWrite(13, LOW);</p><p> digitalWrite(11, LOW);</p><p> digitalWrite(9, LOW);</p><p> digitalWrite(7, LOW);</p><p> delay(delayvar);</p>
<p>I agree with Ugifer: plugging the LEDs straight into ground is forcing far too much current out of your board and although Arduinos can usually stand quite a bit of stress, your heat and power profile won't allow you to run this configuration for long. Using 220 ohms in series is typical for medium brightness, or down to 40 ohms if you're looking for more spark.</p>
<p>why do you define pins as out twice? you only need to do it in setup, then your pins are default output. also, why not connect all LEDS to the same pin?</p>
Use a male to female jumper wire to connect to GND pins.
If you are powering this off a normal 5V Arduino, I'm rather worried you may burn it out!<br><br>The Ardu' can only supply 40mA per pin max and even a white LED only drops about 3-3.5V. That means you need about another 40-50 Ohms minimum to avoid drawing more than the max rated current.<br><br>Other than that, it's a great idea - I might try with a pot' and a 1-watt LED (through a transistor) for a variable &quot;strobe light&quot; for tricks like suspended water drops from a dripping tap etc.
I have been powering it with the stantard usb so it is 5 volts. I havent had any problems, but i will check that out too see if i am overdrawring the power. I like the idea with the transistor, when you make it i would lIke too see it if you could post a picture or something.

About This Instructable

23,847views

22favorites

License:

Bio: I like to play with electronics, and take stuff apart. Sometimes i do woodworking projects with my dad.
More by tim127:Basic Arduino strobe light Adirondack Chair Zipline Brake 
Add instructable to: