0% found this document useful (0 votes)
7 views28 pages

Sensors and Signals

The document is a project report for an IoT and Embedded Internship at Shri Ramdeobaba College of Engineering and Management, detailing the learning experiences and experiments conducted by students in the 7th semester B.Tech program. It covers various topics including the Internet of Things (IoT), embedded systems, and practical applications using components like ESP32, DHT22 sensors, and MQTT protocols. The report also includes a project section that describes the integration of sensor data acquisition with WiFi connectivity and remote monitoring capabilities.
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)
7 views28 pages

Sensors and Signals

The document is a project report for an IoT and Embedded Internship at Shri Ramdeobaba College of Engineering and Management, detailing the learning experiences and experiments conducted by students in the 7th semester B.Tech program. It covers various topics including the Internet of Things (IoT), embedded systems, and practical applications using components like ESP32, DHT22 sensors, and MQTT protocols. The report also includes a project section that describes the integration of sensor data acquisition with WiFi connectivity and remote monitoring capabilities.
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/ 28

Shri Ramdeobaba College Of Engineering And

Management

Industry Internship Evaluation (ECP454)


7th Semester B.Tech. Session-2024-25
Project Report

IOT And Embedded Internship

Submitted by:

Avantika Khanorkar - 05
Janhavi Jaipurkar - 31
Grecy Pande - 06
Abhishree Kolharkar - 02

Course Coordinator
Dr. Sanjay B. Pokle
Assistant Professor
Contents

1.Introduction Page No.3

2.Learnings through Daily Experiments Page No.4-16

3.Project Page No.17-

4.Conclusion Page No.27

5.References Page No.28

2
1.Introduction

The Internet of Things (IoT) connects devices and systems


through the internet, enabling data collection, exchange,
and action. Embedded systems, which combine hardware
and software to perform specific functions, are central to
IoT devices. Key components include microcontrollers
(MCUs), sensors, actuators, and communication modules
like Wi-Fi and Bluetooth. For example, a smart home
thermostat uses an MCU to process temperature sensor
data, actuators to control heating and cooling, and
communication modules to allow remote control via a
smartphone. Firmware manages operations and
interactions, making devices intelligent and capable of
autonomous or semi-autonomous tasks. This integration
enhances various sectors, including smart homes,
healthcare, agriculture, and manufacturing. We learnt about
sensors like DHT22, soil sensors which can be used to
access remote data using the internet, hence the name
internet of things.
We used platforms like thingspeak and adafruit to access
the data and other software IDEs like Arduino and Wokwi
for simulation purposes.

3
2.Learning through daily sessions

● ESP32 with Led : We initially used 2 LEDs and


alternatively switched them on and off. Then to take it to
the next level, we used a switch pushup button to control
the blinking. When it’s unpressed, the led on pin 18
would glow and pin 19 would stay off and vice versa.

Fig 1: ESP32 with L

4
Fig 2: Hardware Implementation

● ESP32 with potentiometer:


We explored the functionality and applications of a
potentiometer, a variable resistor commonly used in electronic
circuits to adjust voltage levels. The key focus was on observing
how altering the input value by rotating the potentiometer's knob
impacts the output.
During our experiments, we specifically noted the changes in the
output values when adjusting the potentiometer. By rotating the
knob, we observed that the output values varied within a range
from 136 to 212. This range indicates the minimum and
maximum readings we recorded, demonstrating the
potentiometer's ability to provide fine control over the output
signal.

5
Fig 3:ESP32 with Potentiometer

Fig 4:Hardware Implementation

● ESP32 with servo motors, IR sensor:


In the first step, we learnt how a servo motor works and installed
its library, then rotated it to angle 10, 20, 30, 40.

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.

Fig 5: ESP32 with Servo Motor

Fig 6:Hardware Implementation

● ESP32 with LCD:


We learnt about i2c lcd and SDA, SCL and then we displayed a few
words on it. Installed the required library.

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

Fig 7:ESP32 with LCD

Fig 8:Hardware Implementation

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.

Fig 9:ESP32 with DHT22

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.

Fig 11:Thingspeak Dashboard

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:

1. Broker: Acts as a server that receives all messages from


clients and routes them to the appropriate destination.
2. Client: Devices or applications that connect to the broker.
3. Subscribe: Clients subscribe to specific topics on the
broker to receive messages published to those topics.

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

Fig 13.2:Adafruit Simulation

Fig 14: Adafruit Dashboard

● 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.

● Arduino Bluetooth Control App:


The "Serial Bluetooth Terminal" app for Android allows
communication with Bluetooth-enabled devices like Arduino. It
supports sending and receiving data over Bluetooth serial
connections. The app provides a terminal interface where users
can manually send commands and view responses from
connected devices. It includes features like customizable ASCII
control codes and data logging capabilities. "Serial Bluetooth
Terminal" is widely used for prototyping, debugging, and
controlling IoT projects via Bluetooth communication on
Android devices.

15
Fig 15: Hardware Implementation

● Arduino Voice Control App:


Arduino voice control apps facilitate hands-free operation of
Arduino projects by recognizing predefined voice commands
sent via Bluetooth. These apps typically integrate with Arduino
via a Bluetooth module like HC-05/HC-06, enabling real-time
command execution based on voice inputs. Users can customize
commands for various actions such as turning on/off LEDs,
controlling motors, or reading sensor data. These apps are
beneficial for IoT applications, home automation, and

16
prototyping where voice commands enhance user interaction
and control flexibility. Compatibility with Arduino boards and
Bluetooth modules ensures smooth operation in diverse projects.

Pr Fig 16:Hardware Implementation

17
3. PROJECT

Components Used:

ESP32: The ESP32 microcontroller stands at the core of modern


IoT projects, offering dual-core processing power alongside
robust WiFi and Bluetooth capabilities. It serves as a versatile
platform for connecting various sensors and actuators wirelessly,
facilitating real-time data exchange and remote control
functionalities. Its ability to handle low-power modes efficiently
makes it ideal for battery-powered applications. With support for
numerous communication protocols and ample GPIO pins, the
ESP32 enables seamless integration into smart home systems,
environmental monitoring setups, and industrial automation
solutions.

Fig 17: ESP32

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

Soil Sensor: Designed specifically for agriculture and gardening


applications, soil sensors provide crucial insights into soil
moisture levels, enabling precise irrigation control and ensuring
optimal plant health. These sensors typically employ
capacitance or resistive measuring techniques to accurately
determine moisture content in the soil. Integrating them into IoT
projects allows for automated watering systems that conserve

19
water and enhance crop yields by maintaining soil moisture at
optimal levels.

Fig 19:Soil Sensor

Jumper Wires: Jumper wires are indispensable tools in electronics


prototyping, facilitating temporary connections between
components on breadboards or between modules. They come in
various lengths and types (male-to-male, male-to-female, and
female-to-female), offering flexibility in circuit design and
troubleshooting. Their simplicity and versatility make them
essential for connecting sensors, actuators, and other electronic
components during the development and testing phases of
projects, ensuring efficient and reliable electrical connections.

20
Fig 20: Jumper Wires

USB Cable: A USB cable serves as a lifeline for microcontroller


programming, data transfer, and power supply in electronics
projects. It connects microcontrollers like Arduino and ESP32 to
computers for uploading code, debugging, and serial
communication. With different types (e.g., USB-A to USB-B,
USB-A to Micro-USB, and USB-A to USB-C), they cater to
diverse hardware requirements, ensuring seamless connectivity
and operation across various devices and platforms.

Fig 21:USB Cable

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.

Fig 22: Relay

LCD (Liquid Crystal Display): LCDs are essential for displaying


real-time data, status messages, and user interface elements in
microcontroller-based projects. They come in various sizes (e.g.,
16x2, 20x4) and types (e.g., character LCDs, graphical LCDs),
offering flexibility in displaying information. LCDs enhance
user interaction by providing visual feedback from sensors and
actuators, making them invaluable in applications ranging from

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.

Fig 23: LCD Display

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:

1. Libraries and Definitions: The sketch includes necessary


libraries such as `LiquidCrystal_I2C` for interfacing with the
LCD, `WiFi` for WiFi connectivity, `DHT` for reading DHT22
sensor data, and `Adafruit_MQTT` for MQTT communication
with Adafruit IO. Definitions include WiFi credentials, Adafruit

23
IO server details (`AIO_SERVER`, `AIO_SERVERPORT`), and
MQTT credentials (`AIO_USERNAME`, `AIO_KEY`).

2. Objects and Variables:


● WiFiClient client: Handles WiFi connection.
Adafruit_MQTT_Client mqtt: MQTT client instance
for connecting to Adafruit IO.
● Adafruit_MQTT_Publish objects (`Temperature`,
`Humidity`, `Soil`, `RelayStatus`): Instances to publish data
to respective Adafruit IO feeds.
● DHT dht(DHTPIN, DHTTYPE): DHT22 sensor object
initialized with pin `DHTPIN` and sensor type
`DHTTYPE`.
● LiquidCrystal_I2C lcd(0x27, 16, 2): LCD object configured
with I2C address `0x27`, 16 columns, and 2 rows.
3. Setup Function (`setup()`):
● Initializes the LCD (`lcd.init()`) and turns
on backlight
(`lcd.backlight()`).
● Begins serial communication (`Serial.begin(115200)`) for
debugging.
● Configures pin modes and initial states,
including `RELAY`.
● Displays startup message on the LCD, connects to WiFi
(`WiFi.begin()`), and waits until connected
(`WiFi.status()`).
● Calls `connectToMQTT()` to establish MQTT connection
upon successful WiFi connection.

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.

5. Main Loop Function (`loop()`):


● Checks MQTT connection status
(`mqtt.ping(3)`,
`mqtt.connected()`), reconnects if necessary.
● Reads temperature (`t`), humidity (`h`), and soil moisture
(`i`) from respective sensors.
● Determines soil moisture status (`msg`) based on sensor
readings.
● Prints sensor values to serial monitor for debugging.
● Updates LCD display with sensor readings and soil
moisture status.
● Controls `RELAY` based on soil moisture status (`msg`)
and updates relay status on Adafruit IO
(`updateRelayStatus()`).
● Publishes sensor data (`Temperature.publish()`,
`Humidity.publish()`, `Soil.publish()`) and relay status
(`RelayStatus.publish()`) to Adafruit IO feeds.
● Prints success/failure messages to serial monitor for MQTT
publishing.

25
● Delays execution for 5 seconds (`delay(5000)`) before
repeating the loop for periodic updates.

6. Update Relay Status Function (`updateRelayStatus()`):


● Publishes current relay status (`status`) to Adafruit IO feed
(`RelayStatus.publish()`).
● Prints success/failure messages to serial monitor for relay
status publishing.

This sketch integrates sensor data acquisition, WiFi connectivity,


MQTT communication with Adafruit IO, and visual feedback
via an LCD display. It enables remote monitoring and control of
environmental conditions, making it suitable for applications
like smart agriculture or home automation where real-time data
visualization and control are essential. Adjustments can be made
to sensor pins, WiFi credentials, and MQTT topics to customize
for specific project requirements.

26
Fig 24: Online Simulation On Wokwi

Fig 25:Adafruit Dashboard

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.

Moreover, we immersed ourselves in leveraging cloud platforms


like ThingSpeak and Adafruit IO. These platforms proved
invaluable in managing, storing, and visualizing the voluminous
data collected from our sensors. This experience not only
enhanced our understanding of cloud-based data handling but

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/

4. Arduino IDE - https://www.arduino.cc/en/software

28

You might also like