WEEK 1 (3rd June – 10th June)
Introduction
Drying vegetables using solar energy is an age-old technique, but modern problems call for modern solutions. To ensure consistent drying, protect nutrients, and eliminate dependency on fluctuating weather, we set out to build a smart solar vegetable dryer. Over the past two weeks, I’ve been working on integrating electronics, sensors, and control systems to make this dryer both efficient and intelligent.
This blog documents the journey, components, challenges, and learnings during the first two weeks of development.

Existing Timer-Based Fan Control Mode
Fan | Time of Day | ON Duration | OFF Duration |
---|---|---|---|
F1 | Day | 1 min | 2 min |
F1 | Night | OFF | OFF |
F2 | Day | 2 min | 2 min |
F2 | Night | 5 min | 5 min |
Objective
To design and prototype a automatic temperature control for solar-powered vegetable drying system , using an ESP32 microcontroller, AHT2415C temperature sensor, and AC fans (100 and 1000 CFM).
Note: These are trial stages. The final version of the model will incorporate 9 AC fans, a potentiometer for manual control, and a display screen for user interaction.
System Overview:
Key Components:
Component | Description |
---|---|
ESP32 DevKit v1 | Microcontroller unit with Wi-Fi & Bluetooth capabilities |
AHT2415C | Temperature & humidity sensor with I2C communication |
AC Fans (100 & 1000 CFM) | High-power airflow units to assist moisture removal |
Relay Module (Solid State) | Switch to control high-voltage fans via ESP32 |
Power Supply | Supplies 220V/240V AC to fans; 5V DC to ESP32 |
Block Diagram:
+-------------------------+
| Solar Dryer Box |
+-------------------------+
| |
| AHT2415C Sensor |
| | |
| v |
| ESP32 DevKit v1 |
| | |
| v |
| Relay Module (AC) |
| | |
| v |
| AC Fan (220V) |
| |
+-------------------------+
Workflow:
- AHT2415C measures current temperature inside dryer chamber.
- ESP32 reads sensor data and makes decisions.
- If temperature exceeds threshold, ESP32 activates fan via relay.
- Fan cools down chamber, and control loop continues.
Progress Timeline: For week 1
- Day 1–2: Research on temperature sensors and microcontrollers
- Chose ESP32 DevKit v1 for its connectivity and ease of programming
- Chose AHT2415C for its accuracy and I2C compatibility
- Day 3: Setup Arduino IDE for ESP32
- Installed ESP32 board manager
- Verified connection using Blink sketch
- Day 4: Connected AHT2415C sensor
- Connected using I2C (SDA to GPIO21, SCL to GPIO19)
- Used libraries and confirmed accurate temp/humidity readings
- Day 5: Relay module integration
- Tested relay with light bulb (worked fine)
- Tried controlling fan via relay — fan didn’t turn on
WEEK 2 (11th June – till date)

Code (for trial 1)
#include <wire.h>
#include <Adsfruit_ATHX0.h>
Adafruit_AHTX0 aht;
const int RELAY_PIN = 18; // Relay control pin
const float TEMP_THRESHOLD = 35; // °C to turn on fan
void setup() {
Serial.begin(115200);
Serial.println(“🌡️ AHT + Relay Control”);
// I2C init
Wire.begin(21, 19);
if (!aht.begin()) {
Serial.println(“❌ AHT sensor not found!”);
while (1) delay(10);
}
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, LOW); // Start with fan OFF
Serial.println(“✅ System ready.”);
}
void loop() {
sensors_event_t humidity, temp;
aht.getEvent(&humidity, &temp);
float temperature = temp.temperature;
Serial.print(“🌡️ Temperature: “);
Serial.print(temperature);
Serial.println(” °C”);
if (temperature > TEMP_THRESHOLD) {
Serial.println(“🔥 Temp high! Turning fan ON”);
digitalWrite(RELAY_PIN, HIGH); // Relay ON → Fan ON
} else {
Serial.println(“✅ Temp normal. Fan OFF”);
digitalWrite(RELAY_PIN, LOW); // Relay OFF → Fan OFF
}
delay(200);
}
Progress Timeline: For week 2
- Day 6–7: Diagnosed fan issues
- Cross-checked wiring, relay functionality
- Found relay not compatible with fan’s high inductive load
- Day 8: Fan worked once and then stopped
- The relay got burnt
- Did research to find which solid-state relay (SSR) would be suitable based on fan specifications
- Day 9–11: Focused on choosing a suitable SSR
- Compared SSR models that support inductive AC loads
- Evaluated current, voltage, and heat dissipation requirements
- Yet to receive and test the SSR — currently in the research and selection phase
Current Setup Snapshot
Module | Connection Details |
ESP32 to Sensor | SDA -> GPIO21, SCL -> GPIO19 |
ESP32 to Relay | GPIO18 (Digital pin) -> IN of Relay |
Relay to Fan | AC live wire through relay, neutral direct |
Challenges Faced
- Relay burnout: Initially used a mechanical relay not suited for AC inductive load.
- Fan compatibility: AC fans require careful selection of switching components.
- Voltage handling: Mixing low-voltage ESP32 and 220V AC required safety checks.
Next Steps
- Add user interface (OLED display or app interface) for temperature control
- Enclose all electronics in a weatherproof casing
- Scale up to 9-fan final model with potentiometer and screen control