Introduction: The KITT-duino, DIY Larson Scanner With an Arduino

IMPORTANT: CODE IS NOW UPDATED. FIXES INCLUDE ADDING AN INTEGER VALUE TO MANIPULATE TIMING AND FIXING A DOUBLE-BLINKING LED.

Thanks.

It is my understanding that many Larson Scanners can only pulse from side to side. I felt that that needed to be changed, seeing as that in the newer (yet short-lived) Knight Rider series revival on NBC for about 1/2 of a real season, the iconic red lights would move from right to left and back, start on both sides to meet in the middle (and then return), go from left to right and back, to middle, and then repeat... I drew out in sequence how the LEDs will light up. The arrow indicates the direction the LEDs will light up.

This simple project for the Arduino will produce pretty good results for the time and money, and the code can be modified very easily, which will be detailed later...

Please share improvements on the code with me, this is my first Arduino project (other than the "Blink" tutorial) so I'd enjoy hearing where it could be better.

Now... Onto the materials list.

Also, please rate and comment if you have a minute. It is all very much appreciated.

Step 1: Materials

Assuming you already have an Arduino, there is very little to purchase... This will only require about $4.50 USD in materials and about 3 hours to make if you don't know how to solder well (like me) or maybe under an hour if you are very good at it.

Materials needed:

10 5mm LEDs, any color (I chose red in true KITT style and bought them for about $.05 a piece)
10 220 ohm resistors (Radio Shack part no. 271-1111)
1 Perf board (Radio Shack part no. 276-170)

Also,

Solder
Soldering Iron
1 ft CAT5 wire or 5.5ft 22 AWG wire
Wire stripper
Wire cutters


And of course, an Arduino. I used a Duemilanove for mine.

Step 2: Board Prep


To begin, plug in the Soldering Iron.. Let it heat up until you complete the following

1- Take the CAT5 wire, splice it down the side, and separate in into a bunch of little insulated wires.
OR,
1a- Cut the 22 AWG into 6 inch lengths

2- Strip one end of the wire to about 5mm copper showing. Strip the other ends at about 3mm. Repeat for a total of 11 wires

3- Snip the leads of the Resistors and the down a little so they are easier to work with on the board. DO NOT CUT THE LEDs... If you do, there's no easy way of telling anode from cathode
( + from - ) because from the factory, each LED has a long leg and a shorter leg. Shorter= negative, longer = postive.

FOR THE NEXT STEPS... I drew up a schematic and put a picture of it so if it will help you, that is how it is on the board.

4- Insert the LEDs into the board as shown. The actual gap between them is up to you. Every 3 holes worked for me. Fold the leads down to keep it in place. Make sure the negative side is going through a hole that is plated onto a long strip to connect with all other LED anodes.

5-Insert the one side of the resistor into a hole that is VERTICALLY inline with the cathode of each LED. Insert the other end in a hole that is over the gap with no holes. Make sure it isn't the bottom one. Bend the leads to make it stay.

6- Insert the little wires into the perf board by the 3mm stripped end, one below each resistor. This size will solder well and the 5mm side will fit into the pins on the Arduino. Tape these on, there won't be enough copper to bend it very well.

TIP- Alternate colors of wire (if using CAT5) so it is easier to troubleshoot connections later.

7- Insert one wire as a common lead at the top of the board connected to the anodes.

8- If it similar to the picture, flip it over (or put in some gentle sort of vise) and prepare to solder.


Step 3: Soldering and More Soldering

By now, the soldering iron should be very toasty. We'd better put it to use right about now...

Make sure all of the LEDs are parallel so they won't look zig-zaggy or something weird when they set. I "trued" mine to a tabletop side

Then, solder all connections, taking care not to join any lead to a copper conductor except the one it should be at. See picture for clarification. I connected some of the leads with solder and the built in copper conductors. Like I said, I am not very good at soldering so if you are, don't make the globs of solder so large. Note how the resistors are inline with the LEDs and in line with the small wire. This is key to the project so that when the Arduino turns one pin on, the other LED won't turn on by mistake...

DISCLAIMER- The board, joints, and leads will get very hot!!! Don't try to move anything on the board with your hands while there is hot solder on the board if you can help it.

Step 4: Code and Programming


Now for the actual Microcontroller part.

I have attached a .txt file with the code.

Fair warning, it looks weird but all operations are there. It should work fine.

If it doesn't work right for you, contact me and I will work on debugging it for you.

Note the two integer (int) values to manipulate timing. Much easier than a find and replace.

Now, upload this to your board and then connect the wires as shown on the next page...

Step 5: Wiring the Arduino to the Board


Twist the ends of the wires so that each one has a nice, slender, copper lead.

Insert each one into its respectable pin with the farthest left LED (according to my picture) being in Pin 13, next one to its right in Pin 12, and so on and so on. If done correctly, the furthest LED to the right will be in Pin 4.

Connect the common wire to the GND port on the Arduino.

Step 6: Testing And... Voila?


Now it is time to test everything. If you want to get fancy and technical, check all of your soldering with a multimeter and then correct it with another round of soldering. If you want to be low tech, plug the Arduino with the newly uploaded code to a power supply and let it run. make a note of which LEDs don't light up (by tracing the colored wire if you alternated colors) and then correct only those.

If there is no error, congratulations. You didn't make a mistake which means I must not have made a major one either. We should both be proud of ourselves. I posted a video of what should happen if it is correct. If you have Quicktime on your computer, you should be able to view it. If not, please let me know. The video is of the previous code but with this update, it should run better for you.


If you want more LEDs, get an Arduino MEGA and modify the code for yourself. I don't have any way of debugging it since I only have a Duemilavove.

Thanks for looking

Comments

author
neo18 (author)2012-02-13

led on pin 13 of the arduino is very dim
i changed numbers in program thinking it was pin 13
i did from 12-3 but same thing but on pin 12
can you help
Thanks
Daniel

author
shiharan (author)neo182016-10-25

Hi,

This is because by connecting a LED to PIN 13 makes it connecting a LED parallel to the onboard LED. As in the arduino you have a built in LED connected to PIN 13 of the micro, so if you connect another LED to PIN 13, that means you are connecting a led in parallel to the led on board, so the current consumption increases and the led is DIM! Change the pin

author
unonomehaha (author)neo182012-02-14

Hi,

Sorry to hear you are having problems... I don't have time to check the code again but if you have time to wait, I may be able to check it sometime later this week.

Did you use all 220 ohm resistors? If your pin 12 is a higher value resistor, it may be more dim than the others.

The code doesn't deal with PWM so I'm guessing its a hardware thing... I'll double check that though as I haven't edited the code for awhile and its not committed to my memory... Also. that individual led may have different specs than the rest because of manufacturing variances...

Let me know,

author
neo18 (author)unonomehaha2012-02-15

i have change led and resistors around same thing

author
unonomehaha (author)neo182012-02-16

I fixed the code on the last cycle but that should only reduce blinking of LED 4.

Maybe that 'll work for you; my board isn't set up to test this out so I can't say for sure.

As far as I can tell, all of the loops are at "thispin ++" so there shouldn't be any amperage change on that... Does it occur on the loop only of when it goes to and from the middle as well?

author
BBurak (author)2011-06-05

Hi,

i like your instructable. I want to ask you a question: im new to these things and if i use 100 ohms instead of 220, will it destroy my leds?

author
unonomehaha (author)BBurak2011-06-07

Glad you liked the instructable,

On an Arduino, the current is low enough that it will not necessarily destroy the LEDs entirely. It may, however, shorten its (LED) lifespan, and, adjust the brightness level.

The main reason to use a resistor on a project like this is because due to variances in LED manufacturing, many times, 2 LEDs are not exactly the same in terms of electrical requirements, unless you know that they came off of the same batch at the factory. The resistor is used as a precaution to ensure they won't burn out due to a manufacturing flaw or power surge.

In short, I would go ahead and use 100 ohm resistors. If it doesn't last very long, consider changing the resistors out on the board. But, I don't forecast any major problems in the future.

(note: the "Blink" tutorial for the Arduino gives a short explanation of using an LED on an Arduino. You can put the two leads right into the Arduino board and they will work as is done in the tutorial.)

author
BBurak (author)unonomehaha2011-06-13

Thank you so much for your reply which is full of valuable information. I will use 100 ohm resistors too. Good luck with your works.

author
BBurak (author)BBurak2012-02-02

Hi again, i tried your instructable with your arduino code. it only lit LEDs from pin 12 to pin 9 in a loop. Other LEDs didnt light up. I checked connections, LEDs, resistors and cables if they work fine or broken. They work fine by themselves separately. But couldnt do this together. I dont know so much about Codes of Arduino so i cant find if there is a code wrong somewhere. can you help me please? Thanks

author
BBurak (author)BBurak2012-02-02

Sorry for my ignorance but i solved my problem. I did this using a solderless breadboard and i thought the end rows (which are + and - ) are connected from top to bottom. But there is a distinction i saw. I put all LEDs one side of the board and voila :) . Thanks for this instuctable. This was my second Arduino work after blink and it helped me a lot for understanding basic things.

author
astroboy907 (author)2011-02-14

the video downloads as a .tmp file (does it to me to), but if you rename it as a .mpg file it runs fine in quicktime for me

author
unonomehaha (author)astroboy9072011-02-14

Yes, I did notice that... It worked for me on quicktime when my browser said "open with" and I chose quicktime. If this doesn't work for anybody else, let me know and I can try to fix it. Thanks!

author
Speedmite (author)unonomehaha2011-12-26

I opened the .tmp file with windows media player, worked great.

author
unonomehaha (author)Speedmite2012-01-11

Glad to hear it. Please note that while the code is updated, the video is not, so you may notice the one LED skipping a beat. That has been taken care of as far as I am aware.

author
Nurbit (author)2011-03-25

nice instructable.

A better way of altering values is to define them as an integer.
Here's how I would do it......

inside the setup area add "int value;"

void setup(){
int value;
}

This creates an address called value which you can then assign a value to.
(BTW, you don't have to call it value, you can call it Fred if you like)

Then inside the loop() area, add "value=1000;"
and then call on value later one.

E.g....

void loop(){

value=1000;


digitalWrite(13, HIGH); // set the LED on

delay(value);

next command.... etc......

}


That way, when you want to change the delay time (in this instance) then all you have to alter is the value of value/frank/whatever.

Hope this advice from one Arduino beginner to another helps, sorry if I've explained it badly.

Great first project though.

author
unonomehaha (author)Nurbit2011-10-30

Code is now updated to include an integer value. Thanks for the idea!

author
Dominion-Network (author)2011-07-01

I've noticed something when I've put this ible together on a breadboard, just using the back and forth (Not meet in middle) part of your code, the 13th LED blinks twice, any idea's on how to fix that?

author

Code is now updated to fix that. Thank you for the tip!

author
Robot Lover (author)2011-10-16

Instead of putting a resistor together with each LED, why not just put one on ground? It would save a lot of resistors.

author
unonomehaha (author)Robot Lover2011-10-26

Good question,

If you have various LEDs laying around, the odds are pretty good that they were not manufactured from the same "lot" or if you purchased a non-name brand of LEDs, there are variances in manufacturing that would cause each LED to draw a different current; yes, the variations are minimal. However, the difference in current draw is enough that sometimes, one LED will be brighter than the others. In my case, I used LEDs I had purchased from several manufacturers. To ensure even brightness between all of the lights, I put a resistor on each one. Hope that helps.

Also, I plan on updating the code with a cleaner revision sometime in the next week or so; check back for the most current code that will be debugged.

Thanks,

author
Robot Lover (author)unonomehaha2011-10-26

Excuse my earlier comment. I meant that you could use only a single resistor only if one LED is lit at a time. When I wrote the other comment, I didn't know that multiple LEDs were lit at the same time in your project. Thanks for the response!

About This Instructable

15,247views

23favorites

License:

More by unonomehaha:Learn Verilog: A Brief Tutorial Series on Digital Electronics Design with FPGAs and Verilog HDLHow to make/dye your own feather hair extensions in almost any vibrant colorThe KITT-duino, DIY Larson Scanner with an Arduino
Add instructable to: