|
ARDUINO_NANO |
x 1 | |
|
IRF520NPBFJSMICRO/深圳杰盛微
|
x 1 | |
|
J1031C5VDC.15SCIT RELAY AND SWITCH
|
x 1 | |
|
BL-HKC37A-AV-TRBBRIGHT LED ELECTRONICS
|
x 1 | |
|
CMT-8503-90-SMT-TRCUI DEVICES
|
x 1 |
|
Arduino IoT CloudArduino
|
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 gadgets and devices, like having a helpful assistant. It allows you to set specific times or conditions for your creations to do things automatically.
Arduino Nano ESP32
We'll be using the Arduino Nano ESP 32, a compact and powerful board with built-in wireless capabilities, making it easy to connect your projects to the internet. This enables remote control and monitoring from a smartphone or computer.
Arduino IoT Cloud is another tool we'll utilize, allowing easy internet connectivity for your gadgets. This means you can control and monitor your devices from anywhere with an internet connection.
Introduction to the Scheduler
The Arduino IoT Cloud now offers a scheduler feature, providing a helpful assistant for your DIY electronic projects. It allows you to plan when your devices should perform specific tasks automatically. For example, you can set it to turn on lights at a certain time or regularly measure the temperature and send you updates.
Building the Circuit
To demonstrate, we'll create a circuit where you can co"We are about to create a circuit that allows us to connect simple electronic devices, making use of a scheduler. Let's begin with the circuit! I used Altium Designer to create the circuit and design the PCB. In Altium Designer, I will utilize a pump that operates on 12 V, so I'll connect a 12 V DC adapter. The input power is linked to a 7805 regulator, a 5V regulator that converts an input voltage range of 7-32V into a steady 5V DC supply. For easy troubleshooting, there are indicator LEDs at various points.
Within this setup, we have two switches. One is a relay triggered by a BC547 transistor, with its base connected to Digital Pin 3. Additionally, there is a MOSFET connected to Digital Pin 5 of the Arduino. Also, you'll notice a buzzer that is activated and deactivated by this specific transistor. This transistor is connected to digital pin 6 of the Arduino.
You have the option to connect either the lock to the MOSFET or the relay, enabling programmable activation and deactivation. In my design, I opted to connect the pump to the MOSFET so that I could attach another device like a bulb to the relay. The other switch can be used to connect additional devices like a lamp or a motor for activities like opening a door or illuminating a lamp using the scheduler.
Remember, this is my design. As mentioned earlier, I will provide the schematics in the description, allowing you to redesign, customize, and create your own version. Alternatively, you can use my version as is. Regardless of your choice, the first step is to test it on a breadboard. Once you achieve the desired output, you can either keep using it as is or create your PCB.
In my case, I chose to use a PCB. I've designed a PCB layout that facilitates easy mounting of your Arduino Nano ESP32, relays, MOSFETs, and other components. This setup avoids the need for messy wires and cables. Making your own PCB for the project is exciting, isn't it? The board is lightweight and can be powered using a 9V battery or a 9-12 V power adapter, depending on the Solenoid Lock voltage."nnect simple electronic devices for use with the scheduler. The circuit involves various components like switches, relays, and MOSFETs that can be controlled programmatically.
Designing and Making a PCB
We'll design a Printed Circuit Board (PCB) layout to neatly mount the components without messy wires and cables.
This makes your project more organized and allows for efficient use of space.
Ordering and Assembling the PCB
I placed an order for a PCB from PCBWay, a specialized manufacturer known for PCB prototyping, low-volume production, and meticulous PCB assembly. If you're keen on creating your own PCBs for a project, click on the link below. By signing up through this link, you can avail a 5-dollar discount. Additionally, you can also enjoy another 5-dollar discount during checkout by using the coupon code PCBWayLab.
To proceed with your PCB order through PCBWay, visit their website and fill out the basic board details using the instant order form. Following that, you'll be guided to a more detailed form where you can provide comprehensive board specifications. Update your board information in the PCB specification screen. In the subsequent step, you'll have the option to upload your Gerber file and submit it for review. After the review process, simply add the items to your cart, make the payment, and await the arrival of your PCBs.
Once you have all the components and the PCB in hand, it's time to solder them together. Ensure that you solder all the components onto the board, and be meticulous in checking the polarity of each component. After completing the soldering process, the PCB will take on this appearance.
Setting Up Arduino IoT Cloud
We'll log in to the Arduino IoT Cloud and configure the project.
This involves linking the project to the Arduino Nano ESP 32 board and configuring the scheduler variable.
Coding
Now, let's examine the code.
/* Sketch generated by the Arduino IoT Cloud Thing "Untitled" https://create.arduino.cc/cloud/things/c2de411c-d043-429b-8a75-2c24941e8d11 Arduino IoT Cloud Variables description The following variables are automatically generated and updated when changes are made to the Thing CloudSchedule scheduler; 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() { pinMode(13, OUTPUT); pinMode(3, OUTPUT); pinMode(5, OUTPUT); // 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); // 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() { delay(1000); ArduinoCloud.update(); if (scheduler.isActive()) { digitalWrite(9, HIGH); digitalWrite(5, HIGH); digitalWrite(3, HIGH); Serial.println("Scheduler_Activated"); } else { digitalWrite(8, LOW); digitalWrite(5, LOW); digitalWrite(3, LOW); Serial.println("Scheduler_Deactivated"); } }
In the code, we can observe that the variable has been declared already, so there's no need to declare it again. In the setup function, we initialize the serial communication and set the pin mode of specific pins to output. These pins are connected to MOSFET, relay, and LED, with the MOSFET serving as a means to control the device.
After this setup, the Arduino board connects to the Wi-Fi network we configured earlier. In the loop function, we check for any changes in the scheduler variable we previously defined.
Within this if condition, we define the actions to take. For instance, if the scheduler is ON, we turn ON these pins. Conversely, if the scheduler is not activated, we turn off these pins.
All that's left is to compile and upload the code."We are about to create a circuit that allows us to connect simple electronic devices, making use of a scheduler.
Testing the Project
After uploading the code, we'll test the project to ensure the devices are triggered at the right times as per the scheduler settings.
Conclusion
The scheduler feature allows for automation and control of your DIY projects. You can tailor it to various applications and unleash your creativity. If you have any questions or doubts, feel free to ask in the comments.
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/c2de411c-d043-429b-8a75-2c24941e8d11
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
CloudSchedule scheduler;
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() {
pinMode(13, OUTPUT);
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
// 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);
// 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() {
delay(1000);
ArduinoCloud.update();
if (scheduler.isActive()) {
digitalWrite(9, HIGH);
digitalWrite(5, HIGH);
digitalWrite(3, HIGH);
Serial.println("Scheduler_Activated");
}
else
{
digitalWrite(8, LOW);
digitalWrite(5, LOW);
digitalWrite(3, LOW);
Serial.println("Scheduler_Deactivated");
}
}
Getting Plants Watered Automatically: A Guide to Scheduling
*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(2)
- Likes(0)
- 2 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
-
9design
-
7usability
-
8creativity
-
5content
-
9design
-
9usability
-
9creativity
-
6content
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
121 0 0 -
DIY Laser Power Meter with Arduino
172 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
162 0 2 -