Reference
FISH OPERATING RANGES
Guppy:
Temperature range: 22°C to 28°C
pH range: 6.8 to 7.8
Goldfish:
Temperature range: 18°C to 24°C
pH range: 7.0 to 8.4
Tetra:
Temperature range: 22°C to 27°C
pH range: 6.0 to 7.5
HARDWARE CONNECTIONS
Temperature Sensor (DS18B20):
VCC connected to 3.3V
GND connected to GND
DATA connected to GPIO 4
A 4.7kΩ pull-up resistor is placed between DATA and 3.3V
Ultrasonic Sensor (HC-SR04):
VCC connected to 5V
GND connected to GND
TRIG connected to GPIO 18
ECHO connected to GPIO 19 through a voltage divider
Relay Module (ESP32 Control Pins):
Channel 1 (Heater) connected to GPIO 26
Channel 2 (Fan) connected to GPIO 25
Channel 3 (Drain Pump) connected to GPIO 33
Channel 4 (Fill Pump) connected to GPIO 32
OLED Display (I2C):
VCC connected to 3.3V
GND connected to GND
SDA connected to P21
SCL connected to P22
I2C address 0x3C
pH Sensor:
VCC connected to 5V
GND connected to GND
Analog output connected to GPIO 34
Servo Motor:
VCC connected to 5V
GND connected to GND
GPIO 27
IoT
#define BLYNK_AUTH_TOKEN "YiedpE6mnXecXESM-sawyNr_SDkQ-NH9"
#define BLYNK_TEMPLATE_ID "TMPL5Q_5dwQKJ"
#define BLYNK_TEMPLATE_NAME "AquariumSystem"
Sensor Readings
V0 → Temperature (°C) → Double
V1 → Water Level (cm) → Double
V2 → pH → Double
Relay Status Indicators
V3 → Heater State → Integer (0/1)
V4 → Fan State → Integer (0/1)
V5 → Pump OUT → Integer (0/1)
V6 → Pump IN → Integer (0/1)
Fish Mode Control
V7 → Fish Type Selector → Integer (0–2)
Fish Mapping:
0 = Tetra
1 = Goldfish
2 = Guppy
Fish Condition Ranges
V8 → Temp Min → Double
V9 → Temp Max → Double
V11 → pH Min → Double
V12 → pH Max → Double
Control Buttons
V20 → Start Water Change → Push Mode
V23 → Top-Up Water → Push Mode
V30 → Manual Feed → Push Mode
Manual Controls
V41 → Manual Pump OUT → Switch Mode
V42 → Manual Pump IN → Switch Mode
Emergency Control
V40 → Kill Switch → Switch Mode
Ultrasonic calibration
Tank empty = 12.32 cm
Tank with water = 3.0 cm
Ph Sensor ca;ibration
pH 7 voltage = 1.610 V
pH 4 voltage = 1.237 V
Slope = 8.042
Formula:
pH = 7 + 8.042 × (voltage − 1.610)
Comments
Post a Comment