One of the most common smart home systems is the one that turns on the light when it is dark. Many cars nowadays have such lights. they simply turn on automatically when it is dark.
Everybody can see the usefulness of such devices without thinking a lot, and the good news is that it is very easy to build something of this sort using the Arduino Uno board.
All you need is the Arduino Uno board and few basic components. You can also add a relay to it to control high devices if needed.
Light sensor with the Arduino Uno board
Here is what we need to build our system:
- 1 x Arduino Uno Board
- 1 x Photoresistor of 5kΩ
- 1 x LED diode
- 1 x 2.4 kΩ resistor
- 1 x 300Ω resistor
- 1 x Breadboard
- Jumper wires
This Arduino project will also be interesting if you use the whole settings to control a Lamp as we did in the Arduino relay project.
Remeber the color of the LED doesn’t matter in this project. Make sure you have properly connected a resistor with the photoresistor; this is important and help create a voltage divider to get it working. For the LED I used a 300Ω resistor and for the photoresistor a 2,4kΩ resistor.
When the connections are ready, we can upload the code to the Arduino. What the code does is: it reads the value from the analog pin A0. If the value is smaller than 650, it turns the LED ON (it basically turn the LED on when it is dark). if the value is bigger than 650, it will turn OFF the LED.
As an addition, it will print the analog value on the serial so you can see it and eventually adjust the resistor values or threshold for the control the LED.
Here is the code:
Feel free to play with the code and do not forget to adjust it to your needs.
You might also like:
- Arduino hx711 tutorial
- Arduino magnetic switch
- Best Arduino Kits
- gifts for engineering students
- gifts for engineers
- mpu6050 Arduino projects
- Current sensor Arduino
- Soil Moisture Sensor With Arduino
- Arduino Count up Timer Using the Nokia 5110 LCD
- Arduino Yun: Integrating or Juxtaposing Arduino with Linux
- Arduino Projects: Line Follower Robot
- Arduino RFID Project for Beginners
- Arduino MOSFET Project
- Which Arduino Should You Buy
- What Can You Do With Arduino Boards?
- Great Alternatives to the Arduino Microcontroller
- Arduino Projects: Color Sensor
- Arduino IDE Alternatives
- Arduino Mega vs. Uno
- Arduino Projects: Arduino LCD Display
- Read Arduino Rotary Encoders
- A Selection of the Best Arduino Simulators
- Arduino Projects: IR Receiver
- Arduino Light Sensor Project
- Arduino Projects: Arduino Decibel Meter
- Arduino Stopwatch Project
- Arduino Bluetooth RC Car Project
- Arduino Temperature Logger Project
- Arduino Projects: Arduino 7 Segment Display
- Arduino Projects: Clap ON Clap OFF Light
- Arduino Relay Project
- Install a Library Onto the Arduino IDE
- Arduino Projects: Rainfall Detector
- Arduino Projects: RGB LED Arduino
- Arduino Stepper Motor Project
- Arduino Projects: Arduino DC Motor Control
- The Top Affordable Arduino Robot Kit
- Arduino 3D Printed Case
- Arduino Projects: Asynchronous LEDs Blink
- Arduino Projects: Ultrasonic Distance Sensor
- Arduino Projects: LED – 4X4X4 LED Cube
- Arduino Car Projects: Build an Obstacle Avoiding Robot With Less Than $30
- Arduino Projects: Servo Potentiometer Control
- Arduino LED Project: Knight Rider
- Arduino Projects: PIR Motion Sensor
- The Difference between Arduino and Raspberry Pi
- Top 9 Books Every Engineer Should Read
- Top Used Sensors for Arduino
- First Hand on the Arduino Uno Board