Arduino KY-018 Project

Automatic lighting system with Arduino

Purpose of this project:

In this project an automatic lighting system with Arduino will be realized.

It consists of turning on an LED lamp when the room becomes dark and turning it off otherwise. It mainly uses a light sensor KY-018.

Necessary components

  • Arduino UNO
  • KY-018 sensor
  • 1 resistance of 220Ω
  • 1 red LED
  • Connecting wires


To make the assembly, we can connect:

  • Red LED terminal (+) to Arduino pin 4
  • red LED terminal (-) to Arduino GND pin
  • DO pin of KY-018 sensor to A0 pin of Arduino
  • VCC pin of KY-018 sensor to 3.3V pin of Arduino
  • GND pin of KY-018 sensor to GND pin of Arduino


The program for the automatic lighting system is as follows:


0 commentaire

Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top