Page41
Component:
Image Reference:
+
-
+
-
h20
h21
LED
(5mm)
Photo Resistor
j1
Jumper Wire
j6
+
Jumper Wire
Jumper Wire
GND
Jumper Wire
5V5V
+
330
Ω
Resistor (sensor)
j21
+
10K
Ω
Resistor
i1
i5
Jumper Wire
A0
j5
f5
f6
Jumper Wire
Pin 9
j20
Many of the sensors you'll use (potentiometers, photoresistors, etc.) are resistors in disguise. Their resistance changes in proportion to whatever they're sensing (light level, temperature, sound, etc.).
The RedBoard's analog input pins measure voltage, not resistance. But we can easily use resistive sensors with the RedBoard by including them as part of a "voltage divider".
A voltage divider consists of two resistors. The "top" resistor is the sensor you'll be using. The "bottom" one is a normal, fixed resistor. When you connect the top resistor to 5 volts, and the bottom resistor to ground. The voltage at the middle will be proportional to the bottom resistor relative to the total resistance (top re bottom resistor). When one of the resistors changes (as it will when your sensor senses things), the output voltage will change as well!
Although the sensor's resistance will vary, the resistive sensors (flex sensor
light
sensor, softpot, and trimpot) in the SIK are around 10K ohms. We usually
want
the fixed resistor to be close to this value, so using a 10K resistor is a great choice for the fixed "bottom" resistor. Please note the fixed resistor isn't necessarily the bottom resistor. We do that with the photodiode only so that more light = more voltage, but it could be flipped and we'd get the opposite response.
Measuring resistive sensors:
PIN 3
5 volts
GND
(gr
ound) (-)
Pin A0
Page 43
Содержание RedBoard
Страница 13: ...Page 11...