Project Four: Pattern, Blink 4 leds using Arduino board
Project Four: Pattern, Blink 4 leds using Arduino board will basically get you up and blink four leds using Arduino board in pattern. i.e Mpesa Display
Components
| Quantity |
Module/component |
Description |
price Range |
| 1 |
Arduino board (Uno)+Cable |
more |
1200-2500/= |
| 4 |
Resistor |
Any electronics supply store |
10-20/= |
| 4 |
LED |
From 1k Ω to 2KΩ |
10-20/= |
| 14 |
Connecting Wires (Jumpers) |
learn more |
50/= |
| 1 |
Breadboard |
learn more |
150/= |
Send us a request using the contact section if you don't have any.
Note: In this project, we are using 4 Resistors ( 1k resistor ), 4 Leds, Arduino pin 5, Pin 6, Pin 7, Pin 8 and Gnd pin to create a connection(Circuit)
A good example is the one in the picture below

1. Connect ground from the Arduino to the bottom row of the farthest right column breadboard this will be a shared line.
2. For LED1
a) Connect the resistor with one end with longer leg of led and the other end using wire on the arduino pin 6 (Arduino pin 6).
b) Connect an LED cathode (shorter leg) to ground.
3. For LED2
a) Connect the resistor with one end with longer leg of led and the other end using wire on the arduino pin 7 (Arduino pin 7).
b) Connect an LED cathode (shorter leg) to ground.
4. For LED3
a) Connect the resistor with one end with longer leg of led and the other end using wire on the arduino pin 8 (Arduino pin 8).
b) Connect an LED cathode (shorter leg) to ground.
5. For LED4
a) Connect the resistor with one end with longer leg of led and the other end using wire on the arduino pin 5 (Arduino pin 5).
b) Connect an LED cathode (shorter leg) to ground.
SKETCH
const int led1 =6; // one end led1 is connected to pin 7
const int led2 =7; // one end led2 is connected to pin 7
const int led3 =8; // one end led3 is connected to pin 7
const int led4 =5; // one end led4 is connected to pin 7
voidsetup()
{
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
}
void loop ()
{
// turn on each of the LEDs in order
digitalWrite(led1, HIGH);
delay(100);
digitalWrite(led2, HIGH);
delay(100);
digitalWrite(led3, HIGH);
delay(100);
digitalWrite(led4, HIGH);
delay(100);
// turn off each of the LEDs in order
digitalWrite(led1, LOW);
delay(100);
digitalWrite(led2, LOW);
delay(100);
digitalWrite(led3, LOW);
delay(100);
digitalWrite(led4, LOW);
delay(100);
}
Popular posts from this blog
Project Two: Blink led using Arduino board Project Two: Blink led using Arduino board will basically get you up and blink led using Arduino board. We assume you already understand project one: Light led using Arduino board. Components Quantity Module/component Description price Range 1 Arduino board (Uno)+Cable more 1200-2500/= 1 Resistor Any electronics supply store 10-20/= 1 LED From 1k Ω to 2KΩ 10-20/= 3 Connecting Wires (Jumpers) learn more 50/= 1 Breadboard learn more 150/= Send us a request using the contact section if you don't have any. Note: In this project, we are using 1 Resistor ( 1k resistor ), Led, Arduino pin 7 and Gnd pin to create a connection(Circuit) Project summary 1. From led Anode pin (longer leg) led Anode pin >>>Resistor end >>> then the other side of the resistor end to Pin 7(Arduino) 2. From led cathode (shorter leg) led cathode >>>Ground pin (Arduino GND) 3. Plug the power into the Arduino. Now copy the code belo...
Pulse Width Modulation(PWM) is a digital technology that uses the amount of power delivered to a device that can be changed. It generates analogue signals by using a digital source. For example, LED brightness is controlled using Pulse Width Modulation(PWM) Duty Cycle in PWM The duty cycle of the PWM signal refers to the ratio of the time that the signal is in a high(on) state over the total time it takes to complete one cycle. It is commonly expressed as a percentage or a ratio. The Arduino supports PWM on yourboard - pins 3, 4,5,9,10 and 11) at 500Hz. (500 times a second.) You can give it a value between 0 and 255. 0 means that it is never 5V. 255 mean is always 5V depending on your board type. To make this work you have call analogWrite() with the value. The ratio of“ON” time to total time is called the “duty cycle”. A PWM outputthatisONhalf the time is said to have a duty cycle of 50%. Example To control the brightness of an LED with Arduino with the PWM technique ch...
Installation instructions Requirement Arduino software , arduino board with cable Step 1: Download Arduino IDE Software. Download page on the Arduino Official website. You have to pick software, which is compatible with your operating system (Windows, IOS, or Linux). After your file download is complete, unzip the file. Step 2: Power up arduino board. Connect the Arduino board to your computer using the USB cable. The green power LED (labeled PWR) should glow. Step 3: Launching Arduino IDE. After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the folder, you can find the application icon with an infinity label (application.exe). Double-click the icon to start the IDE. Step 4: Now Open your first project. Once the software starts, you have two options − Creating a new project. Openning an existing project sample. To create a new project, select File >>>>>> New. Launching an existing project example, go to File >>>>...
Comments
Post a Comment