Watches water temperature and clarity, and feeds the fish on a timer.
Built and tested by Drisya K S · Industrial Robotics Institute

A smart aquarium controller. A waterproof DS18B20 measures water temperature and a turbidity sensor checks how cloudy the water is; both are sent to the Blynk app, with a buzzer alert if either goes out of the safe range. A servo-driven feeder drops food automatically at a set interval.
| Component | Qty |
|---|---|
| ESP32 Dev Board | 1 |
| Waterproof Temperature Sensor (DS18B20) | 1 |
| Resistor 4.7kΩ (pull-up) | 1 |
| Turbidity Sensor (or pH sensor) | 1 |
| Servo Motor (feeder) | 1 |
| Buzzer | 1 |
| Jumper Wires / Breadboard | As needed |
| 5V Power Supply | 1 |
| From | Connect to |
|---|---|
| DS18B20 VCC | 3.3V |
| DS18B20 GND | GND |
| DS18B20 DATA | GPIO 4 (4.7kΩ to 3.3V) |
| Turbidity VCC | 5V |
| Turbidity GND | GND |
| Turbidity OUT | GPIO 34 (via divider to 3.3V) |
| Servo VCC | 5V |
| Servo GND | GND |
| Servo signal | GPIO 5 |
| Buzzer + | GPIO 26 |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP32.
#define BLYNK_TEMPLATE_ID "YourTemplateID"
#define BLYNK_TEMPLATE_NAME "Smart Aquarium"
#define BLYNK_AUTH_TOKEN "YourAuthToken"
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <ESP32Servo.h>
char ssid[] = "YourWiFiName";
char pass[] = "YourWiFiPassword";
#define ONE_WIRE_BUS 4
#define turbidityPin 34
#define buzzerPin 26
#define servoPin 5
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
Servo feeder;
float tempThreshold = 30.0;
int turbidityThreshold = 500;
unsigned long feedInterval = 12UL * 60 * 60 * 1000; // every 12 hours
unsigned long lastFeed = 0;
void feedFish() {
feeder.write(90);
delay(1000);
feeder.write(0);
}
void setup() {
Serial.begin(115200);
sensors.begin();
feeder.attach(servoPin);
feeder.write(0);
pinMode(buzzerPin, OUTPUT);
Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
}
void loop() {
sensors.requestTemperatures();
float temperature = sensors.getTempCByIndex(0);
int turbidity = analogRead(turbidityPin);
Blynk.virtualWrite(V1, temperature);
Blynk.virtualWrite(V2, turbidity);
if (temperature > tempThreshold || turbidity > turbidityThreshold) {
digitalWrite(buzzerPin, HIGH);
Blynk.virtualWrite(V3, "Water Condition Alert!");
} else {
digitalWrite(buzzerPin, LOW);
Blynk.virtualWrite(V3, "Water OK");
}
// Automatic feeding on a timer
if (millis() - lastFeed >= feedInterval) {
lastFeed = millis();
feedFish();
}
Blynk.run();
delay(2000);
}A smart aquarium controller. A waterproof DS18B20 measures water temperature and a turbidity sensor checks how cloudy the water is; both are sent to the Blynk app, with a buzzer alert if either goes out of the safe range.
You need: ESP32 Dev Board (1), Waterproof Temperature Sensor (DS18B20) (1), Resistor 4.7kΩ (pull-up) (1), Turbidity Sensor (or pH sensor) (1), Servo Motor (feeder) (1), Buzzer (1), Jumper Wires / Breadboard, 5V Power Supply (1). Software: Arduino IDE, Blynk IoT app, OneWire library, DallasTemperature library, ESP32Servo library.
It is rated intermediate and takes about 3–4 hours to build, using the ESP32. The guide on this page explains every connection and step.
The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.
Yes. IRI sells a kit with the parts for this project (PRJ-161). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.