- Any 96Boards CE (We will be using the Drogonboard410c)
- LinkSprite Mezzanine
- 1x I2C 16x2 LCD Module
- 1x Soil Moisture Sensor LM393
- 1x Motor controller L298n
- 1x 5v Water Pump
- 1x Pipe: Length and diameter as per requirement
- Connecting wires
- Plugin the LinkSprite Mezzanine on the CE Board.
- Plug in the LCD scree to the LinkSprite Mezzanine as follows:
I2C 16x2 LCD | LinkSprite Mezzanine |
---|---|
VCC | IIC VCC |
GND | IIC GND |
SDA | IIC SDA |
SCL | IIC SCL |
- Plug in the Soil Moisture Sensor to the LinkSprite Mezzanine as follows:
Soil Moisture Sensor | LinkSprite Mezzanine |
---|---|
VCC | ADC1 VCC |
GND | ADC1 GND |
A0 | ADC1 A0 |
- Plug in the L298n Motor Controller to the LinkSprite Mezzanine as follows:
L298n | LinkSprite Mezzanine |
---|---|
VCC | D1 VCC |
GND | D1 GND |
IN 1 | D1 DA |
IN 2 | D1 GND |
- Plug in the L298n Motor Controller to the 5v Pump as follows:
L298n | Water Pump |
---|---|
OUT 1 | +5v |
OUT 2 | GND |
- Add bury the Probes of the Soil Moisture sensor in the Pot.
This guide assumes that Debian OS is running on a Dragonboard410c. How ever the instructions hold true for other 96Boards CE Boards running Debian.
This project is compatible with other Linux based OS, but they might have to be tweaked accordingly.
-
Enable spidev as shown here: Enabling SPIDEV on Dragonboard410c
-
Calibrate Senor
- Insert sensor into dry and then wet soil and modify the
in_min
andin_max
values here:- line 119:
water_level = map(adc_value, 550, 10, 0, 100);
- line 119:
- Do this till dry soil reads 0% and wet soil reads 100%
- Insert sensor into dry and then wet soil and modify the
-
Soil Moisture Percentage
- The target moisture percentage can also be modified by editing line 127 and 133.
- Build Project:
gcc src/pot.c -o pot -lmraa -lupmc-lcm1602 -lupmc-utilities -I/usr/include/upm
The LCD screen should now show the current Pump status and Moisture Level in the soil. And the pump should start pumping water once the moisture level drops.