กลับไปหน้ารวมไฟล์
internet-of-things-888af1-en.md

This project has been in my mind far a long time. I have been taking a lot of videos related to technology and wanted to explore in the fields of robotics and engineering this led myself to the creation of this project. Lately I was sad with the educational system present in my country where they check for the knowledge in the book and not that of outside the book. I have always had in myself the mindset to ask myself questions on how does a particular thing work. I have always seen problem in a practical manner and not like how everyone else does. With this mindset I wanted to explore through engineer. I believe that one day we could also bring IRON MAN technology into reality

I strongly believe an idea can revolutionise the world, what matters is how we get to that idea. This idea doesn’t come out of toppers (most cases) it comes out of the minds of a different spectrum of people (who I think are found very less). The answers and questions to this idea also cannot be found in our education system (school). We need to find these types of people and encourage them. What ever I do I don’t do it for myself but for a better life for us humans on our planet. Let’s encourage more people like (I believe myself) to do the needful and bring a new paradigm in the face of cutting edge technology. Every thirty year there is a new revolution for the past and the present decade it has been the smart phone. I believe for the next it is people myself. Let’s change the future and revolutionise the world together, make tech more echo friendly and work for a cause. 🤚🏻😀

With that in my mind I always wanted to show out all the capabilities that I posses that let to creation of this project

This is the complete demonstration of my video

Though my project is just a simulation as I am limited by the resources I possess I hope who ever is checking out this project, please take these ideas forward. All the ideas are for the planet and for us humans.

Foundations of Home Automation: RGB Control via Bluetooth

The "Internet of Things" (IoT) is built on the ability of devices to communicate wirelessly and take action based on remote commands. This project utilizes the HC-05 Bluetooth Module to bridge an Arduino Uno with a mobile smartphone, allowing for the precise, wireless control of an RGB Diffused common-cathode LED.

Wireless Serial Communication: HC-05

The HC-05 is a versatile SPP (Serial Port Profile) module that acts as a transparent serial link.

  • SoftwareSerial Library: Instead of tying up the hardware RX/TX pins (which are needed for code uploading), the project uses SoftwareSerial.h to define virtual serial pins.
  • Baud Rate: Operating at 9600 baud, it ensures a stable data stream from the phone app to the Arduino.

Smart Logic: Parsing Multi-Channel Color Data

The real power of this implementation lies in the code's ability to handle complex commands.

  1. Buffered Data: When a string of numbers is sent from a mobile Bluetooth terminal (e.g., "255,100,0"), the Arduino caches this in the serial buffer.
  2. Integer Parsing: Using the parseInt() function, the Arduino extracts three separate integers for Red, Green, and Blue.
  3. Constraint Protection: The code uses constrain(value, 0, 255) to ensure that no signal falls outside the valid range for PWM (Pulse Width Modulation), preventing flickering or logic errors.

Visual Feedback Loop

Once parsed, the values are sent to the RGB pins via analogWrite().

  • Common Cathode Design: In this setup, the long pin of the RGB LED is connected to GND, while each of the three color-pins is connected through a 330-ohm resistor to the Arduino's PWM pins (9, 10, 11).
  • Serial Debugging: The Arduino also prints the received values back to the PC's Serial Monitor, allowing the user to verify that the Bluetooth link is transmitting data accurately.
#include <SoftwareSerial.h>
SoftwareSerial BT(0,1);
#define redPin 13
#define greenPin 12
#define bluePin 11
void setup()
{
 //Serial setup
 Serial.begin(9600);
 
 BT.begin(9600);

 pinMode(4, OUTPUT);
 digitalWrite(4,HIGH);
 pinMode(redPin, OUTPUT);
 pinMode(greenPin, OUTPUT);
 pinMode(bluePin, OUTPUT);
 setColor(255, 0, 0);
 delay(500);
 setColor(0, 255, 0);
 delay(500);
 setColor(0, 0, 255);
 delay(500);
 setColor(255, 255, 255);
}
void loop()
{
 while (BT.available() > 0)
 {
   int redInt = BLU.parseInt();
   int greenInt = BLU.parseInt();
   int blueInt = BLU.parseInt();
   redInt = constrain(redInt, 0, 255);
   greenInt = constrain(greenInt, 0, 255);
   blueInt = constrain(blueInt, 0, 255);
   if (BT.available() > 0)
   {
     setColor(redInt, greenInt, blueInt);
     Serial.print("Red: ");
     Serial.print(redInt);
     Serial.print(" Green: ");
     Serial.print(greenInt);
     Serial.print(" Blue: ");
     Serial.print(blueInt);
     Serial.println();
     BT.flush();
   }
 }
}
void setColor(int red, int green, int blue)
{
 analogWrite(redPin, red);
 analogWrite(greenPin, green);
 analogWrite(bluePin, blue);
}

ข้อมูล Frontmatter ดั้งเดิม

31: videoLinks: []
apps:
  - "1x Arduino IDE"
author: "Anilhimam"
category: ""
components:
  - "1x Arduino UNO"
  - "1x Arduino Mega 2560"
  - "1x DHT11 Temperature & Humidity Sensor (4 pins)"
  - "1x Photo resistor"
  - "1x Ultrasonic Sensor - HC-SR04 (Generic)"
  - "1x Jumper wires (generic)"
  - "1x Relay Module"
  - "1x Rain Drop Sensor"
  - "1x Grove - Gas Sensor(MQ2)"
  - "1x HC-05 Bluetooth Module"
  - "1x SparkFun Soil Moisture Sensor (with Screw Terminals)"
description: "Here I have different number of technologies work together under one roof."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX1+Lf+otI1u+VfzycJRVImykOaG4cvr+CxCSuU2bfzgYlCKn3IkRA6jANgpCZZzr8eIV+Gx5PdZNd3kpTut9WntbZgVQ+lmb9L6SAn7/CPHc30SOeoWLvCAoaaStIEnKdzXK8vLXR9KtqkoU7DthhECewnl4zh0UxPedFZuozAJExtEw35kBTXsy0C9MJCRtmYMsNGWFSdGUmfZUJPeBEmS3qAJnunJuQ88="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/internet-of-things-888af1_cover.jpg"
lang: "en"
likes: 0
passwordHash: "674906b203623b0c8f2862ea10bcbe4ab11df1083e263bb373b2fe010b20b129"
price: 2450
seoDescription: "Discover Internet of Things projects and codes for Arduino and ESP32. Master Sensors and Modules like mmWave Radar and Servo for DIY electronics."
tags:
  - "environmental sensing"
  - "energy efficiency"
  - "greener planet"
  - "plants"
  - "remote control"
  - "internet of things"
  - "garden"
title: "Internet of Things"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/UMA8FxHTF1Y"
views: 979