0Pricing
Arduino & IoT Academy · レッスン

LDRで明るさを測る

分圧回路を配線して明るさを読み取ります。

「LDRで明るさを測る」はCoddyKit上の無料Arduino & IoT Academyレッスンです。 これはレッスン2/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これは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時間対応のAIチューター)、Arduino & IoT Academyコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Arduino & IoT Academyコースには全4レッスンが含まれています。

「LDRで明るさを測る」で何を学びますか?

分圧回路を配線して明るさを読み取ります。 ブラウザで直接実行するハンズオンコードでArduino & IoT Academyを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Arduino & IoT Academyを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのArduino & IoT Academyは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン2/4です。

「LDRで明るさを測る」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このArduino & IoT Academyレッスンでコードを書いて実行できますか?

はい。すべてのArduino & IoT Academyレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. PIR人感センサーを読み取る
  2. LDRで明るさを測る
  3. 明るさのしきい値を設定する
  4. 自動ナイトライト
← Arduino & IoT Academyに戻る