Projects / Solar spice and fruit dryer fan control

Solar spice and fruit dryer fan control

Intermediate3 hGuided buildReviewed

Build it step by step

0 of 6 done
  1. NANOAHT20SHT31V1021.6°C

    Set 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.

  2. NANOAHT20SHT3121.6°C

    Wire the controller

    Connect the Nano, sensors and display and check both readings.

  3. NANOAHT20SHT31IRLZ4421.6°C

    Wire the fan driver

    Add the MOSFET with its pull-down and the Schottky diode across the fan.

  4. NANO

    Test the fan

    Temporarily lower HOT_C to see the fan start from the Nano.

  5. NANOAHT20SHT3121.6°C

    Build the dryer

    Make a box with a dark absorber, a vented lid and the sensors inside and outside.

  6. NANOAHT20SHT3121.6°C

    Weigh the produce

    Weigh a sample each day to see the drying rate with and without the fan.

In short

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

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
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 cathodeFan supply
LM2596 B OUT+ (set to 5.0 V)Nano 5V pinController supply
All groundsJoined: panel -, both OUT-, Nano GND, MOSFET sourceCommon ground
Fan black wireMOSFET drain and Schottky anodeSwitched side with flyback diode
Nano D9MOSFET gate and 10 kΩ to GNDFan control
AHT20 (inside dryer) SDA, SCLNano A4, A5I2C address 0x38
SHT31 (outside) SDA, SCLNano A4, A5I2C address 0x44
OLED SDA, SCLNano A4, A5I2C
AHT20, SHT31 and OLED VCC, GNDNano 5V, GNDPower

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.

CheckExpected
Dull day, cool boxFan off
Humid air inside, warmer than outsideFan on
Inside above 55 °CFan on
No sunEverything 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 →

Ask Lark AI

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.