Introduction to Arduino
Let’s start by understanding what Arduino is and what it can do for you as a beginner in electronics.

Installing the Arduino IDE
Before you can start programming Arduino, you need to install the Arduino IDE — the official development environment.

Blink: Your First Arduino Project
Let's build your first real Arduino project — make an LED blink!

Understanding Arduino Code Structure
Learn how Arduino code is structured and how setup() and loop() work together.

Working with Digital Output
Learn how to control components like LEDs, buzzers, and relays using digital pins.

Working with Digital Input
Learn how to use buttons and switches with Arduino and respond to user input.

Working with Analog Input
Learn how to read variable values from sensors using analog pins.

Working with Analog Output (PWM)
Use analogWrite() to control brightness, speed, and more with Pulse Width Modulation.

Final Assessment & Certificate
Take this final quiz to test your knowledge. Score 71% or more to earn your certificate!

Controlling LED Brightness with a Potentiometer
About Lesson

Let’s combine analog input and analog output:
Use a potentiometer to control the brightness of an LED in real time.

🔧 What You Need:
– 1× LED
– 1× 220Ω resistor
– 1× Potentiometer
– Arduino Uno
– Jumper wires

🔌 Wiring:
– LED: Anode → D9, Cathode → 220Ω resistor → GND
– Potentiometer:
– Middle pin → A0
– Side pins → 5V and GND

💻 Code Example:

void setup() {
pinMode(9, OUTPUT); // LED on PWM pin
}

void loop() {
int sensorValue = analogRead(A0); // Read potentiometer (0–1023)
int outputValue = map(sensorValue, 0, 1023, 0, 255); // Scale to PWM
analogWrite(9, outputValue); // Set LED brightness
}

💡 This is a live analog input → PWM output system.
Turn the knob → LED gets brighter or dimmer.

✅ Try changing the output pin, using a buzzer, or controlling motor speed.

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare