You Want Electronic Components for your project. 

For more information, contact us at: 

4.4 Controlling LEDs

4.4.1 Light Emitting Diode

An LED (Light Emitting Diode) is an electronic component that produces light when current flows through it in the correct direction.

LEDs are commonly used in Arduino projects as indicators or simple output devices.

A typical LED circuit requires:

  • Arduino board
  • LED
  • Current-limiting resistor
  • Jumper wires
  • Breadboard

The resistor is used to limit current and protect the LED.

4.4.2 Basic LED Control

Example:

int ledPin = 13;

 

void setup() {

  pinMode(ledPin, OUTPUT);

}

 

void loop() {

  digitalWrite(ledPin, HIGH);

  delay(1000);

 

  digitalWrite(ledPin, LOW);

  delay(1000);

}

4.4.3 Controlling LED Brightness

PWM can be used to control LED brightness.

int ledPin = 9;

 

void setup() {

  pinMode(ledPin, OUTPUT);

}

 

void loop() {

  analogWrite(ledPin, 50);

  delay(1000);

 

  analogWrite(ledPin, 150);

  delay(1000);

 

  analogWrite(ledPin, 255);

  delay(1000);

}

The LED will produce different brightness levels.

4.4.4 Applications of LEDs

LEDs can be used to indicate:

  • Power status
  • Sensor activation
  • Warning conditions
  • System errors
  • Communication status
  • Alarm conditions
  • Device operating modes

I am an ICT enthusiast and software developer with interests in web development, networking, embedded systems, and the Internet of Things (IoT). I enjoy building innovative technology solutions, learning new skills, and using technology to solve real-world problems. I am committed to continuous learning, professional growth, and delivering quality work.and also i have 3 years of teachining and developing iot project.