Solar spice and fruit dryer fan control
Build it step by step
0 of 6 doneSet the converters
Connect the panel in sun and trim one LM2596 to 12.0 V and the other to 5.0 V with a multimeter.
Wire the controller
Connect the Nano, sensors and display and check both readings.
Wire the fan driver
Add the MOSFET with its pull-down and the Schottky diode across the fan.
Test the fan
Temporarily lower HOT_C to see the fan start from the Nano.
Build the dryer
Make a box with a dark absorber, a vented lid and the sensors inside and outside.
Weigh the produce
Weigh a sample each day to see the drying rate with and without the fan.
How do you build a solar spice and fruit dryer fan control?
A solar panel runs a dryer fan only when the air inside is hotter or more humid than it should be, drying spices faster without wasting power. You need Arduino Nano, AHT20 temperature and humidity sensor, SHT31 temperature and humidity sensor, MOSFET IRLZ44N, Resistor 10 kΩ, Schottky Diode 1N5819, 12 V DC fan 80 mm, Solar panel 12 V 10 W, LM2596 Buck Module × 2 and SSD1306 OLED Display. It takes 6 steps and about 180 minutes.
- Level
- Intermediate
- Time
- About 180 min
- Parts
- 10
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- SensorsBuy
- SemiconductorsBuyMOSFET IRLZ44N × 1
- PassivesBuyResistor 10 kΩ × 1
- SemiconductorsBuy
- Motors & ActuatorsBuy
- PowerBuy
- PowerBuy
- DisplaysBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Solar panel + | Both LM2596 IN+ | Panel input (about 18 to 21 V in sun) |
| Solar panel - | Both LM2596 IN- | Ground |
| LM2596 A OUT+ (set to 12.0 V) | Fan red wire and Schottky cathode | Fan supply |
| LM2596 B OUT+ (set to 5.0 V) | Nano 5V pin | Controller supply |
| All grounds | Joined: panel -, both OUT-, Nano GND, MOSFET source | Common ground |
| Fan black wire | MOSFET drain and Schottky anode | Switched side with flyback diode |
| Nano D9 | MOSFET gate and 10 kΩ to GND | Fan control |
| AHT20 (inside dryer) SDA, SCL | Nano A4, A5 | I2C address 0x38 |
| SHT31 (outside) SDA, SCL | Nano A4, A5 | I2C address 0x44 |
| OLED SDA, SCL | Nano A4, A5 | I2C |
| AHT20, SHT31 and OLED VCC, GND | Nano 5V, GND | Power |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "Adafruit AHTX0", "Adafruit SHT31 Library" and "U8g2". Set both LM2596 modules on a multimeter before connecting anything else: one to exactly 12.0 V for the fan and one to exactly 5.0 V for the controller, because the panel gives 18 V or more in full sun. A 12 V panel will not run the controller at night or on dull days, which is fine for a dryer. Keep food-contact surfaces clean and the electronics outside the airflow, away from the produce.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <Adafruit_AHTX0.h>
#include <Adafruit_SHT31.h>
#include <U8x8lib.h>
Adafruit_AHTX0 inside;
Adafruit_SHT31 outside;
U8X8_SSD1306_128X64_NONAME_HW_I2C oled(U8X8_PIN_NONE);
const byte FAN = 9;
const float HOT_C = 55.0; // above this inside temperature, always ventilate
const float HUM_ON = 3.0, HUM_OFF = 1.0; // inside minus outside humidity, in percentage points
bool fanOn = false;
void setup() {
pinMode(FAN, OUTPUT);
inside.begin();
outside.begin(0x44);
oled.begin();
oled.setFont(u8x8_font_chroma48medium8_r);
}
void loop() {
sensors_event_t h, t;
inside.getEvent(&h, &t);
float inT = t.temperature, inH = h.relative_humidity;
float outT = outside.readTemperature(), outH = outside.readHumidity();
float diff = inH - outH;
if (inT > HOT_C) fanOn = true;
else if (!fanOn && diff > HUM_ON && inT > outT) fanOn = true;
else if (fanOn && diff < HUM_OFF && inT < HOT_C - 3) fanOn = false;
digitalWrite(FAN, fanOn);
char b[17], v[8];
dtostrf(inT, 4, 1, v); snprintf(b, sizeof b, "In %sC %2d%%", v, (int)inH); oled.drawString(0, 1, b);
dtostrf(outT, 4, 1, v); snprintf(b, sizeof b, "Out %sC %2d%%", v, (int)outH); oled.drawString(0, 3, b);
oled.drawString(0, 5, fanOn ? "Fan ON " : "Fan OFF");
delay(5000);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Dull day, cool box | Fan off |
| Humid air inside, warmer than outside | Fan on |
| Inside above 55 °C | Fan on |
| No sun | Everything off |
If it does not work
Nano resets
The 5 V converter is set too low or the panel is shaded.
Fan always on
Check the sensors and the humidity limits, and the MOSFET pull-down.
Fan never starts
Check the 12 V converter and the gate wire.
Wrong readings
Keep the inside sensor away from the fan's airflow shadow.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the solar spice and fruit dryer fan control?
Arduino Nano, AHT20 temperature and humidity sensor, SHT31 temperature and humidity sensor, MOSFET IRLZ44N, Resistor 10 kΩ, Schottky Diode 1N5819, 12 V DC fan 80 mm, Solar panel 12 V 10 W, LM2596 Buck Module × 2 and SSD1306 OLED Display.
How long does the solar spice and fruit dryer fan control take to build?
About 180 minutes for a intermediate maker, in 6 steps.
How do I know the solar spice and fruit dryer fan control works?
Dull day, cool box: Fan off. Humid air inside, warmer than outside: Fan on. Inside above 55 °C: Fan on.
Nano resets: what should I check?
The 5 V converter is set too low or the panel is shaded.
Fan always on: what should I check?
Check the sensors and the humidity limits, and the MOSFET pull-down.
Fan never starts: what should I check?
Check the 12 V converter and the gate wire.
Wrong readings: what should I check?
Keep the inside sensor away from the fan's airflow shadow.
