top of page

Fading Brightness of a LED using Arduino

Updated: Mar 19


In this project, we will see how to change the brightness of LED using the Arduino UNO. Arduino does not have a built-in Analog to Digital converter. But, it can Pulse Width Modulate a digital signal to achieve some of the functions of an Analog output. Digital control is used to create a square wave and this square wave can be switched ON & OFF. These ON & OFF patterns can simulate voltages of 5V and 0V respectively.


Pulse-width modulation (PWM) is a method of reducing the average power delivered by an electrical signal by changing the duty cycle.


Duty Cycle is defined as the ratio of the digital ' high ' period to the total sample period.

Duty Cycle = Ton/(Ton+Toff)


As you can see in the image above, the average output voltage is zero with 0% duty cycle and it increases with an increase in duty cycle and is maximum at 100% duty cycle.


In this project, we will control the PWM of LED (i.e., illumination intensity can be controlled) by varying the duty cycle.



Hardware requirements:

Arduino UNO:

Arduino UNO
Arduino UNO

The Arduino is a programmable #microcontroller, it's an open-source electronics proto-type platform. It interacts with the user by receiving input with the aid of sensors and provides the output employing LED, buzzer, etc.,


In order to know more about the Arduino UNO, refer to this article.


Breadboard:

Breadboard
Breadboard

A #breadboard is a flat piece of wood that is provided with holes that allow users to build a circuit including the components and connections without the need for soldering due to which it is reusable and finds its best usage for the students who are new to build circuits. The holes in any horizontal line will be in series whereas the vertical holes remain at an equipotential state. There are different sizes of breadboards available in the market which include "full size", "half-size" and, "mini-size" breadboards.


LED:

LED's
LED's

LED is a semiconductor light source that emits light when a current passes through it. Electrons in the semiconductor combine with holes by passing through the gap which inturns release energy in the form of photons.


Resistor:

220 - ohm resistor
220 - ohm resistor

A Resistor as the name signifies opposes the flow of electrons. The Resistor is a passive element and has two terminals. They are used to monitor the current flow and also as voltage dividers. The #resistor that we would use in this circuit is a 220-ohm resistor and the color code for this resistor is Red, Red, Brown & Gold.


Jumper wires:

Male - Male Jumper wires
Male - Male Jumper wires

Connecting wires are used to establish connections between different components in the circuit.


Software requirements:


Arduino IDE:

Arduino IDE - Logo
Arduino IDE - Logo

The Arduino Integrated Development Environment (IDE) is a cross-platform application (for Windows, macOS, Linux) that is written in functions from C and C++. It is used to write and upload programs to Arduino compatible boards, but also, with the help of third-party cores, other vendor development boards.


Circuit Diagram and its Working:



Circuit connection involves the following steps:

  • The cathode of the LED is connected to the ground pin of the Arduino UNO.

  • The anode of the LED is connected to digital PWM PIN number 9 of the Arduino through a 220 - ohm resistor.

Code



Project By - Anupama Koley and edited by Neha Patil



 

See also:





















Follow us -


Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes and contests.



Content Written by-


Name - Kiranmai Chigurupati

Portfolio Link - click here

Related Posts

See All

2 Comments


Informative and concise! LearnElectronics India always delivers quality content.

Like

Anushka Gupta
Anushka Gupta
Jul 21, 2023

Absolutely loved the blog! As someone new to Arduino and electronics, I found it incredibly helpful. The combination of theoretical explanations and practical examples is perfect for gaining a deeper understanding. Learn Electronics India has done a fantastic job here.

Like
bottom of page