• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Your First Project With Arduino & External LED

By Abhishek Ghosh July 23, 2015 10:53 am Updated on July 23, 2015

Your First Project With Arduino & External LED

Advertisement

Here is How To Understand and Perform a Very Basic Action With Arduino UNO Board – This is Your First Project With Arduino & External LED. What most of the tutorial websites on these kind of guides is that, they never explain “behind the scene”. Unless you are understanding how the program is controlling, Arduino, Adafruit and other websites will control your purchases. We will show you some funny stuffs. You need to setup Arduino Board rightly with your Mac or other computer first.

 

Your First Project With Arduino : Required Hardware

 

We will need :

 

  1. We hope you have a basic electronics components kit. Actually we need only one LED and some resisters with resistance like 220Ω, 270Ω r up to  2.2KΩ. We can determine and measure the resistance of registers by previously written methods.
  2. A breadboard.
  3. Some Jumper Wires.
  4. It is good to have the YuRobot Breadboard Power supply to do a funny thing with it.

 

 

Your First Project With Arduino & External LED : Hardware Setup

 

Most basic setup will be :

Advertisement

---

  1. On the Arduino UNO board, you will find the panel with DIGITAL printed on the board. Push one Jumper Wire with both end males to that GND hole. It is better to use a Blue colored Jumper Wire for maintaining the basic rule.
  2. On the opposite side of the POWER panel on the board, you will find the panel with DIGITAL printed on the board. On the 13th number hole (there is corresponding numbering on the board), insert a Jumper Wire with both end males to that 13th hole. It is better to use a Red colored Jumper Wire for maintaining the basic rule. Connect it to the Breadboard’s positive side.
  3. LEDs have one leg of short length. This is negative or cathode.
  4. LEDs have one leg of bigger length. This is positive or anode.
  5. If we directly put the LED with matching connection directly on board, it will work, but it will die sooner or later. Thats why we need a resister.
  6. Resister will be on the positive side.
  7. If we use 220-270Ω resister it glow nicely, if we increase the resistance the LED will become dull.
  8. Complete the setup first.
  9. Then connect the Arduino Board to your computer and load provided example’s Blink program. External LED will blink too. You can play with the program in the way we have shown here.

Circuit diagram is like this (only the pin will be 13 not 9) :

Your First Project With Arduino & External LED

 

Your First Project With Arduino : Funny Thing

 

If you push the YuRobot Breadboard Power supply on the breadboard without connecting the power supply to board and the Red and Blue connection holes of breadboard with Arduino in the way we said, you actually need no LED, no register! The flow of electron is not controlled on this cheap power supply this board! The Power supply’s green LED starts to glow!

 

Your First Project With Arduino : Software Part

 

The Blink code provided is (we have not removed the commented out lines) :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://www.arduino.cc
 
  This example code is in the public domain.
 
  modified 8 May 2014
  by Scott Fitzgerald
*/
 
 
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}
 
// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

As we are initiating with pin 13 of Digital output of the Ardunio board:

Vim
1
pinMode(13, OUTPUT);

we are inserting the red colored jumper on 13th hole. If we change the value 13 to 8, we will change the position of the jumper to number 8 hole.

Try our program :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
  Modified Blink
  https://thecustomizewindows.com
 
  GNU GPL 3.0
  
*/
 
void setup() {
  pinMode(8, OUTPUT);
}
 
// the loop function runs over and over again forever
void loop() {
  digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(5000);              // wait for a second
  digitalWrite(8, LOW);    // turn the LED off by making the voltage LOW
  delay(500);              // wait for a second
}

We have set :

Vim
1
2
  digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(5000);              // wait for a second

the glow = delay(5000); to higher value but, off time :

Vim
1
2
  digitalWrite(8, LOW);    // turn the LED off by making the voltage LOW
  delay(500);

to very low – delay(500);

Now run this one and carefully look at the code :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int led = 8;
int brightness = 0;
int fadeAmount = 5;
void setup()  {
pinMode(led, OUTPUT);
}
void loop()  {
analogWrite(led, brightness);
brightness = brightness + fadeAmount;
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}
delay(30);
}

First, the program is “compressed”. If we use so much comments, empty lines, we will die in bigger program for space issue. Second we are using analogWrite here instead of digitalWrite. Arduino’s this C/C++ language is not what exactly hugely loved.

Basically Python is better and there are ways to use Python on Arduino plus we do not need so much jazzy graphical user interface. Its too much for us, one command line is enough for us.

Tagged With arduino for external led , ARDUINO LED CONNECTION , external port connected led to myrio project program
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Your First Project With Arduino & External LED

  • Arduino and LED Bar Display : Circuit Diagram, Code

    Here is a Guide Explaining the Basics, Circuit Diagram, Code on Arduino and LED Bar Display. LED Bar Display is Actually Like Multiple LED.

  • Mini Christmas Light With Arduino (Very Easy)

    Here is a Mini Christmas Light With Arduino as Project Which Needs 3 Resisters and 3 LEDs, No External Power Supply. It Has 2 Blink Effects.

  • How to Control Multiple Relays With Single Arduino ESP32?

    Before How to Control Multiple Relays With Single Arduino ESP32 Testing, You Need to Learn How to Create Multiple MQTT Channels & Fetch Data.

  • Arduino : Blink Two LEDs Alternatively

    Common Example of Arduino is To One LED. We Can Make Arduino To Blink Two LEDs Alternatively in Various Ways of Coding.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy