photosensive module

hello guys does anyone can povide me a code for make this module work please?

Which module would that be ?

anyone please?

keneda83:
anyone please?

It’s rude to ignore a simple question. What module is shown in the photo?

it's the edc-262605 a photosensible module but can't find any code or tutorial about it...

Have you tried connecting it to GND, 5V and an analogue pin and reading the value returned ?

Provide Vcc as appropriate for the device, Gnd to Ground, DO to an analog pin, then do analog reads to see what happens. (UKHeliBob beat me to it)

I'm guessing though that it's got an adjustable threshold and DO will actually give 0 or 1 depending on the setting of the potentiometer.

It has a LM393 comparator on it so the output will be digital - the pot will adjust the threshold
presumably.

Perhaps experiment with it?

KISS
Hook up power (+5V / GND) .
Optionally , you MAY want to use small limiting resistor just to be safe.
The "power LED" should come up.

Adjust the pot ( light sensitivity) and with some reasonable ambient light the "DO LED" should come up.

I would guess that "DO " may stand for "digital output".

Than hook the "DO" to digital I/O pin of your choice and find out correlation between "DO LED" and the actual output - with "DO LED " on - "DO" output is what?

Wild guess - with "DO LED" on the "DO" should be HIGH, but may be just opposite.
Good luck.

PS Buying / having a device without datasheet is not the best way to go.

thanks evryone for your help , i followed your instruction guys and its just a digital photoresistor with a poto for light detection level, when it detect light it send a LOW when it’s dark it send a HIGH , nothing more haha. i used the digialread sketchthat i modified for some test

/*
  DigitalReadSerial
 Reads a digital input on pin 2, prints the result to the serial monitor 
 
 This example code is in the public domain.
 */

// digital pin 2 has a pushbutton attached to it. Give it a name:
int Phot = 2;
int led = 3;
int led1 = 4;
int led2 = 5;
int led3 = 6;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // make the pushbutton's pin an input:
  pinMode(Phot, INPUT);
  pinMode(led, OUTPUT);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
  int photState = digitalRead(Phot);
  // print out the state of the button:
  Serial.println(photState);
  
  if (digitalRead(Phot) == HIGH)
        digitalWrite(led, HIGH);
        
    else
        digitalWrite(led, LOW);
       
       if (digitalRead(Phot) == HIGH)
        digitalWrite(led1, HIGH);
        
    else
        digitalWrite(led1, LOW);
        
        if (digitalRead(Phot) == HIGH)
        digitalWrite(led2, HIGH);
        
    else
        digitalWrite(led2, LOW);
        
        
        if (digitalRead(Phot) == HIGH)
        digitalWrite(led3, HIGH);
        
    else
        digitalWrite(led3, LOW);

There is no need to read the state of the Phot pin more than once or the if/else construct. Read the state of the Phot pin into a variable and write the value of that variable to the LED pins.

thanks for the tips bob , i'm a terrible coder since i just started some days ago i still need to learn all the shortcuts of coding to avoid useless lines of code thanks again mate :slight_smile: