Automatic night lamp

26 August 2024 2 minutes

In this article, we will take a detailed look at how to create an Arduino Nano based automatic lamp that will turn on in the dark using a photoresistor and a low level relay module

Required components:

Connection diagram

Relay module

  • VCC → 5V Arduino pin
  • GND → GND Arduino pin
  • IN → D2 Arduino pin

 

Connect the two leftmost contacts to the break of one of the wires that goes to the light bulb (see the diagram)

  • Photoresistor
  • Any contact → through a resistor to 5V Arduino
  • The same pin that the resistor is connected to → pin A2 of the Arduino
  • Other pin → Arduino GND pin

Firmware

**If you do not have the Arduino IDE installed, I advise you to watch the video tutorial, which shows how to install and configure it. At this link you will find information on how to install the driver on the Arduino board.**

Download the firmware from this link and upload it to the Arduino according to the instructions above. The scheme of the project can be found here.

Principle of operation

We hope that everything worked out for you! The sensor measures temperature and humidity, transmits this data to the Arduino, which in turn displays it on the display.

Disclaimer. This article is created for informational purposes only. All advice and instructions are provided for educational purposes and we are not responsible for any possible consequences related to the implementation of this project. Always use safety precautions when working with electronic components.

If you have any problems, you can contact us at [email protected].

Found an error?
If you find an error, take a screenshot and send it to the bot.