Soil Moisture Detector
Two nails pushed into the plant pot light an LED when the soil is damp. A Darlington pair amplifies the tiny current that flows between the nails.
Bill of materials
Everything you need to build it, with the reference you will see on the schematic.
| Qty | Part | Ref. |
|---|---|---|
| 1 | Two galvanized nails with wire (soil probe) | PR1 |
| 1 | 10 kΩ resistor (brown-black-orange) | R1 |
| 1 | 47 kΩ resistor (yellow-violet-orange) | R2 |
| 2 | BC547 NPN transistor | Q1, Q2 |
| 1 | 470 Ω resistor (yellow-violet-brown) | R3 |
| 1 | green LED | D1 |
| 1 | 9 V battery with snap clip | BT1 |
| 1 | Breadboard (400 tie-points or more) | |
| 6 | Jumper wires |
Missing parts? The kits recommended by Impeca Tech include almost all of them. See the kits
Schematic & wiring
On the left, the circuit diagram; on the right, the same circuit built on a breadboard. Both connect exactly the same things.
Wire it step by step
-
Place the components
- 10 kΩ resistor R1 (bands: brown, black, orange, gold): one leg in 16f and the other in 13f (either way round).
- 47 kΩ resistor R2 (bands: yellow, violet, orange, gold): one leg in 13i and the other in 9i (either way round).
- BC547 transistor Q1 with the flat face (the one with the text) towards you, left to right: collector (C) in 10f, base (B) in 11f, emitter (E) in 12f.
- BC547 transistor Q2 with the flat face (the one with the text) towards you, left to right: collector (C) in 7f, base (B) in 8f, emitter (E) in 9f.
- 470 Ω resistor R3 (bands: yellow, violet, brown, gold): one leg in 3f and the other in 6f (either way round).
- green LED D1: the long leg (+, anode) in 6h and the short leg (−, cathode, flat side) in 5h.
-
Add the jumper wires
- Red wire: from 3j to the + (red) rail.
- Orange wire: from 5j to 7j.
- Turquoise wire: from 7i to 10j.
- Purple wire: from 11j to 13j.
- Pink wire: from 8j to 12j.
- Black wire: from 9j to the − (blue) rail.
-
Connect the probe
- Two galvanized nails with wire (PR1): one wire to the + rail and the other wire to 16j.
-
Connect the battery
- Connect the 9 V battery to its clip: the clip’s red lead to the + (red) rail and the black one to the − (blue) rail. Do this last, once everything else is in place.
-
Test the circuit
- With the nails in the air the LED is off. Push the two nails about 3 cm apart into a pot of dry soil: it should stay off. Water it and wait a few seconds: the LED lights. Pull the nails out and it goes off. Wipe them when you finish: they rust over time.
How to read the holes: the letter is the row and the number is the column of the breadboard (for example 7f). The red (+) and blue (−) rails are the two long lines along the edge.
How does it work?
- 1You push the two nails into the soil
- 2Moisture lets a tiny current through
- 3The Darlington pair amplifies it
- 4The green LED shows the soil is damp
Dry soil hardly conducts; damp soil lets a small current flow between the two galvanized nails. That current enters through R1 (10 kΩ) into the base of Q1; Q1 and Q2 form a Darlington pair (the emitter of Q1 feeds the base of Q2) that multiplies it thousands of times and passes about 13 mA through the LED via R3 (470 Ω). R2 (47 kΩ) holds the base at 0 V when no current arrives. In the simulation, with dry soil (≈ 2 MΩ) or the nails in the air the LED stays off; with damp soil (≈ 20 kΩ) or barely damp soil (≈ 100 kΩ) it lights normally. It is a yes/no indicator: it tells you whether there is moisture, not how much. With direct current the nails rust, so use it only for checking and take them out afterwards.
Testing & troubleshooting
What you should see
- Dry soil (≈ 2 MΩ between the nails)
- LED currentunder 1 µA
- Moist soil (≈ 20 kΩ)
- LED current≈ 13 mA
- Voltage at Q1 base≈ 1.37 V
- Barely moist soil (≈ 100 kΩ)
- LED current≈ 13 mA
- Nails pulled out of the soil (air)
- LED currentunder 1 µA
- Nails touching each other (short)
- LED current≈ 13 mA
Approximate values, calculated with typical parts. With real parts they can vary by 10 % or more.
If something does not work
The LED does not light with wet soil
Push the nails deeper and closer together (2–3 cm) so both touch damp soil. To check the circuit, join the nail heads with a wire: if the LED lights that way, all is well and you just need better contact with the soil. If not, check the two BC547s (flat face towards you: collector, base, emitter).
It lights with dry soil
Fertilizer and salts make soil conduct more, and nails that are too close or touching join the contacts: move them apart. Also check that R2 is 47 kΩ (yellow, violet, orange) and sits between the base of Q1 and GND.
Want to automate this circuit with code?
Learn how to program sensors and custom schedules in our e-book “Arduino from Scratch”.