Page 174 - CodePilot V5.0 C7
P. 174

SMART LAMP PROJECT USING ARDUINO


                  A Smart Lamp automatically turns on or off based on the light in the room. Using a photoresistor,
                  it detects whether the room is dark or bright. If it’s dark, the lamp turns ON and if it’s bright, the
                  lamp turns OFF. This makes the lamp smart and energy-efficient.


                  COMPONENTS USED
                  The different components used in the project are:
                      Arduino  Uno: A  microcontroller  that  processes  input  from the  photoresistor  and  controls
                     the bulb.

                      Photoresistor: A light-sensitive component that changes its resistance based on the amount
                     of light it receives.

                      Bulb: A light source that turns on or off, controlled by the Arduino.
                      Resistors: Components that regulate the flow of electricity to protect the circuit and control
                     voltage.
                      Jumper wires: Wires used to create connections between components and the Arduino.

                      Arduino IDE for coding: The software used to write, simulate and upload the code that controls
                     the Arduino board in Tinkercad.
                  To make a smart lamp project, follow these steps:

                   Step  1     Connect one end of the photoresistor to the 5V pin of the Arduino using a green
                              jumper wire.

                   Step  2    Connect the other end of the photoresistor to one end of the resistor.
                   Step  3    Connect the other end of the resistor to GND using a black jumper wire.

                   Step  4     Connect  the  junction between  the  photoresistor and the  resistor to  pin  7 on the
                              Arduino using a yellow jumper wire to read light levels.

                   Step  5    Connect one end of the bulb to GND using a red jumper wire.
                   Step  6    Connect the other end of the bulb to one end of a resistor (set limit 160Ω).

                   Step  7     Connect the other end of the resistor to pin 8 using an orange jumper wire.

                  Block based programming:





















                   172
                        CodePilot (V5.0)-VII
   169   170   171   172   173   174   175   176   177   178   179