Table of Contents

Light Amplification

Introduction

====== Brief presentation of your project : ======

  • what it does

Potentiometer Control LED Light

  • what is its purpose

Here introduces the Arduino analog input function, which controls the brightness of the LED light by reading input voltage values through a potentiometer.

Hardware Design

The analog input is a pin with ADC (Analog-to-Digital Converter) function. It can convert the externally input analog signal into a digital signal that can be recognized during chip operation, so as to realize the function of reading in the analog value. The Arduino analog input function has 10-bit precision, that is, it can convert a voltage signal of 0 to 5V into an integer form of 0 to 1024. Utilize the analogRead() function to read input voltage values by the potentiometer, and then use the analogWrite() function to control the brightness of the LED light.

==== Experimental Materials ====

  1. 1x Uno R3 development board
  2. 1x Bread board and supporting connecting line
  3. 1x 220Ω current limiting resistor
  4. 1x LED
  5. 1x potentiometer
  6. Supporting USB data cable

The potentiometer is an adjustable resistor, and its operating principle is shown in the following figure:

Move the position of pin 2 by rotating the knob, changing the resistance value from pin 2 to both ends. In the experiment, connect pin 1 and pin 3 to the 5V GND of the development board, and then read the voltage of pin 2 obtained by the potentiometer through the analog input pin A0, and the range is between 0V to 5V.

Experimental Steps

1) Build the circuit according to the schematic diagram

Connect the positive pole of the LED lamp to the current limiting resistor, connect the other end of the resistor to the 10th pin of the development board, and connect the negative pole of the LED lamp to the GND of the development board. Pin 1 and pin 3 of the potentiometer are connected to the development board 5V and GND respectively, and pin 2 is connected to the A0 pin of the development board.

The experimental schematic diagram is as follows:

The physical connection diagram is shown in the figure below:

Software Design

I created a new Sketch

And then I Connected the development board, set the corresponding port number and development board type, and download the program.

Experimental Result

Rotating the potentiometer knob changes the brightness of the LED light.

Function Introduction

analogRead() Description: Read the value of the specified analog pin.

Function prototype: analogRead(pin)

Parameter: Analog input pin

Return value: an integer between 0 to 1024

map() Description: Map data from one range to another.

Function prototype: map(value, fromLow, fromHigh, toLow, toHigh)

parameter:

value: The data to be mapped.

fromLow: The lower limit of the current range.

formHigh: The upper limit of the current range.

toLow: The lower limit of the target range.

toHigh: The upper limit of the target range.

Return value: Remapped data

Experimental Analysis

The program uses the analogRead() function to read the analog input value, and the input value range is between 0 to 1024. Then use the analogWrite() function to change the LED light duty cycle, and the duty cycle range is 0 to 255. Remap the range by using the map() function.

Results Achieved

What were the results of the implementation your project.

Download

CODE :

code.zip

All Files , Images and Results i used

light_amplification_imane_farabi_1221ea.zip

Export to PDF