Home Arduino Projects Arduino Knight Rider Project

Arduino Knight Rider Project

by Nikodem Bartnik

The Knight Rider is one of the perfect Arduino projects for beginners. What is Knight Rider? It’s a set of LEDs that blinks one after another, Here is what the official Arduino page says:

We have named this example in memory to a TV-series from the ’80s where the famous David Hasselhoff had an AI machine driving his Pontiac. The car had been augmented with plenty of LEDs in all possible sizes performing flashy effects.

http://www.arduino.cc/en/Tutorial/KnightRider

So, we will make a blinking set of LEDs. You can find the code to make the Knight Rider on the Arduino page. Here we will attempt to show a simpler and shorter code. I will do a 10 LED version of it.

Let’s start with what we will need for this project, if you bought one of those Arduino starter Kits, you should find each of these components in the box:

Arduino Knight Rider Project

This project will particularly help you learn to use LEDs with Arduino and how to use for loops.

The first thing we have to do is connect everything together, below is a schematic with all the connections. I used 220Ω resistors but 200Ω resistors can work for this project as well.

Some people say you don’t need to use a resistor when connecting LED to Arduino, but that is not true. You always have to use a resistor when connecting LED to Arduino otherwise you can damage your Arduino and LEDs. So remember this: Whenever there is an LED, there must be a resistor.

Arduino Knight Rider Project

Put the negative leg (shorter one) of the LED in the negative bar of the breadboard and the positive leg in the breadboard row. then connect the resistor to the LED and the resistor with the Arduino using a male-male jumper wire. Do the same for all 10 LEDs. Don’t forget about Connecting the negative bar to GND of the Arduino.

Arduino Knight Rider Project

Now we can upload a program. Just keep in mind that when you want to upload the program, you have to disconnect jumper wires from pins 0 and 1 because they are shared with the UART communication pins RX and TX. It is impossible to upload a program on the board when LEDs are plugged into these pins.

After uploading, you should see the Knight Rider come to life. You can change its speed at the beginning of the code by changing the time_between_blinks value. You can also try to add more LEDs or change the code to make it more yours. For example, you can try to turn on 2 or 3 LEDs at once instead of just one.

You might also like:

Related Posts

1 comment

Ben August 10, 2017 - 1:02 pm

Great! easy one

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy