breadboard
docs

Example project · Builds & projects

Plant monitor (Nano)

A houseplant dashboard built around the Arduino Nano’s special trick: A6 and A7, two analog-only pins the Uno doesn’t have. The soil probe lives on A6 and a photoresistor light divider on A7, so every digital pin stays free for the 8-LED moisture bar on D2–D9, with all eight series resistors packed into one DIP-16 resistor-array. Real compiled Arduino firmware narrates soil, light and temperature (TMP36 on A0) twice a second. Select the soil sensor and drag its moisture slider. The bar and the plant’s mood follow.

The Plant monitor (Nano) circuit as rendered by the simulator

How it works

This houseplant dashboard uses a feature of the Arduino Nano that the Uno lacks: pins A6 and A7. On the Nano's ATmega328P package, these two pins connect only to the ADC. They have no digital function, so the soil and light sensors leave the numbered digital pins available for the LED bar and other uses. The soil-moisture probe is on A6, a photoresistor divider is on A7, and a TMP36 temperature sensor is on A0. The photoresistor runs from 5 V to A7, with 10 kΩ from A7 to ground, so brighter light pulls A7 higher.

Twice a second the compiled sketch reads all three inputs. The soil probe gives about 2.5 V when the soil is dry and about 0.2 V when it is soaked, and the sketch maps that range to 0–100 %. Light is the A7 reading as a percentage of full scale. The TMP36 gives 0.5 V plus 10 mV per °C. Pins D2 to D9 drive an 8-LED moisture bar, two red, two yellow and four green, with one LED for each 12.5 % of moisture. All eight series resistors sit in one 16-pin DIP resistor array.

What to watch

Serial prints a line every half second, at 9600 baud, in the form Soil <n>% (<mood>) | Light <n>% | Temp <t> C | [###.....]. The plant's mood is THIRSTY below 25 % moisture, SOAKED above 75 % and HAPPY in between. The LED bar matches the # marks.

What's on the bench

  • 8× LED
  • Arduino Nano
  • Photoresistor
  • Resistor
  • Resistor array ×8
  • Soil Moisture
  • Temp (TMP36)

How it's wired

  • hole B+13→hole j23
  • hole B-13→hole a23
  • hole a4→hole B+6
  • hole a6→hole B-5
  • hole c5→hole j31
  • hole a9→hole B+9
  • hole a10→hole B-10
  • hole c11→hole j25
  • hole h23→hole f40
  • hole i42→hole h24
  • hole i45→hole B-43
  • hole a24→hole a55
  • hole g55→LED · a
  • LED · k→hole B-14
  • hole a25→hole a56
  • hole g56→LED · a

…and 19 more connections. Open it in the simulator to see every wire.

The code

This Arduino C++ sketch lives in Code; sign in and press Compile & upload to build real firmware for the emulated board.

// ============================================================
// PLANT MONITOR — an Arduino Nano houseplant dashboard.
//
// This bench exists because of the Nano's two EXTRA analog pins:
// A6 and A7 are ADC-only pads on the Nano's TQFP-32 package — they
// have no digital function at all (no pinMode, no digitalRead, no
// pull-up), so they are the perfect home for analog sensors, and
// using them keeps EVERY digital pin free for the display:
//
//   soil-moisture probe   A6  (the sensor prints ~2.5 V bone-dry,
//                              ~0.2 V waterlogged)
//   photoresistor divider A7  (LDR from 5 V, 10 k to ground —
//                              bright light pulls the node high)
//   TMP36 thermometer     A0  (0.5 V + 10 mV/°C)
//   8-LED moisture bar    D2–D9, all eight series resistors in ONE
//                              DIP-16 resistor-array package
//
// Twice a second it narrates the plant's world over serial and
// redraws the bar: each LED is ~12.5% soil moisture. Click the soil
// sensor or the photoresistor in the Inspector and drag their
// sliders — the narration and the bar follow.
// ============================================================

const uint8_t BAR_PINS[8] = {2, 3, 4, 5, 6, 7, 8, 9};

void setup() {
  Serial.begin(9600);
  for (uint8_t i = 0; i < 8; i++) {
    pinMode(BAR_PINS[i], OUTPUT);
    digitalWrite(BAR_PINS[i], LOW);
  }
  Serial.println(F("Plant monitor online (Nano A6/A7 on sensor duty)"));
}

void loop() {
  // A6 — soil probe: 2.5 V dry .. 0.2 V soaked, mapped to 0..100%.
  float soilV = analogRead(A6) * 5.0 / 1023.0;
  int soilPct = (int)((2.5 - soilV) * 100.0 / 2.3);
  soilPct = constrain(soilPct, 0, 100);

  // A7 — light divider: percent of full scale is plenty for a plant.
  int lightPct = (int)(analogRead(A7) * 100L / 1023L);

  // A0 — TMP36: 500 mV offset, 10 mV per degree C.
  float tempC = (analogRead(A0) * 5.0 / 1023.0 - 0.5) * 100.0;

  // Moisture bar: one LED per 12.5%, through the 8-element array.
  int lit = (soilPct * 8) / 100;
  for (uint8_t i = 0; i < 8; i++) {
    digitalWrite(BAR_PINS[i], i < (uint8_t)lit ? HIGH : LOW);
  }

  const char *mood = soilPct < 25 ? "THIRSTY" : soilPct > 75 ? "SOAKED" : "HAPPY";

  Serial.print(F("Soil "));
  Serial.print(soilPct);
  Serial.print(F("% ("));
  Serial.print(mood);
  Serial.print(F(") | Light "));
  Serial.print(lightPct);
  Serial.print(F("% | Temp "));
  Serial.print(tempC, 1);
  Serial.print(F(" C | ["));
  for (uint8_t i = 0; i < 8; i++) Serial.print(i < (uint8_t)lit ? '#' : '.');
  Serial.println(F("]"));

  delay(500);
}

Try this

  • Select the soil sensor and drag its moisture slider. The bar fills from the red end as the soil gets wetter, and the mood changes at 25 % and 75 %.
  • Select the photoresistor and change its light level. The Light percentage follows it.
  • Select the TMP36 and set a new temperature. The Temp reading updates on the next serial line, about twice per simulated second.

Related projects