Okay, so recently I thought of an idea... why not make a knight rider program, and if it works ... make it look good and also make it on a circuit board? So that's what I did. I made a effective program for arduino that will simulate the Cylon/Night Rider lights.
So basically I made a program and a circuit.
uhh... so keep reading!

Step 1: Get the parts.

For this project you will need..
- an arduino duemilanove (anything that is roughly the same (size, shape , pin layout, program support, etc.))
- the program (you can copy it from the text here, or if my link works)
- header connectors, that fit in any breadboard, arduino ,etc. (I got them @ frys)
- 5 red leds- at ~3V (I only had white 5mm) -------- Do not get the giant red "super bright" 1cm long leds.
They are too big and are less powerful, trust me I have them right here and the white ones in this instructable are much much better, and brighter.
- 220 ohm resistor (I used 330 ohm, close enough) ------ Actually 100 ohm ones are the best.
- a circuit board or peg board i used Radio Shack Dual PC board 276-148
- wire (maybe, i bent the pins of the leds, so I didnt need any)
- A computer that can program your arduino (duh!)
- Solder + Iron
Okay so lets build it!
Nice instructable, although isn't the code a bit long? I wrote the code for the same function except its shorter.<br> <br> int led = 8;<br> int time = 50;<br> <br> void setup() {<br> &nbsp; for(led = 8; led &lt; 13; led++) { //declares the pins 8 - 12 as output pins<br> &nbsp;&nbsp;&nbsp; pinMode(led, OUTPUT);<br> &nbsp; }<br> }<br> <br> void loop() {<br> &nbsp; for(led = 8; led &lt; 13; led++) { //Main: function starts at pin 8, turns led on, waits 50ms, turns them off, waits 50ms, repeats same function for next led until it hits pin 13 (pin 13 is not part of the function) and starts at pin 8<br> &nbsp;&nbsp;&nbsp; digitalWrite(led, HIGH); //led on<br> &nbsp;&nbsp;&nbsp; delay(time); //wait<br> &nbsp;&nbsp;&nbsp; digitalWrite(led, LOW); //led off<br> &nbsp;&nbsp;&nbsp; delay(time); //wait<br> &nbsp; }<br> }
I love the pin declaration in that code. Very elegant :)
I love this tutorial. I just bought an Arduino and I plan on making this my first project... past &quot;hello world&quot;. Appreciate that you posted, thanks! Did you have your son/daughter draw the Arduino and schematic in step 2? Just kidding. <br />
Umm... I recently got paint.net and was new to it, and didn't have a good program for schematics... and I'm only 13... so...<br />
Ha, ha! Well, being that you are 13 and can make something like this, it isn't important for you to master drawing. Mastering electronics seems more pertinent. By the way, the project worked out perfect and was easier than I thought it would be. Thanks again.<br />
Good job.&nbsp; Interesting code.&nbsp; At first I thought you coulnd't code a counter, but your's is certainly an interesting take on the code.&nbsp; I would imagine changing the time could have some interesting effects with POV?
Hi im going to buy an arduino soon i guess (just starting with mic's) and i would like to know how much output does it give when you wrote:<br /><br />digitalWrite(pinled1, HIGH);<br /><br />HIGH ?&nbsp;how much is the voltage and amperage<br /><br />and how much is LOW<br />can you controll them with code or you have to do it hardware way ?<br />
Congrats! <br />Arduino Rocks!<br />Okay so <br />HIGH means ON and is 5V at 40milliamps, although some pins have built in resistors so check before you run the program, FYI the one that I have has a resistor on pin 13, but i'm not sure about any others.<br />LOW means Off... so yeah, it either gives ground or just 0V....<br />Hope that helps.<br />--Chris<br />What type of Arduino are you getting<br />
it think ill buy duemilinova if i spelled it correctly<br />
Well, if you are going to do BIG&nbsp;projects, I would say get aArduino Nano. If small stuff like this (Knight rider) a duemilinovewould be good, or if you want you could try out one that i had beforeits called, Seeduino, (from seeed studio depot) it has same functions,same pin layout as the duemilinove, Just the Atmel ATmega chip is SMD(surface mounted)<br /><br />Good luck with with your arduino<br /><br />Any questions? Feel free to ask!<br />
so you're saying nano is better than duemilinove&nbsp;?<br />
If you need lots of work space You should get the NANO, If you do smallstuff like Blinks and led chasers. The duemillinove is good. Theduemillinove is probably most used because it can have shields such asthe Ethernet shied, Proto Shield, Xbee shield.... and more. But nano isalways good for BIG&nbsp;BREADBOARDING&nbsp;AREA!<br /><br />Good luck, Select wisely.<br /><br /><br />Any questions? Feel Free to ask!<br />
I can see that you are a begginer on the Arduino ( Not to worry, I even started like this ).<br /><br />So this is the Answer to your question:<br /><br />As you know, the arduino code goes like this ( the last bit )<br /><br />void loop()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />{<br />&nbsp; digitalWrite(ledPin, HIGH);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp; delay(1000);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp; <br /><em>What (ledPin, HIGH) does not mean the voltage and power is high, it simply means that The Object you are powering is turned <strong>ON</strong>.<br /></em><br /><br />digitalWrite(ledPin, LOW);&nbsp;&nbsp;&nbsp; <br />&nbsp; delay(1000);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />}<br /><br /><br /><em>Same with the (ledPin, LOW)</em>, Low just simply means that it is turned <strong>OFF</strong>.<br /><br /><br /><strong><em>Yea its pretty stupid, but its how it is programmed, Any question? Feel free to ask. In the meantime Have a look at this, it might help you. It will be able to tell you most of the stuff:<br /><br />http://arduino.cc/en/Reference/HomePage<br /><br /><br /></em></strong><br />
thanks for pointing it out :)<br />I will look at the reference when i will get an arduino in my hand ;]<br />the last question i want to ask is :<br />Is this c/c++ ? <br />if yes than can it be used with STL or any other libraries of c/c++<br /><br />
Yes this is C++ and no it can be used with Some C++ librarys, but not many<br />
For the schematics, You could Use ~ExpressPCB~ (it also has schematic maker).<br />
I would recommend that you paint your schematics with eagle (www.cadsoft.de) or fritzing (www.fritzing.org). Both are free and platform independent.
Here, I made one. I added resistors in the proper places too. The way you had them hooked up, you could only light up one or two at a time without burning out your LED's.
Cool thanks! Are you sure that the thing would burn out the way I hooked it up? I did not know that...
Well, they'd draw too much current and would have shortened lives. I'm pretty sure that's how I've ruined a couple of my LED's.
Well I decided to make this dirt cheap and ... well more DIY-ish.. so yeah but you saw the circuit.. maybe later... lets see.... See Ya!
Last time i checked...The arduino software already came with an example containing this... But other than than, Neat, Though i do have one unrelated question. Why is the image in the last step so high quality? how did you bypass the low quality jpeg conversion?
This one has a different pattern the other one goes 1 2 3 4 ... mine goes 1 12 2 23 3 34 4 ..... and so on
I didn't know the Arduino had a 23'rd and 34'th pin O_o
Oh, they dont.. I meant that it turns on 1 1 & 2 3 3 & 4 4 and so on
Erm...it doesn't really make sense, you mean that the light would change position by fading?
So what the transition does is it turns on the leds (just on or off pins 8 and 12 arent PWM pins) 1 then 1 and 2 2, etc. Just try out the code and compare it to the example, but either way both codes are compatible, just make sure it is meant for leds connected to pins 8- 12, and see which is best. So, I'm trying to say is well the transition is a little bit slurred, not faded but it looks smooth. Hope that helps
Oh OK thanks :D

About This Instructable


27 favorites


More by chrisapalo: Counting Circuit to 99,999 The arduino rider. The Lighted Fume Extractor
Add instructable to: