cover photo

COURSEWORK

Sohan's IOT-001 course work. Lv 2

Sohan L MAUTHORACTIVE
This Report is yet to be approved by a Coordinator.

SOHAN'S Level 2 Report

6 / 6 / 2025


Task 1 : SIMON SAYS

Simon says is a memory game in which the player has to remember a certain pattern of lights flashed and try to achieve the same pattern, at each level the number of flashes increases. I learned it by going through the link provided in marvel website. I made this game using ESP-32, push buttons and led lights. Using the code a random sequence of lights, each LED has a corresponding push button to it if correctly pushed it goes to the next level if wrongly pressed it shows game over in serial moniter.

link to code image image

Task 2 : BASICS OF CREATING A WEBSITE

In this task I learnt how to create a website using front end and back end languages. I used html for front end and node.js for back end. instead of just changing colors I added two images when you click the switch button it changes from one image to other. In this task I learnt the basics of creating a website and basic level coding of front end and back end.

link to the code image

TASK 3 : FLASHING MORSE CODE

Morse code is a type of encrypted language in which each alphabet is assigned to a certain sequence of dots and lines. In this experiment using an ESP-32 and flashlights the morse code receiver was realized. When the message is sent via web server the LED flashes accordingly short blinks for dots and long blinks for lines.

link to the code image image2

TASK 4 : SOIL MOISTURE SENSOR

The soil moisture level can be measured using the Soil Moisture Sensor and ESP32. The circuit is very simple as it requires ESP32 and soil moisture sensor only. The Capacitive Soil Moisture Sensor consists of a capacitive probe that creates an electric field around it. When placed in soil, the probe's capacitance varies with the soil's water content because water has a higher dielectric constant than air or dry soil. As moisture levels increase, the capacitance of the sensor increases. This change is converted into an analog output signal, which can be read by a microcontroller.

link to the code image

TASK 5 : COMMUNICATION USING I2C PROTOCOL

The I2C (Inter-Integrated Circuit) protocol is a widely used serial communication method that enables multiple devices to communicate using only two lines: SDA (Serial Data) and SCL (Serial Clock). It operates on a master-slave architecture, I2C is particularly useful for short-distance communication between microcontrollers and other devices such as displays and sensors. In this project, the ESP32 was configured as the master and hosted a web server through which a user could input a custom message. This message was then transmitted via the I2C bus to the Arduino UNO, which functioned as the slave. The message received by the Arduino was shown in the web server.

link to code image image

TASK 6 : FIRE ALARM SYSTEM WITH EMAIL ALERTS

An Infrared Flame Sensor is a device used to detect the presence of a flame or fire by sensing infrared (IR) light emitted by the flame. For this project, I used an Infrared Flame Sensor, an ESP32 microcontroller, and an LED to develop a basic fire alarm system. A flame emits infrared radiation. The sensor module contains an IR receiver (photodiode or phototransistor) tuned to detect this specific range. When a flame is detected, the sensor outputs a digital LOW signal, which is read by the ESP32. It activates an LED as a visual indicator. Additionally, the ESP32 connects to Wi-Fi and sends an email alert to predefined recipients.

link to the code image image

TASK 7 : MQTT PUBLISH AND SUBSCRIBE USING CLOUD MQTT

For this project, I used a public MQTT broker, to establish communication between a Python-based publisher and an ESP32 subscriber. The Python script was programmed to send messages such as "LED1 ON" or "LED3 OFF" to a common MQTT topic. The ESP32, connected to Wi-Fi and continuously listening to that topic, interprets each message and controls the corresponding LED by turning it on or off. This setup enabled seamless wireless control of multiple LEDs independently and highlighted the practicality of MQTT for real-time IoT applications involving device control over the internet.

link to the code image

TASK 8 : BASICS OF MQTT PROTOCOL AND OTHER COMMUNICATION PROTOCOLS

MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol designed for devices in slow or unreliable network conditions. It is widely used in IoT (Internet of Things) systems where stable internet is not guaranteed. The protocol uses a publish-subscribe model, where devices send data to a central server called a broker. The broker then distributes this data to all devices that have subscribed to receive it. This model avoids direct communication between devices and improves efficiency. MQTT works well with a wide range of applications, including remote monitoring and sensor data sharing. It supports Quality of Service (QoS) levels to ensure message delivery. It also includes Last Will messages to notify others when a device disconnects unexpectedly. Retained messages allow new subscribers to get the latest available message immediately. Overall, MQTT ensures reliable communication even in poor network conditions.
Other IoT Communication Protocols
1. HTTP (HyperText Transfer Protocol)
Used for: Web communication (also used in IoT).
Method: Request/Response.
Heavyweight compared to MQTT.
Good for one-time data exchange, not real-time.
2. Bluetooth Low Energy (BLE)
Short-range wireless communication.
Ultra-low power.
Common in wearables and smartphones.
3. Wi-Fi
High-speed wireless protocol.
High power consumption.
Suitable when continuous data transfer is needed (e.g., video).

TASK 9 : SENDING DATA TO THINGSPEAK

This project uses a DHT11 sensor, an ESP32, and ThingSpeak to monitor and visualize temperature data. The DHT11 captures temperature and humidity using an internal thermistor and humidity sensor, sending the data to the ESP32 for processing. The ESP32 connects to ThingSpeak via WiFi and periodically sends temperature readings using HTTP requests. ThingSpeak stores this data in a time-series format for real-time access. Using Python and the channel’s Read API key, the data can be retrieved from ThingSpeak and plotted over time using Matplotlib to visualize temperature trends.

image

UVCE,
K. R Circle,
Bengaluru 01