Project showcase
Automatic Brightness Sensor

Automatic Brightness Sensor

This small tool checks brightness, and if there is fog or night out, will turn on without human action or worry.

  • 3,258 views
  • 1 comment
  • 10 respects

Components and supplies

Apps and online services

About this project

First, I m working on a project that needs light. I thought about a small tool to resolve these issue, and I made this one. With auto brightness, if there is fog or dark or night, it will turn on automatically. I use it to turn on my car lights automatically, because usually in the city there is lights and I always forgot about turning on lights. I'll add these tools to my car, and my house lights, especially some places in the garden for example. I found it to be a useful tool, and I will integrate it to my future projects.

OUKHEIR Achraf

Code

CodeArduino
//OUKHEIR Achraf
const int LumPin = A0;    // select the input pin for Senosr
const int RidPin1 = 9;      // select the pin for Rideaux
const int RidPin2 = 8;      // select the pin for Rideaux
int LumValue = 0;  // variable to store the value coming from the sensor
int SiLum =0 ; //Etat rideau 0
void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(RidPin1, OUTPUT);
  pinMode(LumPin, INPUT);
  Serial.begin(9600);
}

void loop() {
 Serial.print("Luminoste value = ");
Serial.println(ReadLum());

SiLum= LightDark();
if(SiLum==1){
   Rideaux1(1);
}else {
  Rideaux1(0);
}

delay(1000);
}


//fonction de Luminosite read
int ReadLum(){
LumValue =analogRead(LumPin);
delay(100);
  return  LumValue;
}

//fonction de check Luminosite
int LightDark(){
 //check ifDark or light
  if ( LumValue  < 28) {
    // turn  on:
    digitalWrite(RidPin1, HIGH);
    return 1; 
  } else  if ( LumValue  >33){
    // turn  off:
    digitalWrite(RidPin1, LOW);
  
  return 0;
  }
  
}

//fonction de Rideau
int Rideaux1(int act){
  if(act==1){
    digitalWrite(RidPin1, HIGH);
  return 1;
  }else{
  digitalWrite(RidPin1, LOW);
  return 0;
  }
  }
//OUKHEIR Achraf

Schematics

Photoresistance
I use voltage divider to check brightness
Photoresistor tq4nxi9lid

Comments

Similar projects you might like

Advance Automatic Railway Crossing System

Project showcase by Pawan singh and Akansh Saxena

  • 1,839 views
  • 1 comment
  • 13 respects

Touchless Automatic Motion Sensor Trash Can

Project showcase by Will Su

  • 19,749 views
  • 17 comments
  • 34 respects

Touch Sensor and Sound Sensor Controlling AC/DC Lights

Project showcase by Anbumachi

  • 1,160 views
  • 2 comments
  • 5 respects

Automatic Plant Watering System with Arduino

Project tutorial by Team RobotGeek Projects Team

  • 32,787 views
  • 2 comments
  • 45 respects

Arduino-Based Automatic Water Tap Using IR Sensor

Project tutorial by Team Creatjet3D R&D Team

  • 5,652 views
  • 6 comments
  • 19 respects

Smoke Detection using MQ-2 Gas Sensor

by Aritro Mukherjee

  • 213,167 views
  • 36 comments
  • 133 respects
Add projectSign up / Login