قياس الضوء باستخدام LDR
وصّل مقسّم جهد لقراءة شدة الإضاءة.
قياس الضوء باستخدام LDR درس مجاني في Arduino & IoT Academy على CoddyKit. هذا هو الدرس 2 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Arduino & IoT Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
What an LDR Is
An LDR is a light-dependent resistor. Its resistance drops in bright light and climbs high in the dark.
Resistance Tracks Light
Cover an LDR and its resistance soars; shine a lamp on it and resistance falls. That change is what you measure.
It Cannot Be Read Alone
The Arduino reads voltage, not resistance. So an LDR by itself gives no voltage the board can sense directly.
Pair It With a Resistor
Combine the LDR with a fixed resistor to form a voltage divider. Together they turn light into a readable voltage.
Pick a 10k Partner
A 10k ohm resistor is a solid default partner for most LDRs. It keeps your readings spread across a useful range.
Tap the Middle Point
Connect the junction between the LDR and the resistor to an analog pin like A0. That midpoint voltage is your signal.
Read the Brightness
Call analogRead on the divider pin to get a 0 to 1023 number that rises and falls with the light.
int light = analogRead(A0);Wiring Sets Direction
Which side the LDR sits on decides whether bright gives a high or low number. Test it and note your result.
Watch It Live
Print the value so you can wave your hand over the sensor and see the number react with Serial.println.
Serial.println(analogRead(A0));Smooth Out Flicker
Lights flicker faster than your eye sees. Averaging a few readings gives a steadier brightness value.
A Cheap, Useful Sensor
The LDR is a cheap way to add light awareness. It powers night lights, plant monitors, and auto-dimming displays.
Quick Check
Why cant an LDR connect to an analog pin on its own?
Recap: Reading Light
You built an LDR voltage divider with a 10k resistor, tapped the midpoint to A0, and read brightness with analogRead.
الأسئلة الشائعة
هل درس «قياس الضوء باستخدام LDR» مجاني؟
نعم — نص درس «قياس الضوء باستخدام LDR» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Arduino & IoT Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Arduino & IoT Academy 4 دروس في المجموع.
ماذا ستتعلم في «قياس الضوء باستخدام LDR»؟
وصّل مقسّم جهد لقراءة شدة الإضاءة. تتمرن على Arduino & IoT Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Arduino & IoT Academy؟
لا تُشترط خبرة سابقة. Arduino & IoT Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 2 من أصل 4.
كم من الوقت يستغرق درس «قياس الضوء باستخدام LDR»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Arduino & IoT Academy هذا؟
نعم. كل درس في Arduino & IoT Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- قراءة مستشعر الحركة PIR
- قياس الضوء باستخدام LDR
- ضبط عتبة الإضاءة
- مصباح ليلي تلقائي