Project information

  • Category: Internet of Things
  • Components used: TinkerCad, Arduino Uno, Photoresistor, NPN Transistor, Power Supply, Resistor, Breadboard, LDR, IR Sensor
  • Project date: 31 May, 2023
  • Project URL: Click here

Project details

This project consists an Arduino board that controls two LEDs (LED1 and LED2) based on the readings from an LDR sensor and two IR sensors (IR1 and IR2). The setup function sets the pins of these devices as inputs or outputs. The loop function reads the analog value from the LDR sensor, prints it to the serial monitor, and then checks whether it is dark outside by looking at the values from the IR sensors. If it is dark outside and the first IR sensor (IR1) detects something, LED1 will be turned on and a message will be printed to the serial monitor. If it is dark outside and the second IR sensor (IR2) detects something, LED2 will be turned on and a message will be printed to the serial monitor.