艺术
美容与健康
工艺
文化与历史
娱乐
环境
食品与饮料
绿色未来
逆向工程
科学
体育
技术
可穿戴设备

Reading a Potentiometer — SIK Circuit 2
Learn to read analog input from a potentiometer and use it to control LED blink speed. Turn the knob to make the LED blink faster or slower — your first step into analog sensors!
说明
1
1
Parts & Introduction
Parts & Introduction
In this experiment you'll use a potentiometer (a variable resistor with a knob) to control how fast an LED blinks. This introduces analogRead() — reading voltage levels between 0 and 5V as values from 0 to 1023.
Parts Needed
- 1x Arduino Uno + USB cable
- 1x Breadboard
- 1x Potentiometer (10K)
- 1x LED (any color)
- 1x 330Ω Resistor
- 6x Jumper Wires
此步骤所需材料:
SparkFun Inventors Kit - V3.21 套件Arduino Uno R31 个
Breadboard1 个
Potentiometer (10K)1 个
5mm LED1 个
330 Ohm Resistor1 个
Jumper Wires6 个所需工具:
Computer with Arduino IDE
2
2
Hardware Hookup
Hardware Hookup
Wiring Instructions
- Place the potentiometer in the breadboard. It has three pins.
- Connect the left pin to GND and the right pin to 5V (or vice versa).
- Connect the middle pin (wiper) to Analog Pin A0.
- Place an LED in the breadboard. Connect the positive leg (longer) to Digital Pin 13.
- Connect the negative leg (shorter) through a 330Ω resistor to GND.
- Connect the 5V and GND rails on the breadboard to the Arduino.
此步骤所需材料:
Potentiometer (10K)1 个
5mm LED1 个
330 Ohm Resistor1 个Breadboard1 个
Jumper Wires6 个3
3
Arduino Code
Arduino Code
Open the Arduino IDE and upload the following sketch to your Arduino board.
potentiometer.inoarduino
此步骤所需材料:
Arduino Uno R31 个
所需工具:
Computer with Arduino IDE
4
4
Test & Experiment
Test & Experiment
What You Should See
The LED blinks faster or slower as you turn the potentiometer knob. At one extreme it blinks very fast, at the other it blinks slowly.
Troubleshooting
- Sporadically working: The potentiometer pins may not be making good contact. Press it firmly into the breadboard.
- Not working: Make sure the wiper (middle pin) goes to Analog pin 0, not Digital pin 0.
- LED not lighting: LEDs only work in one direction. Flip it around.
Experiments to Try
- Open the Serial Monitor and print the
sensorValueto see the raw numbers (0-1023). - Use
map()to convert the sensor range to a brightness range and control LED brightness withanalogWrite().
材料
7- $105.00
估计总额
$138.00Related blueprints
Other builds that share materials, tools, or techniques with this one.

Reading a Soft Potentiometer — SIK Circuit 10electronics/passive1 shared material

Reading a Photoresistor — SIK Circuit 6electronics/passive1 shared material

Driving a Servo Motor — SIK Circuit 8electronics/electromech1 shared material

Driving a Motor — SIK Circuit 12electronics/electromech1 shared material

Reading a Temperature Sensor — SIK Circuit 7electronics/electromech1 shared material

Using a Flex Sensor — SIK Circuit 9electronics/electromech1 shared material
CC0 公共领域
此蓝图以 CC0 协议发布。你可以自由复制、修改、分发和使用此作品,无需征得许可。
通过购买蓝图中的产品支持创客,他们将获得 创客佣金 (由供应商设定),或创建此蓝图的新版本并将其作为连接包含在你自己的蓝图中以分享收入。