|
Arduino UNO R4 |
x 1 | |
|
Relay |
x 1 | |
|
12-22/BHR6C-A01/2CEverlight Electronics Co Ltd
|
x 1 | |
|
SolderJumper_3_Open |
x 1 |
|
Soldering Iron Wire |
|
|
Soldering Iron Kit |
|
|
Arduino Web Editor |
DIY Home Automation using Arduino UNO R4
Welcome to this beginner's guide to making your own home automation system, leveraging the prowess of an Arduino Board, Arduino IoT Cloud, and the convenience of mobile phone control. Delving into the realm of home automation opens doors to streamlined living, where diverse devices can be managed effortlessly and conveniently. In the following comprehensive tutorial, we will navigate you through the process of assembling and configuring an Arduino-based system, empowering you to remotely oversee and manipulate devices through the amalgamation of internet power and smartphone finesse. Prepare to embark on this journey, culminating in the creation of a futuristic, interconnected domicile.
Components Required Smart Home
The foundational component is an Arduino Board sporting Wireless connectivity. In this project, I'll be employing the Arduino UNO R4 WiFi variant. Equipped with a Renesas RA4M1 32-bit Cortex®-M4 CPU, this elevated iteration of the esteemed Arduino UNO board boasts novel attributes such as wireless connectivity, USB type C connector, 5V operating voltage, and backward compatibility with legacy sensors and libraries. For a deeper dive into its features, refer to our preceding video expounding on Arduino specifics.
The roster of necessities extends to resistors, LEDs, MOSFETs, and interconnecting wires. A breadboard is also requisite for preliminary testing.
The Smart Home Circuit
Let's now unveil the circuit configuration and its components. The assembly comprises an Arduino unit, several MOSFETs, 7805 voltage regulators, LEDs, and header pins. Among these, a header pin designated for voltage input is pivotal. This input, sourced from a 9-volt battery or a 12-volt DC adapter, interfaces with a 7805 voltage regulator, converting the Vin into a stable 5V DC supply, amenable for numerous device connections.
Prominent in the Arduino Home Automation Circuit are two MOSFETs functioning as switches, linked to Arduino's pin 8 and pin 9. Manipulating these pins empowers control over the MOSFETs, thereby initiating or halting circuit flow. Terminal blocks tethered to these MOSFETs facilitate connectivity with electronic devices, leading to circuit closure or opening, contingent on MOSFET states.
Further terminal blocks, connected to Arduino's pins 10, 11, 12, and 13, present an avenue to interface with 5V operating voltage devices. Optionally, these points can accommodate a 5-volt relay for experimentation with AC devices.
A standout feature of this Arduino board is its 5-volt operating voltage, ensuring compatibility with sensors and modules suited for its predecessor. For any external sensor or module integrations, the available header pins serve as valuable connection points.
Materializing the Arduino Home Automation PCB
Once the circuit design culminates, I undertook the task of devising a compact PCB using Altium. This structured layout accommodates the seamless arrangement of all components. Noteworthy is the dual-layer nature of this PCB, evidenced by routing on both sides. The utilization of Altium PCB Designer's interactive routing strategies accelerates track creation within PCBs.
The next phase involves procuring the PCBs from PCBWay, a specialist in PCB prototyping, limited-volume production, and tidy PCB Assembly.
To initiate this process, visit the PCBWay platform, input core board details within the instant order form, and proceed to furnish more elaborate specifics within the ensuing form. This will lead to uploading the Gerber file for review. Subsequent steps encompass adding the design to your cart, executing the payment, and anticipating PCB delivery.
With components and PCB in hand, the assembly proceeds. Each component is meticulously soldered onto the PCB, with keen attention to component polarity. The resulting PCB assembly embodies meticulous workmanship.
Software Configuration through Arduino IoT Cloud
Transitioning to the software facet, the Arduino IoT Cloud becomes the focus of programming endeavors. Encompassing home automation setup entails accessing the Arduino IoT Cloud and logging in using your credentials. Beneath "things," your linked projects materialize. In this context, "Arduino Home Automation" represents the configured project.
Within this sphere, properties germane to the project manifest. The presence of four Cloud variables—device1, device2, device3, and device4—is evident. This project converges with the earlier introduced Arduino Uno R4.
Setting Up Home Automation using Arduino IoT Cloud
For those unfamiliar with programming Arduino boards via Arduino IoT Cloud and managing them through browsers, our antecedent instructional video outlines the entire process. For in-depth comprehension, indulge in the video and progress onward.
Additionally, network configurations have been articulated. The rationale behind the four variables pertains to overseeing four devices. Navigating to the dashboard, you'll be greeted by four buttons.
These buttons correspond with the four earlier-mentioned variables. Toggling a switch transforms the value of device1, altering its state to "True" for activation and "False" for deactivation. Perusing the code and sketch affords insights into the underlying logic.
Deciphering the Code
A perusal of the code reveals the preemptive declaration of the four variables. Within the setup function, serial communication initiation and the designation of output pins for pins 10, 11, 12, and 30 transpire. These pins govern LEDs, interfaced through header pins. Subsequently, Wi-Fi connectivity to the previously configured network is established.
/* Sketch generated by the Arduino IoT Cloud Thing "Untitled" https://create.arduino.cc/cloud/things/b484bb8d-7fea-47d5-9f90-dc2cbe11f30a Arduino IoT Cloud Variables description The following variables are automatically generated and updated when changes are made to the Thing bool device1; bool device2; bool device3; bool device4; Variables which are marked as READ/WRITE in the Cloud Thing will also have functions which are called when their values are changed from the Dashboard. These functions are generated with the Thing and added at the end of this sketch. */ #include "thingProperties.h" void setup() { // Initialize serial and wait for port to open: Serial.begin(9600); // This delay gives the chance to wait for a Serial Monitor without blocking if none is found delay(1500); pinMode(10, OUTPUT); pinMode(11, OUTPUT); pinMode(12, OUTPUT); pinMode(13, OUTPUT); // Defined in thingProperties.h initProperties(); // Connect to Arduino IoT Cloud ArduinoCloud.begin(ArduinoIoTPreferredConnection); /* The following function allows you to obtain more information related to the state of network and IoT Cloud connection and errors the higher number the more granular information you’ll get. The default is 0 (only errors). Maximum is 4 */ setDebugMessageLevel(2); ArduinoCloud.printDebugInfo(); } void loop() { ArduinoCloud.update(); // Your code here } /* Since Device1 is READ_WRITE variable, onDevice1Change() is executed every time a new value is received from IoT Cloud. */ void onDevice1Change() { if (device1 == true) { digitalWrite(10, HIGH); } else { digitalWrite(10, LOW); } } /* Since Device2 is READ_WRITE variable, onDevice2Change() is executed every time a new value is received from IoT Cloud. */ void onDevice2Change() { if (device2 == true) { digitalWrite(11, HIGH); } else { digitalWrite(11, LOW); } } /* Since Device3 is READ_WRITE variable, onDevice3Change() is executed every time a new value is received from IoT Cloud. */ void onDevice3Change() { if (device3 == true) { digitalWrite(12, HIGH); } else { digitalWrite(12, LOW); } } /* Since Device4 is READ_WRITE variable, onDevice4Change() is executed every time a new value is received from IoT Cloud. */ void onDevice4Change() { if (device4 == true) { digitalWrite(13, HIGH); } else { digitalWrite(13, LOW); } }
The loop function continually monitors the four variables—device1, device2, device3, and device4. Any variation in their states triggers respective functions like onDevice1Change() and onDevice2Change(). The functions are designed to manipulate the pins based on variable states, thus influencing LED states.
Uploading the Code and Testing
Uploading the code onto your Arduino board, followed by monitoring through the serial interface, ensures a successful connection with Arduino IoT Cloud. With successful integration, the dashboard becomes your control panel. Through it, you can sequentially activate and deactivate LEDs via switches linked to respective variables. This manipulation extends to mobile devices as well, courtesy of the Arduino IoT Cloud app. Installing the app, connecting to your account, and accessing the dashboard allows seamless remote control through smartphone interaction.
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/b484bb8d-7fea-47d5-9f90-dc2cbe11f30a
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
bool device1;
bool device2;
bool device3;
bool device4;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
// Your code here
}
/*
Since Device1 is READ_WRITE variable, onDevice1Change() is
executed every time a new value is received from IoT Cloud.
*/
void onDevice1Change() {
if (device1 == true) {
digitalWrite(10, HIGH);
}
else
{
digitalWrite(10, LOW);
}
}
/*
Since Device2 is READ_WRITE variable, onDevice2Change() is
executed every time a new value is received from IoT Cloud.
*/
void onDevice2Change() {
if (device2 == true) {
digitalWrite(11, HIGH);
}
else
{
digitalWrite(11, LOW);
}
}
/*
Since Device3 is READ_WRITE variable, onDevice3Change() is
executed every time a new value is received from IoT Cloud.
*/
void onDevice3Change() {
if (device3 == true) {
digitalWrite(12, HIGH);
}
else
{
digitalWrite(12, LOW);
}
}
/*
Since Device4 is READ_WRITE variable, onDevice4Change() is
executed every time a new value is received from IoT Cloud.
*/
void onDevice4Change() {
if (device4 == true) {
digitalWrite(13, HIGH);
}
else
{
digitalWrite(13, LOW);
}
}
DIY Home Automation using Arduino UNO R4
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Krishna S
- DIY Home Automation using Arduino UNO R4 Welcome to this beginner's guide to making your own home automation system, leveraging the prowess o...
- Getting Plants Watered Automatically: A Guide to Scheduling In this guide, we'll explore how using a scheduler in your DIY electronic projects can automate your...
- DIY Motion Triggered Halloween Prop using Arduino/Digispark Having Halloween decorations that come to life is absolutely fun. Unfortunately, there are significa...
- Control your Home Devices using Arduino and Personal Assistant IntroductionIn the previous video, we build an Alexa-controlled Door Locking System. So many people ...
- Making A Gesture Controller Glove using Hall Effect Sensor StoryHey guys, in this video, we will be making a compact circuit that can be fitted in a glove to c...
- Voice Controlled Door Lock using Alexa and Arduino Voice Controlled Door Lock: An OverviewHey, everyone! Welcome back. In this video, we'll make an Ale...
- Making a DIY Soldering Fume Extractor with Lighting IntroductionSoldering is awesome, right? It's fun to make our own PCB for our project, but there are...
- Driving 4 High Current Motors in your Robot using a Simple L293D Piggy Backed Arduino Nano Shield StoryHey, guys welcome back, In this post, I will show you how you can make your own high current mo...
- USB Joystick using Arduino for Robotics and Computer Game Hey guys, in this video, we are going to make an amazing compact joystick using Arduino. We can use ...
- How to make an Arduino UNO at Home? DIY Arduino In this project, we are going to be making our own customized Arduino Uno board and I will be showin...
- Beating Heart PCB for Valentines Day | Love is in the Circuit Hey guys it’s valentine’s day! So let me ask you a question. what gift are you going to give to your...
- 5V – 3.3V Logic Level Shifter IC for Arduino and Raspberry Pi 5V – 3.3V Logic Level Shifter IC for Arduino and Raspberry PiHey, Guys welcome back to RootSaid. In ...
- Lets make an IOT based plant watering system using Arduino Nano 33 IoT, some pumps and an Android Smart Phone. IntroductionHome automation is a popular subject these days and with excellent cause. Our smart devi...
- DIY Photoshop Editing Console using Arduino Nano RP 2040 Making a DIY Photoshop Editing ConsoleWhat if there was something that we could use to quickly chang...
- DIY Halloween Pumpkin using Arduino It’s time to get ready for Halloween! We’re going to be doing a lot of DIY stuff this month, so stay...
- Drink Like James Bond! DIY Cocktail Mixer Using Arduino Robotic BartenderThis weekend you can make your next cocktail party an even bigger success by buildi...
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
74 0 0 -
DIY Laser Power Meter with Arduino
86 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
120 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
416 0 1 -
Custom Mechanic Keyboard - STM32
243 0 3