0% found this document useful (0 votes)
3 views5 pages

21BCP406 Iot Lab2

Uploaded by

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

21BCP406 Iot Lab2

Uploaded by

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

21BCP406

Name: TEJAS MISTRY Roll No.: 21BCP406


Part A
th
Class B Tech CSE 4 Year Sub: Internet of Things
Lab
Aim: Controlling LED and Buzzer using analog and digital read-write and Potentiometer
Prerequisite: Basic programming in Arduino IDE and basic electronics
Outcome: Connections of LEDs and buzzers and controlling active and passive buzzers
using variable voltage by potentiometer
Theory: 1. LED control using Ultrasonic sensor
2. Analog and digital sound using active and passive Buzzers
3. Controlling active and passive buzzers using variable voltage by
Potentiometer

Part B (Write for individual)


Steps:
Setup and Connect the Arduino Board :
● Connect the Arduino board to your computer via USB.
● Open the Arduino IDE and select the correct board and port from the 'Tools' menu.

Connect the Components : ● Connect the LED to a digital pin (e.g., pin 9) with a
current-limiting resistor. ● Connect the Ultrasonic sensor’s VCC to 5V, GND to GND,
Trigger to pin 8, and Echo to pin 7.
● Connect the active buzzer to another digital pin (e.g., pin 10).
● Connect the passive buzzer to a PWM pin (e.g., pin 11).
● Connect the potentiometer’s VCC to 5V, GND to GND, and the wiper to an analog
input pin (e.g., A0)

Upload the Program :


● Click the 'Upload' button in the Arduino IDE to upload the code to the Arduino board.

Observe the Functionality :


● The LED should turn on when an object is within 10 cm of the ultrasonic sensor.
● The active buzzer should sound when the object is close.
● The tone of the passive buzzer should vary with the potentiometer's position.
Output:

1.Digital Read and Write

1
21BCP420

2
21BCP420

3
21BCP420

4
21BCP420

Observation & Learning:


Observation : The LED illuminated when an object was detected within a certain range by
the ultrasonic sensor. The active buzzer sounded in response to proximity, and the tone
produced by the passive buzzer varied according to the position of the potentiometer.

Learning : ● Understanding how to interface and read data from an


ultrasonic sensor.
● Learning the difference between active and passive buzzers and their respective
control mechanisms.
● Gaining experience in using a potentiometer to control voltage and, subsequently, the
output of a buzzer.
Conclusion:
This experiment demonstrated the use of various components like LEDs, buzzers, ultrasonic
sensors, and potentiometers in an Arduino-based setup. It provided practical experience in
controlling outputs using sensor data and variable inputs, thereby reinforcing the concepts of
analog and digital read-write operations in IoT applications.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy