Professional Documents
Culture Documents
GROUP MEMBERS
Equipment/materials:
Arduino UNO
Breadboard
Jumper wires
Potentiometer
Pc with Arduino IDE
Diagram:
Fig a
INTRODUCTION
A potentiometer is a manually adjustable variable resistor with 3 terminals. Two of
the terminals are connected to the opposite ends of a resistive element, and the
third terminal connects to a sliding contact, called a wiper, moving over the
resistive element. The potentiometer essentially functions as a variable resistance
divider. The resistive element can be seen as two resistors in series (the total
potentiometer resistance), where the wiper position determines the resistance ratio
of the first resistor to the second resistor. If a reference voltage is applied across
the end terminals, the position of the wiper determines the output voltage of the
potentiometer.
CODE;
float volt;
float input;
int raw;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
Serial.print("RAW DATA");
Serial.print(" ");
Serial.println("CONVERTED DATA");
}
RESULTS
COMMENT
As the potentiometer was varied the various values were displayed on the serial
monitor as shown above
EXPERIMENT TWO
Experiment title: Light Dimmer Using PWM and Potentiometer
Aim/Objective:
5. To know how to read analog inputs
6. To interface LED with an Arduino Board.
7. To be familiarized with Arduino Development Environment.
8. To write a simple program which dims an LED using a potentiometer.
9. To be conversant with Arduino Microcontroller Board.
Equipment/materials:
Arduino UNO
Breadboard
Light Emitting Diodes (LED)
1k Resistor
Jumper wires
Potentiometer
Pc with Arduino IDE
Diagram:
INTRODUCTION
PWM, which stands for Pulse Width Modulation, is a technique used to convert
digital voltages to apparent analog voltages. A microcontroller is a digital device
that can normally output either 0v or 5v (some microcontrollers may use 3.3v).
Consequently, any devices they power can either be switched off or on, even if
intermediate states are needed. Considering the LED, we might be required to
control its brightness, rather than simply switch it off or on.
Using PWM, a pin is selected and its voltage is switched between 5v & 0v
extremely fast, with the pin staying on each voltage for a variable amount of time.
This gives the effect of a voltage between 5 and 0 being present. Do keep in mind
that this needs to be done at an extremely fast rate, otherwise the desired effect will
not be produced. In this example below, a voltage of 2.5v needs to be generated
using 5v and 0v. Here is how the state of the pin will look after graphing it-
The pin is switched between 5v and 0v, staying on each for equal amounts of time.
This ratio of 1:1 gives the effect of the output being 2.5v. Once again, the amount
of time the pin stays on each state is extremely low (in the order of microseconds
or even lesser).
66% Duty Cycle
In this graph, the pin is set to 5v for twice as long as it is set to 0, i.e the ratio
becomes 2:1. This gives the illusion of 3.3v being present.
Few special digital IO pins, marked with a tilda (~) character before them are
capable of PWM natively, meaning they do not require manual programming. The
whole work of switching on and off at required frequency is handled internally.
For the Arduino UNO the digital pins 3,5,6,9,10 and 11 are PWM pins
Comment
As the potentiometer was varied the brightness of the LED kept increasing as
illustrated in the result above
Applications and Uses of LED control
Display Screens Brightness: When creating projects that include screens (such as
LED matrices, LCDs, or OLEDs), you may employ the potentiometer to regulate
the backlight brightness of the display. This might help you adjust readability in
different lighting situations.
Photography lighting setups frequently involve the use of LEDs to generate
numerous lighting effects. You may fine-tune the lighting parameters for better
photographic results by regulating LED brightness using a potentiometer.
Conclusion