In this blog, we will explore how to create an IoT Controller that allows you to control devices such as LEDs, motors, and robots wirelessly using your laptop’s browser. This innovative system functions as a local server and enables seamless interaction with your Arduino, offering a powerful way to send and receive data. Whether you’re a beginner or an advanced maker, this guide will help you unleash the full potential of an IoT Controller in your projects.

Table of Contents
Introduction to IoT Controllers
The IoT Controller bridges the gap between hardware and software by allowing you to control devices wirelessly. Using your laptop’s browser as a control interface, you can issue commands to your Arduino, turning it into a local server. This means you can adjust the brightness of LEDs, drive motors, steer robots, and even monitor sensor data—all from the convenience of your browser.
By integrating Bluetooth and LCD displays, you can further enhance the functionality of your IoT Controller, making it a robust tool for a wide range of applications.
How to Download the BlueBot Controller App
To get started, download the BlueBot Controller App from the official source:
Make sure you have a Bluetooth-enabled smartphone to pair with your project.
Why Build an IoT Controller?
The IoT Controller is an essential tool for modern makers. Here’s why it’s worth building one:
- Versatility: Control various devices, including LEDs, motors, and robots, using a single interface.
- Wireless Convenience: No need for physical connections; use your laptop’s browser for control.
- Data Monitoring: Receive real-time data from your Arduino for better decision-making.
- Ease of Use: The browser-based interface makes it user-friendly and accessible.
- Scalability: Expand functionality as your projects grow.
Components Required
To build the IoT Controller, gather the following components:
- Arduino Board (e.g., Arduino Uno, Nano, or Mega)
- Bluetooth Module (e.g., HC-05 or HC-06)
- LCD Display (16×2 with I2C module)
- LEDs (for testing control functionality)
- Motors and Motor Driver (optional for robotics applications)
- Resistors (as needed)
- Jumper Wires
- Breadboard
- Laptop with Browser (to act as the local server interface)
Setting Up the Arduino for IoT Control
To create the IoT Controller, you first need to set up the hardware. Follow these steps:
1. Connect the Bluetooth Module
- RX Pin: Connect to Arduino pin 2.
- TX Pin: Connect to Arduino pin 3.
- VCC: Connect to the 5V pin on the Arduino.
- GND: Connect to the GND pin.
2. Connect the LCD Display
- Use the I2C pins on the Arduino for easy connectivity.
- SDA: Connect to A4.
- SCL: Connect to A5.
- VCC: Connect to 5V.
- GND: Connect to GND.
3. Add LEDs or Motors
- Connect LEDs or motors to the appropriate pins for testing control functionality. Use a motor driver if needed.
Coding the IoT Controller
Here’s the Arduino code to power your IoT Controller. This code allows you to send commands via a browser and receive data back from the Arduino.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
// Define the Bluetooth serial port
SoftwareSerial BTSerial(2, 3); // RX, TX pins for Bluetooth
// Initialize the LCD with I2C address 0x27
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// Start serial communication for debugging
Serial.begin(9600);
// Start Bluetooth communication
BTSerial.begin(9600);
// Initialize the LCD
lcd.begin();
lcd.print("IoT Ready");
delay(1000);
lcd.clear();
}
void loop() {
// Check for data from Bluetooth
if (BTSerial.available()) {
String command = BTSerial.readString();
command.trim();
// Display the command on the LCD
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Command: ");
lcd.setCursor(0, 1);
lcd.print(command);
// Respond to specific commands
if (command == "LED ON") {
digitalWrite(13, HIGH);
BTSerial.println("LED is ON");
} else if (command == "LED OFF") {
digitalWrite(13, LOW);
BTSerial.println("LED is OFF");
} else if (command == "DATA") {
BTSerial.println("Sensor Value: 123");
} else {
BTSerial.println("Invalid Command");
}
}
delay(100);
}
Code For LCD
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
// Define the Bluetooth serial port
SoftwareSerial BTSerial(2, 3); // RX, TX pins for Bluetooth
// Initialize the LCD with I2C address 0x27 (this might be different depending on your LCD)
LiquidCrystal_I2C lcd(0x27, 16, 2); // 16 columns and 2 rows for the LCD
void setup() {
// Start the built-in serial communication for debugging
Serial.begin(9600);
// Start Bluetooth communication
BTSerial.begin(9600);
// Initialize the LCD
lcd.begin(); // 16 columns and 2 rows for the LCD
lcd.print("Bluetooth Ready");
delay(1000);
lcd.clear(); // Clear the display after a short delay
Serial.println("Bluetooth communication started...");
}
void loop() {
// Check if there is any data received from the phone (Bluetooth)
if (BTSerial.available()) {
// Read the incoming data
String receivedMessage = BTSerial.readString();
// Remove any newline or carriage return characters from the received message
receivedMessage.replace("\n", ""); // Remove newline characters
receivedMessage.replace("\r", ""); // Remove carriage return characters
// Print the received message for debugging
Serial.print("Received message: ");
Serial.println(receivedMessage);
// Display the message on the LCD
lcd.clear(); // Clear the LCD screen before displaying the new message
lcd.setCursor(0, 0); // Set the cursor to the first row, first column
lcd.print("Received: "); // Display a label for clarity
lcd.setCursor(0, 1); // Set the cursor to the second row
lcd.print(receivedMessage); // Display the received message
// Trim the received message and check if it's equal to "hello"
receivedMessage.trim(); // Trim any extra spaces or newline characters
if (receivedMessage == "hello") {
// Send a reply message "How are you?"
BTSerial.println("How are you?");
Serial.println("Replied: How are you?");
}
if (receivedMessage == "fine") {
// Send a reply message "Good To Hear"
BTSerial.println("Good To Hear");
Serial.println("Replied: Good To Hear");
}
if (receivedMessage == "hi") {
// Send a reply message "Hello"
BTSerial.println("Hello");
Serial.println("Replied: Hello");
}
if (receivedMessage == "what is your name") {
// Send a reply message "My name is BlueBot"
BTSerial.println("My name is BlueBot");
Serial.println("Replied: My name is BlueBot");
}
}
// Add a small delay to avoid overloading the serial buffer
delay(100);
}
How This Code Works
- Bluetooth Communication:
- The
SoftwareSerial
library is used to handle communication with the Bluetooth module. - RX and TX pins (2 and 3) are defined for Bluetooth communication.
- The
- Handling Commands:
- Commands are received as strings over Bluetooth.
- The code checks the received command and performs corresponding actions:
"LED ON"
: Turns the LED on."LED OFF"
: Turns the LED off."DATA"
: Sends mock sensor data (Sensor Value: 123
).- Other commands receive an “Invalid Command” response.
- Serial Monitor:
- The built-in
Serial
is used for debugging to monitor commands and responses.
- The built-in
- No LCD:
- The LCD display is completely removed.
- Feedback is sent back to the Bluetooth sender instead.
Usage
- Connect the Hardware:
- Connect the HC-05/HC-06 Bluetooth module:
- RX (HC-05) to TX (Arduino Pin 3).
- TX (HC-05) to RX (Arduino Pin 2).
- VCC to 5V.
- GND to GND.
- Connect an LED to pin 13 (or any other pin), with a resistor if needed.
- Connect the HC-05/HC-06 Bluetooth module:
- Pair Your Device:
- Pair your phone or laptop with the Bluetooth module.
- Use a terminal app or serial monitor (e.g., Serial Bluetooth Terminal) to send commands.
- Send Commands:
- Send
"LED ON"
to turn on the LED. - Send
"LED OFF"
to turn off the LED. - Send
"DATA"
to receive sensor data.
- Send
Output Example
- Input Command:
"LED ON"
- Response:
"LED is ON"
- The LED on pin 13 lights up.
- Response:
- Input Command:
"DATA"
- Response:
"Sensor Value: 123"
- Mock sensor data is sent back.
- Response:
This simplified version allows you to control devices wirelessly and provides immediate feedback via Bluetooth.
Practical Applications of IoT Controllers
- Home Automation: Control lights, fans, and appliances remotely.
- Robotics: Drive robots using a browser-based interface.
- Data Logging: Monitor and log sensor readings for analysis.
- Interactive Displays: Use the LCD to display messages or feedback.
- Education: Teach IoT concepts to students with hands-on projects.
Troubleshooting Common Issues
- Bluetooth Not Pairing: Ensure the module is powered and the RX/TX connections are correct.
- No Response to Commands: Verify the serial communication baud rate matches in both the code and the device.
- LCD Not Displaying: Check the I2C address and connections.
Conclusion
The IoT Controller is a versatile and powerful tool for controlling devices wirelessly. By using your laptop’s browser as a local server, you can easily interact with your Arduino to control LEDs, motors, robots, and more. Whether you’re a hobbyist or a professional, building an IoT Controller offers a rewarding way to explore the exciting world of IoT and automation. Start your journey today and bring your projects to life!
Download BlueBot Controller App and start your journey today!