Seminar Topics & Project Ideas On Computer Science Electronics Electrical Mechanical Engineering Civil MBA Medicine Nursing Science Physics Mathematics Chemistry ppt pdf doc presentation downloads and Abstract

Full Version: Analog Input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[attachment=74138]


In this example we use a variable resistor (a potentiometer or a photoresistor), we read its value
using one analog input of an Arduino or Genuino board and we change the blink rate of the
built-in LED accordingly. The resistor's analog value is read as a voltage because this is how the
analog inputs work.
Hardware Required
Arduino or Genuino Board
Potentiometer or
10K ohm photoresistor and 10K ohm resistor
built-in LED on pin 13 or
220 ohm resistor and red LED
Circuit
With a potentiometer click the image to enlarge



Connect three wires to the Arduino or Genuino board. The first goes to ground from one of the
outer pins of the potentiometer. The second goes from 5 volts to the other outer pin of the
potentiometer. The third goes from analog input 0 to the middle pin of the potentiometer.
For this example, it is possible to use the board's built in LED attached to pin 13. To use an
additional LED, attach its longer leg (the positive leg, or anode), to digital pin 13 in series with the
220 ohm resistor, and it's shorter leg (the negative leg, or cathode) to the ground (GND) pin next
to pin 13.
The circuit based on a photoresistor uses a resistor divider to allow the high impedence Analog
input to measure the voltage. These inputs do not draw almost any current, therefore by Ohm's
law the voltage measured on the other end of a resistor connected to 5V is always 5V, regardless
the resistor's value. To get a voltage proportional to the photoresistor value, a resistor divider is
necessary. This circuit uses a variable resistor, a fixed resistor and the measurement point is in
the middle of the resistors. The voltage measured (Vout) follows this formula:
Vout=Vin*(R2/(R1+R2))
where Vin is 5V, R2 is 10k ohm and R1 is the photoresistor value that ranges from 1M ohm in
darkness to 10k ohm in daylight (10 lumen) and less than 1k ohm in bright light or sunlight (>100
lumen).