Sensors and Signals
Sensors and Signals
Management
Submitted by:
Avantika Khanorkar - 05
Janhavi Jaipurkar - 31
Grecy Pande - 06
Abhishree Kolharkar - 02
Course Coordinator
Dr. Sanjay B. Pokle
Assistant Professor
Contents
2
1.Introduction
3
2.Learning through daily sessions
4
Fig 2: Hardware Implementation
5
Fig 3:ESP32 with Potentiometer
6
This is the code snippet that ensures the rotation in various
angles.
To rotate the motor according to the switch , if there’s no motion
detected i.e. y==0, the motor rotates 45 deg or else 0 deg.
7
At the primary step we learnt how to display a given format on lcd
by setting up a cursor at (0,0).
Then if the motion is detected and we print hi and increment ‘x’ by
declaring the ‘x’ in global variable
8
● ESP32 with DHT22:
By connecting the DHT22 to the ESP32, we could gather real-
time data on temperature and humidity levels, making it possible
to visualize and analyze environmental changes. This setup is
ideal for applications like home automation, weather stations,
and smart agriculture, where monitoring and responding to
environmental conditions are crucial.
9
Fig 10:Hardware Implementation
● Thingspeak :
ThingSpeak is an IoT analytics platform service that allows
users to collect, visualize, and analyze live data streams from
sensors and devices. It supports real-time data collection and
provides tools for data processing and visualization, including
MATLAB integration. Users can create public or private
channels to store and share sensor data. ThingSpeak also enables
the creation of triggers and alerts based on defined criteria. It is
widely used in IoT projects for remote monitoring and control
applications.
10
● HTTP PROTOCOL:
In ThingSpeak, the HTTP protocol is used to send and receive
data from devices. By making HTTP GET or POST requests to
ThingSpeak’s API endpoints, users can update channel fields
with sensor data or retrieve stored data. Each request must
include an API key for authentication and security. The HTTP
protocol ensures reliable communication between devices and
the ThingSpeak server, enabling real-time data logging and
analysis. This method is widely adopted due to its simplicity and
compatibility with various programming environments.
11
Fig 12:Thingspeak Simulation
● MQTT Protocol :
MQTT (Message Queuing Telemetry Transport) is a lightweight
messaging protocol designed for constrained devices and low-
bandwidth, high-latency, or unreliable networks. It follows a
publish/subscribe model, where devices publish messages to
topics and subscribers receive messages from those topics. In
MQTT:
12
4. Publish: Clients publish messages to topics on the broker.
5. Topic: A hierarchical string that messages are published to
and subscribed from.
● Adafruit:
Adafruit IO is an MQTT-based platform designed for IoT
projects, offering easy integration with MQTT for data
exchange. It supports both publishing and subscribing to topics,
allowing devices to send and receive data seamlessly. Adafruit
IO provides a user-friendly interface for managing MQTT
connections and data streams, making it accessible for beginners
and advanced users alike. It includes built-in features like data
visualization, triggers, and dashboards to monitor and control
IoT devices. Adafruit IO's MQTT implementation simplifies
real-time data communication, ideal for home automation,
sensor monitoring, and IoT applications.
13
Fig 13.1:Adafruit Simulation
● ESP32 BLE :
The ESP32 microcontroller supports Bluetooth Low Energy
(BLE) and Bluetooth Classic protocols. It integrates a dual-
mode Bluetooth stack with both BLE 4.2 and Bluetooth Classic
14
protocols. The BLE protocol is used for low-power wireless
communication with devices like sensors, wearables, and smart
home appliances. ESP32's Bluetooth Classic supports
connections to devices such as smartphones, headsets, and other
peripherals. The ESP32's Bluetooth capabilities are widely used
in IoT applications for seamless connectivity and data exchange
over short distances.
15
Fig 15: Hardware Implementation
16
prototyping where voice commands enhance user interaction
and control flexibility. Compatibility with Arduino boards and
Bluetooth modules ensures smooth operation in diverse projects.
17
3. PROJECT
Components Used:
18
DHT22 Sensor: The DHT22 sensor is a fundamental component
in environmental monitoring due to its ability to measure
temperature and humidity with reasonable accuracy and cost-
effectiveness. Operating with a digital output, it simplifies
integration into microcontroller-based projects like weather
stations, climate control systems, and smart agriculture
applications. Its compact size and ease of use make it popular
among hobbyists and professionals alike for obtaining critical
environmental data in real-time.
Fig 18:DHT22
19
water and enhance crop yields by maintaining soil moisture at
optimal levels.
20
Fig 20: Jumper Wires
21
Relay: Relays act as electromechanical switches that enable
microcontrollers to control high-power devices such as lights,
motors, and appliances using low-power control signals. They
provide isolation between the microcontroller's low-voltage
circuits and the high-voltage components they control, ensuring
safety and reliability in automation and home control
applications. By allowing microcontrollers like Arduino or
ESP32 to switch electrical loads on and off, relays facilitate the
automation of industrial processes, home appliances, and IoT
devices.
22
simple temperature displays to complex IoT systems. Their low
power consumption and ease of integration make them suitable
for battery-operated devices where visual output is essential for
monitoring and control.
Working:
This Arduino sketch is designed to monitor temperature,
humidity, and soil moisture using a DHT22 sensor and a soil
moisture sensor. It utilizes an ESP32 microcontroller to connect
to WiFi and publish sensor data to Adafruit IO via MQTT for
remote monitoring and control. Here’s a breakdown of the code:
23
IO server details (`AIO_SERVER`, `AIO_SERVERPORT`), and
MQTT credentials (`AIO_USERNAME`, `AIO_KEY`).
24
4. MQTT Connection Function (`connectToMQTT()`):
● Attempts to connect to Adafruit IO MQTT
server
(`mqtt.connect()`).
● Retries connection every 5 seconds (`delay(5000)`) until
successful.
● Prints connection status messages to serial monitor.
25
● Delays execution for 5 seconds (`delay(5000)`) before
repeating the loop for periodic updates.
26
Fig 24: Online Simulation On Wokwi
4. Conclusion:
Through our hands-on experiments and practical applications,
we gained deep insights into the expansive world of IoT and its
practical implications. We extensively explored the use of
various sensors, including temperature, humidity, soil moisture
sensors, and more, understanding their pivotal roles in
environmental monitoring and automation. Our study also
encompassed communication protocols such as MQTT, known
for its efficiency in real-time data transmission, and HTTP,
essential for web-based interactions.
27
also sharpened our skills in configuring and optimizing data
streams for actionable insights.
Practical engagements with devices like potentiometers and relay
modules provided firsthand knowledge in controlling physical
systems and integrating them into IoT networks. These exercises
not only reinforced our theoretical understanding but also
equipped us with the proficiency to simulate and test our codes
effectively. Using IDEs such as Wokwi and Arduino IDE, we
seamlessly developed and refined our IoT solutions, ensuring
robust performance and scalability in real-world applications.
5. References:
Software Used:
1. Wokwi - https://wokwi.com/
2. Thingspeak - https://thingspeak.com/
3. Adafruit - https://www.adafruit.com/
28