0Pricing
Arduino & IoT Academy · درس

قراءة مقبض مقياس الجهد

توصيل مقياس الجهد ومراقبة تغير قيمته عند تدويره

قراءة مقبض مقياس الجهد درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Meet the Potentiometer

A potentiometer, or pot, is a knob you turn to change resistance. It is the easiest analog input to start experimenting with.

It Has Three Pins

A pot has three legs: two outer pins for power and ground, and a middle wiper pin that gives the changing voltage.

Wire the Outer Pins

Connect one outer pin to 5V and the other to GND. This sets up the full voltage range across the pot.

Wire the Wiper to A0

Run the middle wiper pin to an analog input like A0. As you turn the knob, the voltage on that pin moves.

It Is a Voltage Divider

Inside, the pot acts as a voltage divider. Turning the shaft moves a contact that splits 5V into the reading you sense.

Read the Knob in Code

Reading it is one line. Call analogRead(A0) and you get a value from 0 to 1023 that tracks the knob position.

int pot = analogRead(A0);

Fully Left Reads 0

Turn the knob all the way toward the GND side and the reading drops to about 0. The wiper now sees zero volts.

Fully Right Reads 1023

Turn it fully toward the 5V side and the value climbs to about 1023. The wiper now sees the full supply voltage.

Print It to Watch

Send the value to the Serial Monitor so you can watch it change live. Use Serial.println inside your loop.

Serial.println(analogRead(A0));

Add a Small Delay

A brief delay keeps the Serial Monitor readable instead of a blur. Ten milliseconds is plenty between samples.

delay(10);

A Hands-On Analog Lab

The pot is your personal analog lab. Twisting it is the quickest way to feel how voltage becomes a number.

Quick Check

Which pot pin feeds the Arduino its reading?

Recap: Reading a Knob

You wired a potentiometer with outer pins on 5V and GND and the wiper on A0. Now analogRead tracks the knob from 0 to 1023.

الأسئلة الشائعة

هل درس «قراءة مقبض مقياس الجهد» مجاني؟

نعم — نص درس «قراءة مقبض مقياس الجهد» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.

ماذا ستتعلم في «قراءة مقبض مقياس الجهد»؟

توصيل مقياس الجهد ومراقبة تغير قيمته عند تدويره تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟

لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.

كم من الوقت يستغرق درس «قراءة مقبض مقياس الجهد»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟

نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. الإشارات الرقمية مقابل التناظرية
  2. إرجاع analogRead للقيم 0–1023
  3. قراءة مقبض مقياس الجهد
  4. تعيين قيم map() إلى نطاق جديد
← العودة إلى Arduino & IoT Academy