Jump to content

Arduino LED Project


Recommended Posts

Project Description: A simple beginner Arduino project utilising a little bit of code, 2 LEDs and an Arduino.

Before starting the project...

Welcome to our first Arduino project where it's for mainly beginners and newbies to electronics. This is a simple LED project where modifications can be widely performed to change the output in time. An LED will be blinking rapidly and it's a great circuit for multiple LEDs. In a real life example, multiple LEDs can be used along with a modified code to suit the needs of attracting attention. For this circuit, you will need to have the Arduino IDE on your computer and have the following:
- 1 Arduino (the Keyestudio Uno is used in this example)
- 5 Jumper Wires (Male to Male)
- 2 10K ohm resistors
- 2 LEDs (any colour)
- 1 breadboard
- 1 USB Data Cable (depends on the Arduino)

Sponsor Link:

Please visit this link here for NextPCB's special offers.

Mounting the circuit

Before starting to mount the circuit, remove any power from your breadboard and Arduino for safety purposes. First, start by connect a wire from your breadboard's negative rail to Arduino's ground pin. Next, connect a wire at any column to digital pin 4 on your Arduino. Two rows below that wire on your breadboard, connect a 10K ohm resistor 4 pins left to your resistor on the same row. Above that, connect the anode of your a LED and connect the cathode to the next pin left. Above the cathode, connect a wire linking the cathode of LED to the negative rail of your breadboard. Right next to the ground linking wire, connect a wire going straight to digital pin 3 on your Arduino. Two pins below the wire, connect your second 10K ohm resistor to the third pin left of it. Above the resistor pin, connect an LED with the anode and place the cathode one pin right. Above the cathode, connect a wire directly to the negative rail of your breadboard. Please refer to the schematics and diagram down above.

About the code
This piece of code is very easy to understand as it's for absolute beginners. The code starts off by defining the two variables for each of the LEDs to pins 3 and 4. The next set of code describes the initial process of setting up the main program, this set of code is called the void setup. First, one LED is on, followed by the other, a delay of 200 milliseconds occurs, then both LEDs are off followed by another delay of 200 milliseconds. The second code lines are called the void loop, they go on forever, until power is not given. It starts off with one LED going on, waiting for 100 milliseconds, then another LED is set to HIGH. After, the first LED is turned off completely followed by another delay of 100 milliseconds before finishing off with the second LED set to LOW. There you have it, the full project complete.

Enjoy! Contact us for any inquiries!




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...