Codey OnlineLibreria di componenti Arduino ed ESP32 › LDR Light Sensor Module
LDR Light Sensor Module
Sensori

LDR Light Sensor Module

Modulo sensore di luce LDR fotosensibile, scheda di rilevamento con fotoresistenza per Arduino e smart home

Larghezza: 39.1 mm

Pinout — LDR Light Sensor Module

Pin Segnale Descrizione
S analog Analog light sensor output voltage from the LDR divider to a microcontroller input
GND ground Ground reference for the LDR sensor module and connected controller
VCC power Positive supply input for the LDR sensor module, typically 3.3V or 5V

Schema di cablaggio di esempio — LDR Light Sensor Module

Da A Filo
board:A0 x1:S green
board:GND x1:GND black
board:5V x1:VCC red

Codice Arduino di esempio — LDR Light Sensor Module

Questo esempio è stato scritto e verificato in compilazione per arduino-uno. Codey Online lo adatta a qualsiasi altra scheda supportata.

const int sensorPin = A0;

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }
  Serial.println("LDR Light Sensor Module example");
}

void loop() {
  int raw = analogRead(sensorPin);
  float voltage = raw * (5.0 / 1023.0);

  Serial.print("Raw: ");
  Serial.print(raw);
  Serial.print("\tVoltage: ");
  Serial.print(voltage, 2);
  Serial.println(" V");

  delay(500);
}

Componenti correlati

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Crea il tuo progetto Arduino o ESP32 con l'AI

Descrivi cosa vuoi realizzare. Codey Online scrive il codice, disegna lo schema di collegamento, lo compila e programma la tua scheda direttamente dal browser.

Inizia gratis