Rain is a natural phenomenon that often occurs in several countries, especially tropical regions like Indonesia. This phenomenon can be a blessing and can also be a disaster for some people. Basically, this project was created to help the community in terms of rain detection. In addition, it aims to educate as well as make a real contribution to technological development. This project has been done and took approximately 3 days. This device can work well with or without water. When in wet conditions, the sensor will turn on the LED and send a response according to the situation. When dry, the sensor will turn off the LED and send a response according to the situation. The innovation applied in this project is I2C communication. The system interface can be accessed via Serial Monitor.
Part | Description |
---|---|
Development Board | • Arduino Mega 2560 • Arduino Nano V3 |
Code Editor | Arduino IDE |
Driver | CH340 USB Driver |
Communications Protocol | Inter Integrated Circuit (I2C) |
Programming Language | C/C++ |
Arduino Library | Wire (default) |
Actuators | LED (x1) |
Sensor | MH-RD: Raindrop Sensor Module (x1) |
Other Components | • USB type B cable - USB type A (x1) • Mini USB cable - USB type A (x1) • Jumper cable (1 set) |
-
Arduino IDE
https://bit.ly/ArduinoIDE_Installer
-
CH340 USB Driver
https://bit.ly/CH340_USB_Driver
Pictorial Diagram | Wiring |
---|---|
Block Diagram |
---|
Basically, a device can be communicated with other devices either wirelessly or by cable. Communication between commonly used hardware is Serial Communication
. It can be known that there are three types of Serial Communication
, which include: UART (Universal Asynchronous Receiver-Transmitter)
, SPI (Serial Peripheral Interface)
, and I2C (Inter Integrated Circuit)
. I2C (Inter Integrated Circuit)
is a two-way serial communication standard that uses two channels to send data (OUTPUT from Master to Slave)
and receive data (INPUT from Slave to Master)
. I2C uses two bidirectional lines: Serial Data (SDA)
and Serial Clock (SCL)
to transfer data and synchronize communication between devices. Each device connected to the I2C bus
has a unique address that identifies it during communication. The I2C protocol
allows multiple devices to share the same bus, and each device can act as a master
or a slave
. Master
is the primary device that has full authority over the control of the Slave, while the Slave
is the secondary device that is under the authority of the Master device.
-
Open the
Arduino IDE
first, then open this project by clickingFile
->Open
:•
I2C_Master.ino
•
I2C_Slave.ino
-
Board Setup
in Arduino IDEi
How to setup the
Arduino Mega 2560
boardClick
Tools
->Board
->Arduino AVR Boards
->Arduino Mega or Mega 2560
ii
How to setup the
Arduino Nano
boardClick
Tools
->Board
->Arduino AVR Boards
->Arduino Nano
-
Change Processor
in Arduino IDEi
How to change the processor of
Arduino Mega 2560
boardThere is nothing to change (Skip it)
ii
How to change the processor of
Arduino Nano
boardClick
Tools
->Processor
->ATmega328P (Old Bootloader)
-
Port Setup
in Arduino IDEClick
Port
-> Choose according to your device port(you can see in device manager)
-
Before uploading the program please click:
Verify
. -
If there is no error in the program code, then please click:
Upload
. -
If there is still a problem when uploading the program, then try to check the
driver
/port
/others
section.
-
Download and extract this repository.
-
Make sure you have the necessary electronic components.
-
Make sure your components are designed according to the diagram.
-
Configure your device according to the settings above.
-
Please enjoy [Done].
Rain Detection Device |
---|
Serial Monitor | |
---|---|
If this work is useful to you, then support this work as a form of appreciation to the author by clicking the ⭐Star
button at the top of the repository.
This application is my own work and is not the result of plagiarism from other people's research or work, except those related to third party services which include: libraries, frameworks, and so on.
MIT License - Copyright © 2024 - Devan C. M. Wijaya, S.Kom
Permission is hereby granted without charge to any person obtaining a copy of this software and the software-related documentation files to deal in them without restriction, including without limitation the right to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons receiving the Software to be furnished therewith on the following terms:
The above copyright notice and this permission notice must accompany all copies or substantial portions of the Software.
IN ANY EVENT, THE AUTHOR OR COPYRIGHT HOLDER HEREIN RETAINS FULL OWNERSHIP RIGHTS. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, THEREFORE IF ANY DAMAGE, LOSS, OR OTHERWISE ARISES FROM THE USE OR OTHER DEALINGS IN THE SOFTWARE, THE AUTHOR OR COPYRIGHT HOLDER SHALL NOT BE LIABLE, AS THE USE OF THE SOFTWARE IS NOT COMPELLED AT ALL, SO THE RISK IS YOUR OWN.