0% found this document useful (0 votes)
32 views37 pages

IOT-1

The document outlines a series of experiments using Arduino to design and simulate various circuits, including an LED blinking circuit, a push button LED circuit, an LED pattern with push button control, and a 7-segment display system. Each experiment details the components required, steps for creating the circuit in Tinkercad, circuit diagrams, expected outputs, and observations. The experiments demonstrate the functionality of the circuits and the interaction between hardware and software in Arduino projects.

Uploaded by

akashsoni1379
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views37 pages

IOT-1

The document outlines a series of experiments using Arduino to design and simulate various circuits, including an LED blinking circuit, a push button LED circuit, an LED pattern with push button control, and a 7-segment display system. Each experiment details the components required, steps for creating the circuit in Tinkercad, circuit diagrams, expected outputs, and observations. The experiments demonstrate the functionality of the circuits and the interaction between hardware and software in Arduino projects.

Uploaded by

akashsoni1379
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

EXPERIMENT NUMBER: 01

AIM: - To design and simulate an LED Blinking Circuit using Arduino.


a) Components Required:
Sr.No. Quantity Component
1. 1 Arduino Uno R3
2. 1 Red LED (Light Emitting Diode)
3. 1 Resistor (200Ω)
4. 1 Breadboard Small
5. Several Jumper Wires
6. 1 USB Cable

b) Software Required:
• Tinkercad (Online Simulation Tool)

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and sign in.
➢ Click on “Create New Circuit.”
➢ Drag and drop an Arduino Uno onto the workspace.
➢ Add an LED and a 200Ω resistor to the breadboard.
➢ Connect the anode (long leg) of the LED to one end of the resistor.
➢ Connect the other end of the resistor to pin 7 of the Arduino.
➢ Connect the cathode (short leg) of the LED to the GND pin of the Arduino.
➢ Write and upload the Arduino code in the code editor.
➢ Click “Start Simulation” to test the circuit.

d) Code for LED Blinking:

1
e) Circuit Diagram:

Jumper Wires
Arduino Uno Breadboard

USB Cable

Resistor

Red LED

Fig.1.1 (Blinking LED Circuit)

f) Explanation of Connections in the LED Blinking Circuit


1. Components Used:
• Arduino Uno – The microcontroller that controls the LED.
• LED (Light Emitting Diode) – The component that blinks based on the Arduino's output.
• Resistor (200Ω) – Limits the current to prevent LED damage.
• Breadboard – Used for making circuit connections without soldering.
• Jumper Wires – Used to connect components electrically.

2. Circuit Connections:
i. LED Connections:
• The long leg (anode, +) of the LED is connected to one end of the 220Ω resistor.
• The other end of the resistor is connected to pin 7 of the Arduino (digital output).
• The short leg (cathode, -) of the LED is connected to the ground (GND) of the
Arduino.

ii. Power and Ground:


• The GND pin of the Arduino is connected to the negative rail of the breadboard using a
black wire.

2
• The positive rail of the breadboard is not used in this circuit but is available for
additional components if needed.

iii. Arduino Pin 7 Control:


• The Arduino controls the LED using digital pin 7, which is set as an OUTPUT in the
code.
• When pin 7 is HIGH (5V), the LED turns ON.
• When pin 7 is LOW (0V), the LED turns OFF.

g) Expected Output:
• The LED should blink ON for 1 second and OFF for 2 seconds repeatedly in the Tinkercad
simulation.

h) Observations:
• The LED successfully blinks as per the programmed delay intervals.
• The circuit simulation in Tinkercad functions correctly as per the design.

3
EXPERIMENT NUMBER: 02
AIM: - To design and simulate a Push Button LED Circuit using Arduino.
a) Components Required:
Sr.No. Quantity Component
1. 1 Arduino Uno R3
2. 1 Red LED (Light Emitting Diode)
3. 1 Resistor (1kΩ)
4. 1 Breadboard Small
5. Several Jumper Wires
6. 1 USB Cable
7. 1 Push Button

b) Software Required:
• Tinkercad (Online Simulation Tool)

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and navigate to Circuits.
➢ Click on Create a New Circuit and rename it to Push Button LED.
➢ Add the Arduino Uno R3 to the workspace.
➢ Drag and place a breadboard on the workspace.
➢ Select and place LED, push button, and 1kΩ resistor from the components list.
➢ Make the necessary connections as per the circuit diagram.
➢ Click on Code and select Text Mode.
➢ Write and upload the Arduino code in the code editor.
➢ Click on Start Simulation to test the circuit.

4
d) Code for Push Button LED:

e) Circuit Diagram:

Arduino Uno

USB Cable

Jumper Wires

Resistor Breadboard

PUSH Button

Red LED

Fig.2.1 (Push Button LED Circuit)


f) Explanation of Connections in the LED Blinking Circuit
1. Components Used:
• Arduino Uno – The microcontroller that controls the LED.
5
• LED (Light Emitting Diode) – The component that blinks based on the Arduino's output.
• Resistor (200Ω) – Limits the current to prevent LED damage.
• Breadboard – Used for making circuit connections without soldering.
• Jumper Wires – Used to connect components electrically.
• Push Button–A switch that allows or interrupts the flow of electricity when pressed.

2. Circuit Connections:
i. Power Supply: Connect the 5V pin of the Arduino Uno to the positive rail of the
breadboard.

ii. Ground Connection: Connect the GND pin of the Arduino Uno to the negative rail of
the breadboard.

iii. Resistor Placement: Place a 1kΩ resistor from the negative rail of the breadboard to an
adjacent row.

iv. LED Placement: Insert the LED into the breadboard:


• Anode (+) connected to the same row as the resistor.
• Cathode (-) in a different column.

v. Push Button Placement: Place the push button on the breadboard so that:
• One terminal is connected to the cathode (-) of the LED.
• The other terminal is connected to the negative rail of the breadboard.

vi. Final Ground Connection: Connect the negative rail of the breadboard to the GND pin
of the Arduino Uno.

g) Expected Output:
• When the push button is pressed, the LED turns ON for 1 second.
• After 1 second, the LED turns OFF automatically.
• This process continues in a loop as defined in the program.

h) Observations:
• When the push button is not pressed, the LED remains OFF.
• When the push button is pressed, the LED turns ON as per the programmed logic.
• The LED remains ON only while the button is held down.
• The circuit successfully simulates the working of a push button-controlled LED in Tinkercad.
• The resistor effectively limits the current, preventing damage to the LED.

6
EXPERIMENT NUMBER: 03
AIM: - To design and simulate LED Pattern with Push Button Control using
Arduino.
a) Components Required:
Sr.No. Quantity Component

1. 1 Arduino Uno R3
2. 1 Red LED (Light Emitting Diode)

3. 1 Orange LED (Light Emitting Diode)

4. 1 Green LED (Light Emitting Diode)

5. 3 Resistor (100Ω)
6. 1 Resistor (1kΩ)
7. 1 Breadboard Small
8. Several Jumper Wires
9. 1 USB Cable

b) Software Required:
• Tinkercad (Online Simulation Tool)

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and navigate to Circuits.
➢ Click on Create a New Circuit and rename it to LED pattern with Push Button.
➢ Add the Arduino Uno R3 to the workspace.
➢ Drag and place a breadboard on the workspace.
➢ Select and place 3LED (R, G, O), push button, 100Ω and 1kΩ resistor from the components list.
➢ Make the necessary connections as per the circuit diagram.
➢ Click on Code and select Text Mode.
➢ Write and upload the Arduino code in the code editor.
➢ Click on Start Simulation to test the circuit.

7
d) Code for LED Blinking:

8
e) Circuit Diagram:

Breadboard
Green, Yellow and Red LED

uino Uno

Resistor

USB Cable

Jumper Wire

Arduino UNO

Fig.3.1 (LED Pattern with Push Button Circuit)

f) Explanation of Connections in the LED Blinking Circuit


1. Components Used:
▪ Arduino Uno – The microcontroller that controls the LED.
▪ LED (Light Emitting Diode) – The component that blinks based on the Arduino's
output.
▪ Resistor (100Ω and 1k Ω) – Limits the current to prevent LED damage.
▪ Breadboard – Used for making circuit connections without soldering.
▪ Jumper Wires – Used to connect components electrically.
• Push Button–A switch that allows or interrupts the flow of electricity when pressed

2. Circuit Connections:
i. LED Connections:
• The long leg (anode, +) of the LED is connected to one end of the 220Ω resistor.
• The other end of the resistor is connected to pin 7 of the Arduino (digital output).
• The short leg (cathode, -) of the LED is connected to the ground (GND) of the
Arduino.

ii. Power and Ground:


• The GND pin of the Arduino is connected to the negative rail of the breadboard
using a black wire.
9
• The positive rail of the breadboard is not used in this circuit but is available for
additional components if needed.

iii. Arduino Pin 7 Control:


• The Arduino controls the LED using digital pin 7, which is set as an OUTPUT
in the code.
• When pin 7 is HIGH (5V), the LED turns ON.
• When pin 7 is LOW (0V), the LED turns OFF.

g) Expected Output:
i. Initial State:
• When the circuit is powered on, all LEDs remain OFF.

ii. When the Push Button is Pressed:


• The Red LED (Pin 10) turns ON for 500ms, then turns OFF.
• The Yellow LED (Pin 11) turns ON for 500ms, then turns OFF.
• The Green LED (Pin 12) turns ON for 500ms, then turns OFF.

iii. Repeating Pattern:


• This sequence repeats every time the push button is pressed.
• If the button is not pressed, all LEDs remain OFF.

h) Observations:
i. Initial Condition:
▪ When the circuit is powered on, none of the LEDs light up.
▪ The push button remains inactive until pressed.

ii. When the Push Button is Pressed:


• The Red LED turns ON for 500ms and then turns OFF.
• The Yellow LED turns ON for 500ms and then turns OFF.
• The Green LED turns ON for 500ms and then turns OFF.

iii. LED Blinking Pattern:


• The LEDs follow a sequential ON-OFF pattern when the button is pressed.
• Each LED remains ON for a short duration before turning OFF.

iv. When the Button is Released:


• All LEDs turn OFF and remain OFF until the button is pressed again.

v. Repeating Behavior:
• Every time the button is pressed, the same LED pattern is observed.
• If the button is not pressed, no LED turns ON.
10
EXPERIMENT NUMBER: 04
AIM: - To design and simulate 7 Segment Display System using Arduino.
a) Components Required:

Sr.No. Quantity Component

1. 1 Arduino Uno R3
2. 1 Cathode 7 Segment Display

3. 2 Resistor (500Ω)
4. 1 Breadboard Mini
5. Several Jumper Wires
6. 1 USB Cable

b) Software Required:
• Tinkercad (Online Simulation Tool)

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and navigate to Circuits.
➢ Click on Create a New Circuit and rename it to 7 Segment Display System.
➢ Add the Arduino Uno R3 to the workspace.
➢ Drag and place a breadboard on the workspace.
➢ Select and place 7-segment display and resistor (500Ω) from the components list.
➢ Make the necessary connections as per the circuit diagram.
➢ Click on Code and select Text Mode.
➢ Write and upload the Arduino code in the code editor.
➢ Click on Start Simulation to test the circuit.

11
d) Code for 7 Segment Display System:

12
13
14
e) Circuit Diagram:

Jumper Wires

Arduino UNO

Breadboard
USB Cable

Resistor

7 Segment Display

Fig.4.1 (7 Segment Display System Circuit)

f) Explanation of Connections in the 7-segment display System Circuit


1. Components Used:
• Arduino Uno – The microcontroller that controls the 7-segment display.
• 7-Segment Display (Common Cathode) – Displays numeric digits by illuminating specific
segments.
• Resistors (220Ω - 330Ω) – Limits current flow to protect the 7-segment display.
• Breadboard – Provides a platform for making circuit connections without soldering.
• Jumper Wires – Used to connect the Arduino to the 7-segment display and ensure proper
electrical connections.

2. Circuit Connections:
i. 7-Segment Display Connections:
• The common cathode pins of the 7-segment display are connected to GND on the
breadboard.
• Each segment (A to G) and the decimal point (DP) are connected to Arduino digital pins
as follows:
· Segment A → Pin 7
· Segment B → Pin 6
· Segment C → Pin 5
· Segment D → Pin 4
· Segment E → Pin 3
· Segment F → Pin 9
· Segment G → Pin 8
15
· DP (Decimal Point) is not used in this circuit.
• Resistors (220Ω) are added in series with some of the segments to prevent excessive
current flow.

ii. Power and Ground Connections:


• The GND pin of the Arduino is connected to the ground rail of the breadboard using a
black wire.
• The common cathode of the 7-segment display is also connected to GND through the
breadboard.
• The Arduino is powered via USB, supplying 5V to the entire circuit.

iii. Arduino Control for Displaying Numbers:


• The Arduino controls the display by setting specific pins HIGH (5V) or LOW (0V) to
turn segments ON or OFF.
• In the image, the number "2" is displayed, meaning the following segments are ON:
• Segments A, B, G, E, and D → ON
• Segments C and F → OFF

g) Expected Output:
• The 7-segment display will show numbers based on the Arduino program.
• In the circuit, the display is showing the digit "2" by lighting up specific segments.
• If programmed, the display can count from 0 to 9 in sequence.
• The 500Ω resistors help control brightness and protect the display.
• The displayed number will be clear and stable.
• The Arduino controls which number appears based on the written code.

h) Observations:
• The 7-segment display successfully lights up and displays numbers as per the Arduino code.
• The correct segments illuminate to form the desired digit (e.g., "2" in the image).
• The brightness of the display is regulated by the 500Ω resistors, preventing damage.
• The connections between the Arduino and the display are working correctly, ensuring smooth
data transmission.
• If there are incorrect segment activations, they may be due to wrong wiring or programming
errors.
• The circuit operates as expected when the Arduino is powered on and running the code.

16
EXPERIMENT NUMBER: 05
AIM: - To design and simulate a Sensor-Based Security System using
Arduino.
a) Components Required:

Sr.No. Quantity Component

1. 1 Arduino Uno R3
2. 1 Piezo

3. 1 Red LED

4. 1 PIR Sensor

5. 1 Resistor (1kΩ)
6. 1 Breadboard Small
7. Several Jumper Wires
8. 1 USB Cable

b) Software Required:
• Tinkercad (Online Simulation Tool).

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and navigate to Circuits.
➢ Click on Create a New Circuit and rename it to Sensor-Based Security System.
➢ Add the Arduino Uno R3 to the workspace.
➢ Drag and place a breadboard on the workspace.
➢ Select and place PIR Sensor, Piezo Buzzer, LED and 1kΩ Resistor from the components list.
➢ Make the necessary connections as per the circuit diagram.
➢ Click on Code and select Text Mode.
➢ Write and upload the Arduino code in the code editor.
➢ Click on Start Simulation to test the circuit.

17
d) Code for sensor-based security system:

e) Circuit Diagram:

Object

Piezo
Red LED PIR Sensor

Resistor
Jumper Wires

Arduino UNO Breadboard


USB Cable

Fig.5.1 (Sensor-Based Security System Circuit)


18
f) Explanation of Connections in the sensor-based security system
1. Components Used:
• Arduino Uno – The microcontroller that processes the PIR sensor’s input.
• PIR Sensor – Detects motion by sensing infrared radiation from objects.
• Buzzer (Piezo) – Produces an alarm sound when motion is detected.
• LED – Provides a visual alert when motion is detected.
• 1kΩ Resistor – Limits the current flowing through the LED.
• Breadboard & Jumper Wires – Used for wiring and connections.

2. Circuit Connections:
i. Power Supply:
• Connect 5V from Arduino to the positive rail of the breadboard.
• Connect GND from Arduino to the negative rail of the breadboard.

ii. PIR Sensor:


• VCC → 5V on Arduino.
• GND → GND on Arduino.
• OUT → Digital Pin 2 on Arduino.

iii. Buzzer (Piezo):


• Positive (+) Terminal → Digital Pin 10 on Arduino.
• Negative (-) Terminal → GND on the breadboard.

iv. LED with Resistor:


• Anode (+) of LED → One end of 1kΩ resistor.
• Another end of resistor → Digital Pin 6 on Arduino.
• Cathode (-) of LED → GND on the breadboard.

g) Expected Output:
• When no motion is detected, the LED remains off, and the buzzer is silent.
• When motion is detected, the LED turns on, and the buzzer sounds for 2 seconds.
• After the delay, the system resets and continues detecting motion.

h) Observations:
• The PIR sensor successfully detects motion within its range.
• The LED and buzzer activate immediately when movement is detected.
• The buzzer stops after 2 seconds, as programmed.

19
EXPERIMENT NUMBER: 06
AIM: - To design and simulate a Night Light Control System using Arduino.
a) Components Required:

Sr.No. Quantity Component

1. 1 Arduino Uno R3
2. 1 NeoPixel Strip 8

3. 1 1uf, 16v Polarized Capacitor

4. 1 PIR Sensor

5. 1 Resistor (470Ω)
6. 1 Breadboard Small
7. Several Jumper Wires
8. 1 USB Cable

b) Software Required:
• Tinkercad (Online Simulation Tool).

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and navigate to Circuits.
➢ Click on Create a New Circuit and rename it to Night Light Control System.
➢ Add the Arduino Uno R3 to the workspace.
➢ Drag and place a breadboard on the workspace.
➢ Select and place PIR Sensor, NeoPixel Strip 8, (1uf, 16v) Polarized Capacitor and 470Ω Resistor
from the components list.
➢ Make the necessary connections as per the circuit diagram.
➢ Click on Code and select Text Mode.
➢ Write and upload the Arduino code in the code editor.
➢ Click on Start Simulation to test the circuit.

20
d) Code for sensor-based security system:

21
e) Circuit Diagram:

NeoPixel Strip 8

Jumper Wires
Arduino UNO Breadboard
USB Cable

Polarized Capacitor

NPN Transistor

PIR Sensor

Object

Fig.6.1 (Night Light Control System Circuit)


22
f) Explanation of Connections in the Night Light Control System
1. Components Used:
• Arduino Uno – Microcontroller for processing signals
• PIR Sensor – Detects motion and sends a signal
• NeoPixel LED Strip – Provides illumination based on motion detection
• NPN Transistor (BJT) – Acts as a switch to control the LED strip
• Polarized Capacitor – Stabilizes the power supply for the LED strip.
• Resistors – Limits current to protect components
• Breadboard & Jumper Wires – Used for circuit assembly

2. Circuit Connections:
i. Arduino Power:
• The Arduino is powered via USB or an external 9V adapter.
• GND of Arduino → Common ground for all components.
• 5V of Arduino → Power supply to PIR sensor and circuit components.

ii. PIR Motion Sensor:


• VCC → 5V of Arduino
• GND → GND of Arduino
• OUT → Digital pin of Arduino (e.g., D2)

iii. NPN Transistor (for LED Strip Control):


• Collector → Negative terminal of LED strip
• Emitter → GND
• Base → Connected to an Arduino digital output pin (e.g., D5) via a 220Ω resistor

iv. NeoPixel LED Strip:


• VCC → 5V
• GND → GND
• DIN (Data In) → Arduino digital output pin (e.g., D6)

v. 1µF, 16V Capacitor:


• Positive lead (+) → 5V
• Negative lead (-) → GND
• Placed near the power input of the NeoPixel LED strip to stabilize voltage supply.

g) Expected Output:
• When motion is detected by the PIR sensor, the Arduino receives a HIGH signal.
• The NeoPixel LED strip turns ON, providing illumination in the dark.
23
• If no motion is detected for a predefined time (e.g., 10 seconds), the LED strip turns OFF
automatically.
• The 1µF capacitor ensures smooth power delivery, preventing flickering or voltage fluctuations in
the LED strip.
• The system operates efficiently with stable lighting, responding accurately to motion detection.

h) Observations:
• The PIR sensor successfully detects motion and triggers the LED strip to turn ON.
• The LED strip remains ON as long as motion is detected and turns OFF after the predefined delay
when no motion is sensed.
• The transistor/MOSFET efficiently controls the power to the LED strip, ensuring stable operation.
• The 1µF capacitor helps in reducing voltage fluctuations, preventing flickering in the LED strip.
• The system operates as expected, providing automatic illumination in low-light conditions.
• The response time of the PIR sensor and LED activation is quick, ensuring real-time detection.
• Power consumption is optimized as the light is only activated when required, making the system
energy-efficient.

24
EXPERIMENT NUMBER: 07
AIM: - To design and simulate a Push Button-Controlled Buzzer System
using Arduino.
a) Components Required:

Sr.No. Quantity Component

1. 1 Arduino Uno R3
2. 4 Push Button

3. 1 Piezo

4. 4 Resistor (1200Ω)
5. 1 Breadboard Small
6. Several Jumper Wires
7. 1 USB Cable

b) Software Required:
• Tinkercad (Online Simulation Tool).

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and navigate to Circuits.
➢ Click on Create a New Circuit and rename it to Push Button-Controlled Buzzer System.
➢ Add the Arduino Uno R3 to the workspace.
➢ Drag and place a breadboard on the workspace.
➢ Select and place 4 Push Button, Piezo and 4 (1200Ω) Resistor from the components list.
➢ Make the necessary connections as per the circuit diagram.
➢ Click on Code and select Text Mode.
➢ Write and upload the Arduino code in the code editor.
➢ Click on Start Simulation to test the circuit.

25
d) Code for sensor-based security system:

26
e) Circuit Diagram:

Piezo

PUSH Button

Resistor

Breadboard

USB Cable

Arduino UNO

Jumper Wires

Fig.7.1 (Push Button-Controlled Buzzer System Circuit)


27
f) Explanation of Connections in the Push Button-Controlled Buzzer System
1. Components Used:

• Arduino Uno – The microcontroller to process button inputs and control the buzzer.
• Buzzer – Produces sound when activated.
• Push Buttons (4) – Used to trigger the buzzer.
• Resistors – Pull-down resistors (typically 10kΩ) to ensure proper button functionality.
• Breadboard & Jumper Wires – For easy circuit assembly and connections.

2. Circuit Connections:

• One terminal of each push button is connected to GND via a pull-down resistor.
• The other terminal of each push button is connected to a digital input pin on the Arduino.
• The buzzer's positive terminal is connected to Arduino digital pin 7.
• The buzzer's negative terminal is connected to GND.
• Power connections: The Arduino is powered via USB, and the breadboard is connected to
Arduino’s 5V and GND.

g) Expected Output:
• When any push button is pressed, the buzzer will produce a sound.
• The buzzer will remain ON as long as the button is held down.
• Once the button is released, the buzzer stops sounding.
• Each button can independently trigger the buzzer.

h) Observations:
• The buzzer successfully sounds when a push button is pressed.
• The buzzer remains active only while the button is held down and stops immediately when
released.
• If no button is pressed, the buzzer remains OFF by default.
• All connected push buttons function independently to activate the buzzer.
• The circuit works as expected without any delay or false triggering.

28
EXPERIMENT NUMBER: 08
AIM: - To design and simulate a Smart Door Lock System using Arduino.
a) Components Required:

Sr.No. Quantity Component

1. 1 Arduino Uno R3
2. 1 Potentiometer

3. 1 Keypad 4x4

4. 4 Micro Servo
5. 1 LCD 16x2
6. 1 Breadboard Small
7. Several Jumper Wires
8. 1 USB Cable

b) Software Required:
• Tinkercad (Online Simulation Tool).

c) Steps to Create the Circuit in Tinkercad:


➢ Open Tinkercad and navigate to Circuits.
➢ Click on Create a New Circuit and rename it to Smart Door Lock System.
➢ Add the Arduino Uno R3 to the workspace.
➢ Drag and place a breadboard on the workspace.
➢ Select and place LCD 16x2, Micro Servo, Potentiometer and Keypad 4x4 from the components
list.
➢ Make the necessary connections as per the circuit diagram.
➢ Click on Code and select Text Mode.
➢ Write and upload the Arduino code in the code editor.
➢ Click on Start Simulation to test the circuit.

29
d) Code for Smart Door Lock System:

30
e) Circuit Diagram:

Jumper Wires

Arduino UNO

USB Cable

Potentiometer Breadboard

Keypad 4x4

Micro Servo
LCD 16x2

Fig.8.1 (Smart Door Lock System Circuit)

31
f) Explanation of Connections in the Smart Door Lock System
1. Components Used:
• Arduino Uno – The microcontroller that processes the input and controls the system.
• 4x4 Keypad – Used to input the password for authentication.
• 16x2 LCD Display – Displays messages like "Enter Password" and access status.
• Servo Motor – Acts as the door lock mechanism, rotating when the correct password is
entered.
• Potentiometer – Adjusts the contrast of the LCD display.
• Breadboard & Jumper Wires – Used for circuit connections and wiring.

2. Circuit Connections:
i. Keypad Connections:
• The 8 pins of the keypad are connected to Arduino digital pins (2-9).
• Rows and columns of the keypad are mapped accordingly.

ii. LCD Display Connections:


• Data pins (D4-D7) connected to Arduino pins 4-7.
• RS pin connected to pin 12, E pin connected to pin 11.
• VCC and GND for power.
• Potentiometer connected to the V0 pin of the LCD for contrast adjustment.

iii. Servo Motor Connections:


• Signal (Yellow wire) connected to pin 10 of Arduino.
• Power (Red wire) and Ground (Black wire) connected to 5V and GND respectively.

g) Expected Output:
1. When the system starts:
• The LCD displays: "Input Password".

2. When the user enters the correct password:


• The LCD displays: "Access Granted".
• The servo motor rotates to unlock the door.

3. When the user enters an incorrect password:


• The LCD displays: "Access Denied".
• The servo motor remains locked.

4. If the system is restarted:


• The LCD resets and again displays: "Input Password".
32
h) Observations:
• The system successfully displays "Input Password" on the LCD screen when powered on.
• When a correct password is entered, the servo motor rotates, simulating the unlocking of the
door.
• If an incorrect password is entered, the LCD displays "Access Denied", and the servo motor
remains in its locked position.
• The keypad effectively takes user input and transmits it to the Arduino for processing.
• The LCD provides real-time feedback on the system status (input, access granted, or denied).
• The potentiometer adjusts the brightness of the LCD screen as expected.
• The system remains responsive, ensuring secure and controlled access.

33
EXPERIMENT NUMBER: 09
AIM: - To design and simulate an Intrusion detection system with Arduino
and Ultrasonic Sensor.
a) Introduction:
An intrusion detection system (IDS) is a device or software application that monitors a network or
systems for malicious activity.

• Ultrasonic Sensors: The HC-SR04 ultrasonic sensor uses SONAR to determine the distance of an
object, similar to how bats navigate. It offers excellent non-contact range detection with high accuracy
and stable readings, measuring distances from 2 cm to 400 cm (1" to 13 feet).

• It consists of an ultrasonic transmitter and receiver module. The sensor calculates distance using the
time difference between the emitted and reflected sound waves, using the speed of sound in air (340
m/s).

• The ultrasonic sensor is used here for intruder detection. When an intrusion is detected, a buzzer
sounds as an alert.

b) Components Required:

Sr.No. Quantity Component

1. 1 Arduino Uno R3
2. 1 Red LED

3. 1 HC-SR04 Ultrasonic Sensor

4. 1 Buzzer
5. 1 Resistor
6. 1 Breadboard Small
7. Several Jumper Wires
8. 1 USB Cable

34
c) Connection Diagram:

Object

Ultrasonic Sensor

Piezo

Jumper Wires

Arduino UNO
USB Cable

Resistor

Breadboard

Red and Green LED

Fig.9.1 (Intrusion detection system Circuit (Red LED Blinking))

Fig.9.2 (Intrusion detection system Circuit (Green LED Blinking))

35
d) Steps of Working
1. Insert the ultrasonic sensor into your breadboard and connect its Echo pin to digital pin 2 and the
Trigger pin to digital pin 3 of the Arduino.
2. Insert the RED and GREEN LEDs into the breadboard. Attach the positive leg (longer leg) of the
RED LED to the signal pin of the buzzer via a 220-ohm resistor. Connect the negative leg of the
RED LED to GND. The GREEN LED is connected to digital pin 8 of the Arduino.
3. Upload the code.
4. Observe the LEDs and take an object in front of the ultrasonic sensor.
5. Observe the changes in the LED and buzzer sound.

e) The Sketch:
This sketch works by setting pin 2 for the ultrasonic sensor and pins 8, 9, and 10 as OUTPUT to power
the LEDs and buzzer. After that, a loop continuously reads the value from the echo pin and sends that
value as voltage to the LEDs. The color of the LED that glows will vary according to the detection of
an object in the given range.

36
f) Observations:

Sr.No. Object Detected LED Status (Red/Green) Buzzer Status (ON/OFF)


(Yes/No)
1. Yes Red ON
2. No Green OFF

➢ Explanation:
• If an object is detected within the intruder distance (10 cm), the Red LED turns ON, and the buzzer
sounds to indicate an intrusion.
• If no object is detected beyond the set distance, the Green LED turns ON, and the buzzer remains
OFF, signaling a safe condition.

37

You might also like