Logo

dev-resources.site

for different kinds of informations.

Home Automation System with Arduino and C++

Published at
12/9/2024
Categories
arduino
cpp
beginners
sideprojects
Author
alice11brown
Author
12 person written this
alice11brown
open
Home Automation System with Arduino and C++

Hello Devs!
I am a student of mechatronics engineering, and I love embedded systems. Although I am a learner, I've seen multiple projects of my seniors, and I am excited to start practicing in this field. here is my first project in Arduino IDE.
This project offers a substantial learning opportunity for professionals in the area by fusing physical hardware and C++ programming to enable the management of a variety of household appliances.

The project's main goal is to use an Arduino board to create a simple home automation system. The goal of this system is to make it possible to operate LED lights, a temperature sensor to monitor the surrounding environment, and a servo motor that doubles as a door lock. Control can be applied manually using traditional switches or using a smartphone application. The usage of C++ is required for the implementation. This is my code:
`

include

include

define DHTPIN 7

define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

Servo myServo;
int ledPin = 13;
int buttonPin1 = 2;
int buttonPin2 = 3;

void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);

myServo.attach(9);
Serial.begin(9600);
dht.begin();
}

void loop() {

float h = dht.readHumidity();
float t = dht.readTemperature();

if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.println(" *C");

if (digitalRead(buttonPin1) == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}

// Check button state for Servo motor (Door lock control)
if (digitalRead(buttonPin2) == HIGH) {
myServo.write(90);
} else {
myServo.write(0); }

delay(200);
}`
To enable the remote control of many devices, a Bluetooth terminal application has been utilized to transmit orders to an Arduino board over Bluetooth technology.

For instance, the command 'L' turns on an LED light, while the command 'D' starts a servo motor to unlock a door. The system has been configured to react to particular orders. It is expected that future advancements will involve the development of a custom application using MIT App Inventor with the goal of enhancing the system control user interface.

This project has provided significant educational benefits, greatly enhancing the understanding of Arduino hardware and C++ programming languages. The integration of sensors, motors, and Bluetooth control mechanisms has opened up numerous possibilities for further exploration. As progress continues, it is expected that the system will be refined and augmented with additional features.

Input from peers and experts in the domain is encouraged, as is the sharing of experiences related to similar home automation projects that incorporate Arduino or C++. Such collaborative discussions are intended to promote knowledge sharing and foster collective expertise in the field.

arduino Article's
30 articles in total
Favicon
ESP32 Weather Dashboard with a WiFi Menu
Favicon
Broadcom APDS η³»εˆ—ζ™Άη‰‡
Favicon
Matter protocol on a budget
Favicon
Ulanzi TC001 - ESP32 Programming / Custom Arduino firmware
Favicon
Building a Security System, with motion detection and time based settings using Arduino
Favicon
Blueprint[1]: Arduino IoT Cloud x Blynk Cloud Integration
Favicon
A Code for Monitoring Temperature and Humidity with Arduino - Made by Gollum...
Favicon
How to Build a Line Follower Robot with Arduino
Favicon
Talk about binary search and its application on Arduino
Favicon
How I Automated a Greenhouse with IoT: The AgriSense Story
Favicon
Training portal to learn about XSS defenses and Arduino
Favicon
IRRemote 程式庫搭配 Adafruit_NeoPoxel η¨‹εΌεΊ«ηš„ε•ι‘Œ
Favicon
De[v]log#5: Arduino Cloud & Blynk Integration
Favicon
Home Automation System with Arduino and C++
Favicon
Automating Arduino Library Deployment with GitHub Actions: Version Validation, Pull Requests, and Release Automation
Favicon
Arduino Serial.parseInt ε‡½εΌηš„ι‹δ½œζ–ΉεΌ
Favicon
Implementing I2C for the ATtiny85
Favicon
Beyond the Blinky LED: Building a Command Interpreter for Microcontrollers
Favicon
η”¨η¨‹εΌζŽ§εˆΆ Arduino UNO R4 WiFi ηš„ TX/RX ζŒ‡η€Ίη‡ˆ
Favicon
Unlock Efficient Coding: Master Embedded Systems with Finite State Machines
Favicon
LCD 1602 Keypad Shield: How do you feel?
Favicon
the LivinGrimoire software design pattern
Favicon
Curso de Arduino, Marketing Digital e Outros Gratuitos Da UFSCar
Favicon
reading temperature and humidity data from dht11 sensor with arduino
Favicon
Connecting an Arduino MKR WiFi 1010 to AWS IoT Core
Favicon
Vending Machine Controller
Favicon
SmartRobot FollowLine & IoT
Favicon
PequeΓ±o tutorial sobre Arduino
Favicon
Getting Started with STM32 Blue Pill in Arduino IDE Using a USB to TTL Converter β€” Write Your First Program
Favicon
Controlling a 28BYJ-48 Stepper Motor with Arduino: A Step-by-Step Guide

Featured ones: