filmov
tv
Read the Analog Voltage using Arduino online || Arduino Circuits || with Arduino Programming
Показать описание
The first steps is to wire up the Arduino to read voltage as determined by the resistance created by the photoresistor. You can simply wire your board according to the diagram (wire colors don't matter, but help with identification of purpose).
The A0-A5 pins on the Arduino enable you to read from or write to analog sensors, such as photoresistors, knobs (potentiometers), and temperature sensors. Here is the description of the analog pins from the Arduino website:
The Arduino board contains a 6 channel, 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit.
A photoresistor, also known as light-dependent resistor (LDR) or a photocell, works by limiting the amount of voltage that passes through it based on the intensity of light detected. The resistance decreases as light input increases - in other words, the more light, the more voltage passes through the photoresistor.
In order to take advantage of the photoresistor you will create a voltage divider - a passive linear circuit that splits the input voltage amongst two or more components (similar to a Y-splitter).
To create the voltage divider needed for this lesson you will:
Connect the voltage from the Arduino 5V pin (input voltage) to a circuit (using a breadboard).
Connect the input voltage to a static resistor (10k Ohm)
Establish a voltage divider coming out of the static resistor:
One route to the analog pin (A0)
One route to a variable resistor (the photoresistor)
Completing the circuit out of the dynamic resistor to ground.
As the photoresistor increases its resistance (lower light intensity) more of the input voltage coming out of the 10k Ohm resistor blocked and diverted to the A0 pin. That means that the less intense the light into the photoresistor the more resistance it creates, which in turn diverts more voltage to the A0 pin (the voltage has to go somewhere). Likewise, the more intense the light into the photoresistor, the less resistance it creates, which in turn means there is less voltage to divert to the A0 pin.
In short, the more voltage to the A0 pin, the darker it is.
Here are the specific wiring instructions (see the breadboard image attached to this lesson):
Photoresistor
Insert a photoresistor into the breadboard as shown in the diagram.
Resistor
Connect a 10k-Ohm resistor from one side of the photoresistor across a couple of rows.
The A0-A5 pins on the Arduino enable you to read from or write to analog sensors, such as photoresistors, knobs (potentiometers), and temperature sensors. Here is the description of the analog pins from the Arduino website:
The Arduino board contains a 6 channel, 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit.
A photoresistor, also known as light-dependent resistor (LDR) or a photocell, works by limiting the amount of voltage that passes through it based on the intensity of light detected. The resistance decreases as light input increases - in other words, the more light, the more voltage passes through the photoresistor.
In order to take advantage of the photoresistor you will create a voltage divider - a passive linear circuit that splits the input voltage amongst two or more components (similar to a Y-splitter).
To create the voltage divider needed for this lesson you will:
Connect the voltage from the Arduino 5V pin (input voltage) to a circuit (using a breadboard).
Connect the input voltage to a static resistor (10k Ohm)
Establish a voltage divider coming out of the static resistor:
One route to the analog pin (A0)
One route to a variable resistor (the photoresistor)
Completing the circuit out of the dynamic resistor to ground.
As the photoresistor increases its resistance (lower light intensity) more of the input voltage coming out of the 10k Ohm resistor blocked and diverted to the A0 pin. That means that the less intense the light into the photoresistor the more resistance it creates, which in turn diverts more voltage to the A0 pin (the voltage has to go somewhere). Likewise, the more intense the light into the photoresistor, the less resistance it creates, which in turn means there is less voltage to divert to the A0 pin.
In short, the more voltage to the A0 pin, the darker it is.
Here are the specific wiring instructions (see the breadboard image attached to this lesson):
Photoresistor
Insert a photoresistor into the breadboard as shown in the diagram.
Resistor
Connect a 10k-Ohm resistor from one side of the photoresistor across a couple of rows.