0% found this document useful (0 votes)
14 views6 pages

Tinker Cad Simple Circuits

The document outlines various simple circuits using Arduino, including blinking one LED, two LEDs together, and two LEDs alternatively. It also covers fading LEDs using PWM and a combination of blinking and fading. Each section includes objectives, components used, block diagrams, and corresponding code snippets.

Uploaded by

sub81466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views6 pages

Tinker Cad Simple Circuits

The document outlines various simple circuits using Arduino, including blinking one LED, two LEDs together, and two LEDs alternatively. It also covers fading LEDs using PWM and a combination of blinking and fading. Each section includes objectives, components used, block diagrams, and corresponding code snippets.

Uploaded by

sub81466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

TINKERCAD SIMPLE CIRCUITS

1. Blinking of One LED

Objective:
To blink a single LED connected to pin 13 of the Arduino board.

Components Used:
• - Arduino Uno
• - 1 x LED
• - 1 x Resistor (220Ω)
• - Breadboard
• - Jumper wires

Block Diagram:

[Arduino UNO]
|
Pin 13
|
[Resistor]
|
[LED]
|
GND

Code:

void setup()
{
pinMode(13, OUTPUT);
}

void loop()
{
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
2. Blinking of 2 LEDs Together

Objective:
To blink two LEDs simultaneously using digital pins 12 and 13.

Components Used:
• - Arduino Uno
• - 2 x LEDs
• - 2 x Resistors (220Ω)
• - Breadboard
• - Jumper wires

Block Diagram:

[Arduino UNO]
| |
Pin13 Pin12
| |
[Resistor][Resistor]
| |
[LED] [LED]
| |
GND GND

Code:

void setup()
{
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}

void loop()
{
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
delay(1000);

digitalWrite(12, LOW);
digitalWrite(13, LOW);
delay(1000);
}
3. Blinking of 2 LEDs Alternatively

Objective:
To blink two LEDs alternately using digital pins 12 and 13.

Components Used:
• - Arduino Uno
• - 2 x LEDs
• - 2 x Resistors (220Ω)
• - Breadboard
• - Jumper wires

Block Diagram:

[Arduino UNO]
| |
Pin13 Pin12
| |
[Resistor][Resistor]
| |
[LED] [LED]
| |
GND GND

Code:

void setup()
{
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}

void loop()
{
digitalWrite(12, LOW);
digitalWrite(13, HIGH);
delay(1000);

digitalWrite(12, HIGH);
digitalWrite(13, LOW);
delay(1000);
}
4. Fading of LED

Objective:
To gradually increase the brightness of an LED using PWM on pin 9.

Components Used:
• - Arduino Uno
• - 1 x LED
• - 1 x Resistor (220Ω)
• - Breadboard
• - Jumper wires

Block Diagram:

[Arduino UNO]
|
Pin 9 (PWM)
|
[Resistor]
|
[LED]
|
GND

Code:

void setup()
{
pinMode(9, OUTPUT);
}

void loop()
{
for(int b=0; b<=255; b=b+5)
{
analogWrite(9, b);
delay(100);
}
}

5. Fading of 2 LEDs Together

Objective:
To gradually increase the brightness of two LEDs simultaneously using PWM on pins 9 and
10.
Components Used:
• - Arduino Uno
• - 2 x LEDs
• - 2 x Resistors (220Ω)
• - Breadboard
• - Jumper wires

Block Diagram:

[Arduino UNO]
| |
PWM9 PWM10
| |
[Resistor][Resistor]
| |
[LED] [LED]
| |
GND GND

Code:

void setup()
{
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}

void loop()
{
for(int b=0; b<=255; b=b+5)
{
analogWrite(9, b);
analogWrite(10, b);
delay(100);
}
}

6. One Blinking and One Fading LED

Objective:
To fade one LED using PWM on pin 9 and blink another LED on pin 13.

Components Used:
• - Arduino Uno
• - 2 x LEDs
• - 2 x Resistors (220Ω)
• - Breadboard
• - Jumper wires

Block Diagram:

[Arduino UNO]
| |
PWM9 Pin13
| |
[Resistor] [Resistor]
| |
[LED] [LED]
| |
GND GND

Code:

int b=0;
void setup()
{
pinMode(9, OUTPUT);
pinMode(13, OUTPUT);
}

void loop()
{
if(b <= 255)
{
analogWrite(9, b);
delay(100);
b = b + 5;
}
else
{
b = 0;
}

digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
}

You might also like