This week assignement is about building a smart circuit that Communicate wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on our phone or PC. So for that reason i am inspired from my final project circuit and used this week as a testing for the circuit . As we all know,Photovoltaic systems need regular washing to avoid efficiency degradation. Dust deposition on the surface limits solar penetration into photovoltaics and consequently the PV output. Efficiency may fall by 50% after a month without cleaning the modules. For that reason i designed a smart circuit which will clean the panel from a phone in an interval of time.
arduino software for coding the circuit
to build the circuit
Arduino bluetooth controler app to connect Arduino with mobile phone
arduino uno with usb cable
1 channel relay
bluetoth module sensor for remote control mode
220ohm resistors
6mm PVC tube
jumpers
RGB led for system state indication
breadboard
push buttons for starting the cleaning and increasing and decreasing the interval time of cleaning
12v adaptor for input power
12v pump for pumping water
16*2 LCD screen
a barrel jack for connecting adapter to the pump and breadboard
Circuit on tinker cad
INPUTS:
I used two types of input components, one are the three push buttons(one that tells the the Arduino to start watering, second one to add more time to watering cycle and third to reduces the watering cycle. All buttons are connected with internal pull-up resistors. When pressed, they send a LOW signal to the Arduino, making them easy to read.
second type is a Bluetooth Module (HC-05) that receives commands like "START", "INC", "DEC" from an Android phone. This lets the user control the system wirelessly instead of pressing buttons. Together, these inputs give the user two ways of controlling the system: either directly (buttons) or remotely (Bluetooth).
ACTION COMPONENTS:
Relay Module
Connected to pin 8 of the Arduino.
Acts like an electronic switch that controls the water pump.
When the Arduino outputs a HIGH signal, the relay closes its contacts and powers the pump ,water flows.
When the Arduino outputs LOW, the relay cuts the power and stops the pump.
RGB LED
Connected to pins 5 (Red), 6 (Green), and 9 (Blue).
Used as a status indicator:
Blue : waiting for command.
Red : Watering in progress.
Green :Watering cycle finished.
This gives a quick, colorful way to check the system state without reading the LCD.
LCD Display (16x2 with I2C)
Connected to Arduino via I2C (SDA &SCL)
It shows:
System name on startup.
Current watering time.
Countdown during watering.
“Watering Done” message when finished.
The LCD makes the system user-friendly by giving live updates.
I programmed this project in a way that the Arduino always waits for two types of input: either button presses or Bluetooth commands. Based on what input comes in, it changes the watering time or starts the pump.
The relay physically controls the pump, the LCD gives me live feedback, and the RGB LED adds a quick color signal. Together, they make the system easy to use both manually (buttons) and wirelessly (phone).
The code is AI labeled for inspiration and therefore customized for the purpose of the circuit requirement.
I used the LiquidCrystal_I2C library to control the 16×2 LCD screen
Relay controls the water pump,RGB LED is on pins 5, 6, 9 respectively are all PWM pins, so analogWrite() works correctly.Buttons use pins 2, 3, and 4 with INPUT_PULLUP.
Default watering time = 5s,each press of INC or DEC changes time by 1s.Limits are 1s minimum and 60s maximum.
This function prevents starting a new watering cycle while one is already running.
Relay OFF at startup.
Buttons ready with pull-ups.
LCD backlight ON.
RGB LED set to blue .
LCD shows default time.
Each button press changes wateringTime or starts watering.Bluetooth commands are read as strings and passed to handleBT(cmd).
"START" → begin watering.
"INC" / "DEC" → adjust watering time.
"TIME=xx" → set watering time (xx seconds).
Sends back confirmation to phone.
Checks if already watering to avoids conflicts.Turns relay ON, LED red, shows countdown on LCD.Uses a blocking while-loop (buttons/Bluetooth won’t work until watering ends).At the end: relay OFF, LED green, “done” message, then back to idle.
updateLCD() → always shows project name and time.
setColor() → controls RGB LED brightness with analogWrite().
connecting the relay to the pin 8 of arduino, vr to 5V pin on breadboard,gnd to ground of breadboard.the positive of adapter is connected to the NO of relay ,ground of pump connected to ground of relay.the negative of adapter connected to positive of pump.
For wiring BLUETOOTH module : connect "VCC" to "5v" arduino , connect "GND" to "ground" ARDUINO, connect "TXD" to "RX" pin on ARDUINO and connect "RXD" with ground to resistor 1k OUM then to TX pin on ARDUINO
Connected to pins 5 (Red), 6 (Green), and 9 (Blue).
Blue : waiting for command.
Red : Watering in progress.
Green :Watering cycle finished.
complete electronic circuit
connecting my blutooth device to the app and testing
manual mode controlling circuit video
video of remote control using phone and Bluetooth module
One of the challenges that i had was when i was sending commands from the phone, it wasn’t working properly. Sometimes the Arduino didn’t understand the command,so i made sure the baud rate was correct (9600 for HC-05), trimmed extra spaces from the received data using cmd.trim(), and added a clear structure for commands (START, INC, DEC, TIME=xx).
Another challenge was with the blutooth module and the serial monitor.The Arduino Uno has only one hardware serial port (pins 0 & 1). Using both Bluetooth and the Serial Monitor together gave me no response so used the hardware serial only for Bluetooth communication, and not rely on the Serial Monitor for debugging. Instead, I tested directly with the Bluetooth app on my phone.
Also I didn’t run everything at once. First, I tested the LCD alone, then the relay, then buttons, then the RGB LED, and finally the Bluetooth.In early stages, I used the Serial Monitor to print variable values and commands, which helped me see if the Arduino was receiving the right data.