Arduino Mega 2560-Based Smart Fan Control System with Temperature and Water Level Monitoring
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control various components using an Arduino Mega 2560 microcontroller. The circuit includes multiple pushbuttons, LEDs of different colors, a DC motor, a stepper motor, a water level sensor, a temperature and humidity sensor, an LCD display, a real-time clock (RTC), and a motor driver. The system is programmed to monitor temperature, humidity, and water levels, and to control the state of LEDs, motors, and a fan based on these readings.
Component List
Pushbutton
- Description: A simple pushbutton switch.
- Pins: Pin 1 (in), Pin 2 (in), Pin 3 (out), Pin 4 (out)
LED: Two Pin (blue)
- Description: A blue LED.
- Pins: Cathode, Anode
LED: Two Pin (green)
- Description: A green LED.
- Pins: Cathode, Anode
LED: Two Pin (red)
- Description: A red LED.
- Pins: Cathode, Anode
LED: Two Pin (yellow)
- Description: A yellow LED.
- Pins: Cathode, Anode
Resistor
- Description: A resistor with a resistance of 200 Ohms.
- Pins: Pin 1, Pin 2
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, SDA, SCL, AREF
DS1307 RTC (Wokwi Compatible)
- Description: A real-time clock module.
- Pins: GND, 5V, SDA, SCL, SQW
TEMP
- Description: A temperature and humidity sensor.
- Pins: 5V, D3, GND
LCD Display (16 pin)
- Description: A 16-pin LCD display.
- Pins: VSS, VDD, VO, RS, R_W, E, DB0-DB7, A, K
Trimmer Potentiometer
- Description: A trimmer potentiometer with a resistance of 10k Ohms.
- Pins: Leg 1, Wiper, Leg 2
L293D
- Description: A motor driver IC.
- Pins: Enable 1,2, Input 1-4, Output 1-4, GND, VCC1, VCC2, Enable 3,4
DC Motor
- Description: A simple DC motor.
- Pins: Pin 1, Pin 2
Water Level Sensor
- Description: A water level sensor.
- Pins: SIG, VCC, GND
28BYJ-48 Stepper Motor
- Description: A stepper motor.
- Pins: BLUE, PINK, YELLOW, ORANGE, RED
ULN 2003
- Description: A Darlington transistor array.
- Pins: IN1-IN7, GND, +, COIL1-COIL5
Wiring Details
Pushbutton
- Pin 1 (in) and Pin 2 (in) are connected together.
- Pin 3 (out) and Pin 4 (out) are connected together.
- Pin 3 (out) and Pin 4 (out) are connected to the Arduino Mega 2560 at:
- D8 PWM
- D7 PWM
- D35
- D33
LED: Two Pin (blue)
- Anode is connected to Arduino Mega 2560 at D12 PWM.
- Cathode is connected to a resistor (200 Ohms).
LED: Two Pin (green)
- Anode is connected to Arduino Mega 2560 at D11 PWM.
- Cathode is connected to a resistor (200 Ohms).
LED: Two Pin (red)
- Anode is connected to Arduino Mega 2560 at D9 PWM.
- Cathode is connected to a resistor (200 Ohms).
LED: Two Pin (yellow)
- Anode is connected to Arduino Mega 2560 at D10 PWM.
- Cathode is connected to a resistor (200 Ohms).
Resistor
- Pin 1 is connected to the cathode of the respective LED.
- Pin 2 is connected to the ground.
Arduino Mega 2560
- GND is connected to:
- Pushbuttons
- LCD Display (VSS, R_W, K)
- Resistors
- DS1307 RTC
- TEMP sensor
- Water Level Sensor
- L293D
- 5V is connected to:
- LCD Display (VDD, A)
- DS1307 RTC
- TEMP sensor
- Water Level Sensor
- L293D
- D2 PWM is connected to L293D (Input 1).
- D3 PWM is connected to TEMP sensor (D3).
- D8 PWM is connected to Pushbutton (Pin 3 and Pin 4).
- D7 PWM is connected to Pushbutton (Pin 3 and Pin 4).
- D9 PWM is connected to LED (red) anode.
- D10 PWM is connected to LED (yellow) anode.
- D11 PWM is connected to LED (green) anode.
- D12 PWM is connected to LED (blue) anode.
- D23, D25, D27, D29 are connected to ULN 2003 (IN1-IN4).
- D33 is connected to Pushbutton (Pin 3 and Pin 4).
- D35 is connected to Pushbutton (Pin 3 and Pin 4).
- D40, D42, D44, D46 are connected to LCD Display (DB4-DB7).
- D50 is connected to LCD Display (RS).
- D52 is connected to LCD Display (E).
- A15 is connected to Water Level Sensor (SIG).
- SDA is connected to DS1307 RTC (SDA).
- SCL is connected to DS1307 RTC (SCL).
DS1307 RTC (Wokwi Compatible)
- GND is connected to Arduino Mega 2560 (GND).
- 5V is connected to Arduino Mega 2560 (5V).
- SDA is connected to Arduino Mega 2560 (SDA).
- SCL is connected to Arduino Mega 2560 (SCL).
TEMP
- GND is connected to Arduino Mega 2560 (GND).
- 5V is connected to Arduino Mega 2560 (5V).
- D3 is connected to Arduino Mega 2560 (D3 PWM).
LCD Display (16 pin)
- VSS is connected to GND.
- VDD is connected to 5V.
- VO is connected to Trimmer Potentiometer (wiper).
- RS is connected to Arduino Mega 2560 (D50).
- R_W is connected to GND.
- E is connected to Arduino Mega 2560 (D52).
- DB0-DB3 are not connected.
- DB4 is connected to Arduino Mega 2560 (D40).
- DB5 is connected to Arduino Mega 2560 (D42).
- DB6 is connected to Arduino Mega 2560 (D44).
- DB7 is connected to Arduino Mega 2560 (D46).
- A is connected to 5V.
- K is connected to GND.
Trimmer Potentiometer
- Leg 1 is connected to 5V.
- Wiper is connected to LCD Display (VO).
- Leg 2 is connected to GND.
L293D
- Enable 1,2 is connected to 5V.
- Input 1 is connected to Arduino Mega 2560 (D2 PWM).
- Output 1 is connected to DC Motor (Pin 1).
- GND is connected to GND.
- Output 2 is connected to DC Motor (Pin 2).
- VCC2 is connected to 5V.
DC Motor
- Pin 1 is connected to L293D (Output 1).
- Pin 2 is connected to L293D (Output 2).
Water Level Sensor
- SIG is connected to Arduino Mega 2560 (A15).
- VCC is connected to 5V.
- GND is connected to GND.