Plant Emoji Soil Moisture Detector




My dear grandmother loves plants but she often forgets to water them. I designed and created this lovely device that provides a colorful emoticon display to alert owners when to water the plants. The moisture meter displays a smiling face if the plant has enough water, and it frowns/cries when the soil is arid.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Required Materials

Arduino Uno Microcontroller Board

8X8 LED Matrix Array

Soil Humidity Sensor

Electronic Expansion Board


Alarm Buzzer (optional)

Step 2: Soldering the Components

Solder the LED matrix array, soil humidity sensor, and the alarm buzzer to the expansion board. For the LED matrix array, I connected CLK to pin #4, CS to pin #3, and DIn to pin #2. For the soil humidity sensor, the AO is connected to A5 on the Arduino unit. The alarm buzzer is connected to pin #5. If you happen to solder the inputs/outputs to different pins, remember to reroute to the appropriate pins in the Arduino code. Replace “Stick the battery to the back of Arduino” with Attach the battery power supply to the back of the Arduino unit.

Step 3: Battery

Attach the battery power supply to the back of the Arduino unit.

Step 4: Connect the Arduino Controller to the Rest of the Device.

Attach the Arduino unit to the expansion board to complete the assembly.

Step 5: Arduino Source Code

The last step is to load the following programming code onto the Arduino controller. Remember to modify the pin assignments if your selections differ from the instructions provided.

//Put the following code into Arduino

long soilhumid;

long humid;

int dataIn = 2;

int load = 3;

int clock = 4;

byte max7219_reg_noop = 0x00;

byte max7219_reg_digit0 = 0x01;

byte max7219_reg_digit1 = 0x02;

byte max7219_reg_digit2 = 0x03;

byte max7219_reg_digit3 = 0x04;

byte max7219_reg_digit4 = 0x05;

byte max7219_reg_digit5 = 0x06;

byte max7219_reg_digit6 = 0x07;

byte max7219_reg_digit7 = 0x08;

byte max7219_reg_decodeMode = 0x09;

byte max7219_reg_intensity = 0x0a;

byte max7219_reg_scanLimit = 0x0b;

byte max7219_reg_shutdown = 0x0c;

byte max7219_reg_displayTest = 0x0f;

int e = 0;

void putByte(byte data) {

byte i = 8;

byte mask;

while(i > 0) {

mask = 0x01 << (i - 1); // get bitmask

digitalWrite( clock, LOW); // tick

if (data & mask){ // choose bit

digitalWrite(dataIn, HIGH);// send 1


digitalWrite(dataIn, LOW); // send 0


digitalWrite(clock, HIGH); // tock

--i; // move to lesser bit



void maxAll(byte reg, byte col) {

digitalWrite(load, LOW); // begin

putByte(reg); // specify register

putByte(col);//((data & 0x01) * 256) + data >> 1); // put data

digitalWrite(load, LOW);



void maxSingle(byte reg, byte col) {

digitalWrite(load, LOW); // begin

putByte(reg); // specify register

putByte(col);//((data & 0x01) * 256) + data >> 1); // put data

digitalWrite(load, LOW); // and load da stuff



void setup()



pinMode(dataIn, OUTPUT);

pinMode(clock, OUTPUT);

pinMode(load, OUTPUT);

maxAll(max7219_reg_scanLimit, 0x07);

maxAll(max7219_reg_decodeMode, 0x00);

maxAll(max7219_reg_shutdown, 0x01);

maxAll(max7219_reg_displayTest, 0x00);

for (e=1; e<=8; e++) { maxAll(e,0);}

maxAll(max7219_reg_intensity, 0x0f & 0x0f);

pinMode(0, OUTPUT);

soilhumid = 0;

humid = 0;


void loop()


// detect soil humidity

soilhumid = analogRead(A0);


// lack water

if (soilhumid < humid) {

// sad face

maxSingle(1,0);maxSingle(2,102);maxSingle(3,102);maxSingle(4,0);maxSingle(5,60);maxSingle(6,66);maxSingle(7,66);maxSingle(8,0);// buzzer on



// buzzer off


} else {

// happy face

maxSingle(1,0);maxSingle(2,102);maxSingle(3,102);maxSingle(4,0);maxSingle(5,126);maxSingle(6,66);maxSingle(7,36);maxSingle(8,24);// buzzer off




Arduino Contest 2016

Participated in the
Arduino Contest 2016

Indoor Gardening Contest 2016

Participated in the
Indoor Gardening Contest 2016

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    12 Discussions


    2 years ago

    Hi, what was the expansion board that was used? Or does any expansion board work


    2 years ago

    bos how many input and output this program..?


    2 years ago

    Hello I'm having issue with the soil moisture. My sensor values are 974 out in the air and around 380-400 in the water instead of 0 and 1024. Someone knows this issue?

    1 reply

    Reply 2 years ago

    The sensor is probably deregulated. Look for a potentiometer on the module board, you can make some adjustments with it.


    2 years ago

    can you help me?


    2 years ago

    Looks interesting. would appreciate if you can share more details on the wiring on the expansion board. the attached picture is not very clear.


    2 years ago

    i am having zero luck compiling this in the IDE any suggestions?


    2 years ago

    The major problem of your project is the humidity sensor. I bought two just like yours and the first turn rusty very fast when exposed to moist soil.
    One solution can be only stick it in the soil to get readings and then clean it.. well!
    The other can be a mechanism with a servo and some sort of brush to clean the sensor on the way up.

    2 replies

    Reply 2 years ago

    You could try sending a very small current through the stick to help reduce/prevent rust. It's very similar to how rust proof systems work on vehicles.


    Reply 2 years ago

    Was it a copper or nickel plated one?


    2 years ago

    I like your sense of humor!

    Clever way to make a moisture sensor. You might also think about making a different expression for when the plant might be over watered.