Experiment 6

Intensity variation of LED based on potentiometer value

Objective – Use the potentiometer to change the red LED intensity from 0 to maximum in 256 steps.

Pre-Requisites – Arduino Nano (ATmega328P-PU), Mini USB cable, 12V DC Adapter, Software Setup (as described in introduction)

Theory – Generating a particular intensity for a given LED involves turning the LED ON and OFF for a particular rate so that LED is observed as constantly ON. Providing a digital signal with different ON and OFF time is also referred to as pulse width modulation (PWM). Intensity of the LED will be based upon the LED ON, LED OFF and total duration the pulse, this can also be defined using DUTY CYCLE.


Intensity of the LED is directly based upon the duty cycle. Increase in duty cycle leads to increase in the intensity. The total variation available in the intensity will be based upon the unit width of ON TIME.

Different duty cycle based upon ON and OFF time of digital signal

In the given experiment, the value for intensity selection is based upon the analog reading received from potentiometer. The analog value provided by the potentiometer will vary between 0V to 5V. The ADC module of the microcontroller will provide with corresponding value between 0 and 1023. The value received from the ADC need to mapped between the value from 0 to 255, hence providing 256 steps of intensity variation.

The hardware connections are discussed in connection/schematic part.