Microcontroller Used: RaspberryPi-Pico : RP2040
Read here.
Some basic information is given below.
flowchart LR;
subgraph "Relay Ch1";
Pump -.- Mains(("~<br>Mains"))
end
subgraph "Relay Ch2";
Buzzer -.- Battery(("9V<br>Battery"))
end
%% Control Module
subgraph "⚙️"
subgraph Relay
direction LR
SP(Start Pump) --> Pump
SB("StartBuzzer") --> Buzzer
%%SP ---> SB
end
Pico-MCU["Pico-MCU"] -."connects to".- Relay
style Pico-MCU fill:#6acf65,stroke:#333,stroke-width:4px, stroke-dasharray: 5 5
end
%% Manual Pump Operation using Touch Switch
subgraph "Maunal Switching"
TS -. "connects to" .-> Pico-MCU
TS{"Touch<br>Switch"} --"true"--> SP
TS--false-->X((X))
Pico-MCU
end
flowchart LR
subgraph "-"
direction LR
RTC[("DS1302<br>RTC")] --current_time--> check_time{"current time<br>==<br>watering time"}
check_time --true--> run_pump
run_pump["Run Pump(2 min)"] ---> S13("Sleep(13 min)")
check_time --false--> S15("sleep(15 min)")
S13 -. return .-> check_time
S15 -. return .-> check_time
end
flowchart LR;
RP("Run Pump") --> SP("Start Pump")
RP --> SB("Start Buzzer")
SB -.- X["Sound Continuously"]
flowchart LR;
TS{"Touch<br>Switch"} --true-->RP("Run Pump")
TS--false-->X(("X"))
flowchart LR;
RTC[("DS1302<br>RTC")] --current time --> Q{"curent time<br>==<br>alarm time"}
Q --true--> RB("Run Buzzer<br>(1 min)")
RB-.-Sound[Beeping Sound]