You are on page 1of 5

1.

A. LED blinking using Arduino

Circuit Diagram:

Code:

int led = 13;

void setup()

pinMode(led, OUTPUT);

void loop()

digitalWrite(led, HIGH);

delay(1000);

digitalWrite(led, LOW);

delay(1000);

}
Experiment -1a.

AIM:
To conduct LED blinking Experiment using Arduino Uno board.

APPARATUS REQUIRED:

S.No. Name of the item Type Range Quantity


1. Ardunio UNO board UNO - 1
2. LED - - 1
3. Resistor - 220 ohm 1
4. Bread Board - 1 1
5. Connecting wires - - 10

PROCEDURE:

1. Connections are given as per the circuit diagram.


2. LED anode is connected to pin 13 through a 220 ohm resistor.
3. LED cathode is connected to the ground.
4. Power supply is given to the arduino board through usb cable or through external power
adaptor.

The procedure to transfer this code onto the Arduino is as follows :

1. Open Arduino IDE.


2. The sketch(code), which is case sensitive, is typed in the program area.
3. Press the Compile button, for compilation and any errors are identified
in this process and need to be rectified before the code is compiled.
4. Press the Upload button, to program the Arduino board with the
sketch.
5. During the uploading, the TX/RX LED will flash, indicating a
communication between the Arduino and the PC

Output Inference:

Result:
Experiment1. b

To conduct Push button switch based LED control experiment using Arduino Uno board.

Circuit diagram:
AIM:
To conduct an Experiment to control LED with push button using Arduino Uno board.

APPARATUS REQUIRED:

S.No. Name of the item Type Range Quantity


1. Ardunio UNO board UNO - 1
2. LED - - 1
3. Resistor - 220 ohm 1
4. Push button - - 1
5. Bread Board - 1 1
6. Connecting wires - - 10

Procedure:

1. Connections are given as per circuit diagram


2. LED anode is connected to pin 13 through a 220ohms resistor.
3. LED cathode is connected to ground.
4. Pin 2 is connected from +5V supply through a push button.
5. A 10K resistor is connected to pin 2 from ground.

The procedure to transfer this code onto the Arduino is as follows :

1. Open Arduino IDE.


2. The sketch(code), which is case sensitive, is typed in the program area.
3. Press the Compile button, for compilation and any errors are identified
in this process and need to be rectified before the code is compiled.
4. Press the Upload button, to program the Arduino board with the
sketch.
5. During the uploading, the TX/RX LED will flash, indicating a
communication between the Arduino and the PC
Code:

const int buttonPin = 2;


const int ledPin = 13;
int buttonState = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop()
{
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH)
{
digitalWrite(ledPin, HIGH);
}
else
{
digitalWrite(ledPin, LOW);
}
}

Output inference:

Result:

You might also like