Welcome to the IoT Lab repository! This repository contains a collection of hands-on experiments and projects focused on Internet of Things (IoT) development.
-
Prerequisites
- Arduino IDE or PlatformIO
- ESP32 or compatible development board
- Required libraries (specified in each experiment)
-
Repository Structure
├── experiments/ │ ├── experiment1/ # Basic Bluetooth Communication between ESP32 and Smart Phone │ ├── experiment2/ # Digital Input/Output Bluetooth Communication between ESP32 and Smart Phone │ ├── experiment3/ # Analog Input/Output │ ├── experiment4/ # PWM and Servo Control │ ├── experiment5/ # Sensor Interfacing │ ├── experiment6/ # Wireless Communication │ ├── experiment7/ # MQTT Protocol │ ├── experiment8/ # Web Server │ └── experiment9/ # Node-RED Integration
-
Clone the repository:
git clone https://github.com/veerakrish/IoT.git
-
Navigate to the desired experiment directory:
cd IoT/experiments/experiment1 -
Open the
.inofile in your Arduino IDE or PlatformIO -
Install any required libraries (check the experiment's README)
-
Upload the code to your board
- Basic LED Blink - Introduction to digital output
- Digital Input/Output - Working with buttons and LEDs
- Analog Input/Output - Reading sensors and PWM control
- PWM and Servo Control - Controlling servo motors
- Sensor Interfacing - Working with various sensors
- Wireless Communication - ESP-NOW and WiFi communication
- MQTT Protocol - IoT messaging protocol
- Web Server - Creating a web interface
- Node-RED Integration - Visual programming for IoT
Contributions are welcome! Please feel free to submit a Pull Request.
For experiments involving MQTT (like Experiment 7), you'll need to set up your own MQTT broker. Here's how to deploy one for free on Render.com:
-
Create a new Web Service
- Go to Render.com and sign up/log in
- Click "New" and select "Web Service"
- Connect your GitHub repository or use the provided Docker configuration
-
Configure the Service
- Service Name:
your-mqtt-broker - Region: Choose the one closest to you
- Branch:
mainor your working branch - Runtime: Docker
- Service Name:
-
Docker Configuration Create a
Dockerfilein your project root:FROM eclipse-mosquitto:2.0 COPY mosquitto.conf /mosquitto/config/mosquitto.conf
-
Create mosquitto.conf Create a
mosquitto.conffile:listener 1883 allow_anonymous true -
Environment Variables In Render.com dashboard, add these environment variables:
PORT=1883 -
Deploy
- Push your changes to GitHub
- Render will automatically deploy your MQTT broker
- Find your broker URL in the Render dashboard (it will be something like
your-mqtt-broker.onrender.com)
-
Testing Use an MQTT client to test your broker:
- Host:
your-mqtt-broker.onrender.com - Port:
1883 - No username/password needed (for development only)
- Host:
Note: The free tier has limitations. For production use, consider upgrading or using a dedicated MQTT service.
This project is licensed under the MIT License - see the LICENSE file for details.