IṢẸ́ ỌNÀ
ẸWÀ ÀTI ÌLERA
IṢẸ́ ỌWỌ́
ÀṢÀ ÀTI ÌTÀN
ÌṢERÉ
ÀYÍKÁ
OÚNJẸ ÀTI OHUN MÍMU
REVERSE ENGINEERING
SÁYẸ́ǸSÌ
ERÉ ÌDÁRAYÁ
ÌMỌ̀-Ẹ̀RỌ
ÀWỌN OHUN WÍWỌ̀
Reading a Potentiometer — SIK Circuit 2
Ed

Ṣẹ́dá nipasẹ̀

Ed

17. Oṣù Kẹta 2026FI
80
0
0
0
0

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!

Ìlànà

1

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

Àwọn ohun èlò fún ìgbésẹ̀ yìí:

SparkFun Inventor's Kit - V3.2SparkFun Inventor's Kit - V3.21 ohun èlò

Àwọn irinṣẹ́ tí a nílò:

Computer with Arduino IDEComputer with Arduino IDE
2

Hardware Hookup

Wiring Instructions

  1. Place the potentiometer in the breadboard. It has three pins.
  2. Connect the left pin to GND and the right pin to 5V (or vice versa).
  3. Connect the middle pin (wiper) to Analog Pin A0.
  4. Place an LED in the breadboard. Connect the positive leg (longer) to Digital Pin 13.
  5. Connect the negative leg (shorter) through a 330Ω resistor to GND.
  6. Connect the 5V and GND rails on the breadboard to the Arduino.

Àwọn ohun èlò fún ìgbésẹ̀ yìí:

BreadboardBreadboard1 ẹyọ
Jumper WiresJumper Wires6 ẹyọ
3

Arduino Code

Open the Arduino IDE and upload the following sketch to your Arduino board.

potentiometer.inoarduino
/*
SparkFun Inventor's Kit
Example sketch 02 — POTENTIOMETER

Measure the position of a potentiometer and use it to
control the blink rate of an LED. Turn the knob to make
it blink faster or slower!

This code is completely free for any use.
Visit http://learn.sparkfun.com/products/2 for SIK information.
*/

int sensorPin = 0;    // Potentiometer on analog pin 0
int ledPin = 13;      // LED on digital pin 13

void setup()
{
  pinMode(ledPin, OUTPUT);
}

void loop()
{
  int sensorValue;

  sensorValue = analogRead(sensorPin);

  digitalWrite(ledPin, HIGH);
  delay(sensorValue);

  digitalWrite(ledPin, LOW);
  delay(sensorValue);
}

Àwọn ohun èlò fún ìgbésẹ̀ yìí:

Arduino Uno R3Arduino Uno R31 ẹyọ

Àwọn irinṣẹ́ tí a nílò:

Computer with Arduino IDEComputer with Arduino IDE
4

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 sensorValue to see the raw numbers (0-1023).
  • Use map() to convert the sensor range to a brightness range and control LED brightness with analogWrite().

Àwọn ohun-èlò

7
  • 1 ohun èlò
    $108.84
  • Breadboardìdá 10%
    1 ẹyọ
    Magento Legacy Storeships internationally
    láti$9.76
  • Jumper Wiresìdá 10%
    6 ẹyọ
    Magento Legacy Storeships internationally
    láti$4.27
  • 1 ẹyọ
    Magento Legacy Storeships internationally
    láti$27.80
  • Potentiometerìdá 10%
    1 ẹyọ
    Magento Legacy Storeships internationally
    láti$1.22
  • 5mm LEDìdá 10%
    1 ẹyọ
    Magento Legacy Storeships internationally
    láti$3.66
  • Àyè

Àwọn irinṣẹ́ tó nílò

1
Àpapọ̀ Ìfojúsùn
Ohun tí ẹni tó ṣe é rà. Àwọn ohun èlò tí kò ní iye owó ni o máa rà níbi tí o bá ti rà á.
$108.84

CC0 Àgbègbè Gbogbogbò

Blueprint yìí ti jáde lábẹ́ CC0. O lè ṣe àdàkọ, yí padà, pín, àti lò láìsí ìyọ̀ǹda.

Ṣàtìlẹ́yìn Olùṣẹ́dá nípa rírà àwọn ọjà nipasẹ̀ Blueprint wọn Ẹ̀san Olùṣẹ́dá tí àwọn Olùtajà gbé kalẹ̀, tàbí ṣẹ̀dá àtúnṣe tuntun ti Blueprint yìí kí o sì fi sínú Blueprint rẹ gẹ́gẹ́ bí ìsopọ̀ láti pín owó-wíwọlé.

Ìfọ̀rọ̀wérọ̀

(0)

Wọlé láti dara pọ̀ mọ́ ìfọ̀rọ̀wérọ̀

Ń gbé àwọn ọ̀rọ̀ wọlé...