Arduino:
Arduino is tiny computer called a microcontroller that you can connect to sensors and other electronic components to create your own gadgets, robots and interactive projects.
How it works:
- Hardware: Arduino boards come in different shapes and sizes, but they all have a bunch of pins where you can plug in wires and components. These boards have a microcontroller chip on them, which is like the brain of the Arduino.
- Software: To tell the Arduino what to do, you write code on your computer using the Arduino software, which is free and easy to use. The code you write is basically a set of instructions. you write code in c or c++ programming language.
- Programming: Once you’ve written your code, you upload it to the Arduino board using a USB cable. The Arduino then runs your code and does whatever you told it to do.
ESP32:
ESP32 is a type of Microcontroller , which is like a tiny computer on a single chip. its is made by a company called Espressif Systems.
The ESP32 is designed to help , control and connect electronic devices. it can be programmed to perform various task like turning on lights, collecting sensor data or sending and receiving information over Wi-Fi or Bluetooth.
features:
- Powerful: Despite its small size, the ESP32 is quite powerful, with a fast processor and plenty of memory.
- Wireless Connectivity: It comes with built-in Wi-Fi and Bluetooth capabilities, allowing it to connect to the internet or communicate with other devices wirelessly.
- Low Power: It’s designed to be energy-efficient, meaning it can run on batteries for a long time without needing to be recharged often.
- Versatile: The ESP32 can be used in various projects, from simple home automation tasks to more complex IoT (Internet of Things) applications.
MQTT Protocol:
MQTT stands for Message Queuing Telemetry Transport. MQTT is a simple messaging protocol, designed for constrained devices with low bandwidth. So, it’s the perfect solution to exchange data between multiple IoT devices.
MQTT Basic Concept:
• Publish/Subscribe
• Message
• Topic
• Broker
Publish/Subscribe:
MQTT communication works as a publish and subscribe system. Devices publish messages on a specific topic. All devices that are subscribed to that topic receive the message.
For example, Device 1 publishes on a topic.
Device 2 is subscribed to the same topic that device 1 is publishing in.
So, device 2 receives the message.
Message:
Messages are the information that you want to exchange between your devices. It can be a message like a command or data like sensor readings.
Topics:
Topics are the way you register interest for incoming messages or how you specify where you want to publish the message Topics are represented with strings separated by a forward slash. Each forward slash indicates a topic level.
Example:
Topics are case -sensitive.
Broker:
The MQTT broker is responsible for receiving all messages, filtering the messages, deciding who is interested in them, and then publishing the message to all subscribed clients.
MQTT Broker is backend System which coordinates Message between different clients.
MQTT Protocol is primarily used due to its lightweight, efficient publish-subscribe messaging system, making it ideal for IoT applications with low bandwidth and battery constraints,