Slavko Zdravevski
Published © GPL3+

My Flower Has Emotions

Using the Seeed studio's Wio Terminal and Grove - Soil Moisture Sensor, I created a project, and now my flower asks for water.

BeginnerFull instructions provided1 hour401
My Flower Has Emotions

Things used in this project

Hardware components

Seeed Studio Wio Terminal
×1
Seeed Studio Grove - Moisture Sensor
×1
MicroSD Card
×1
MicroSD Card Reader
×1
Type-C USB Cable
×1

Story

Read more

Schematics

Connection between the Wio Terminal and the Grove - Moisture Soil Sensor

We just have to use one of the Wio Terminal's analog pins.

Code

Wio Terminal - Flower Project - Measuring Moisture and Informing

C/C++
We need to have Arduino IDE installed on our machine, and just upload the code to the board.
#include "TFT_eSPI.h"
#include "Seeed_FS.h"
#include "RawImage.h"

int moistoreSensorPin = A0;

int moistureThreshold = 500;

TFT_eSPI tft;

void setup() {
  pinMode(moistoreSensorPin, INPUT);
  pinMode(WIO_BUZZER, OUTPUT);
  
  if (!SD.begin(SDCARD_SS_PIN, SDCARD_SPI)){
    while(1);
  }
  
  tft.begin(); 
  tft.setRotation(3);
}

void loop() {
  analogWrite(WIO_BUZZER, 0);
  
  if (analogRead(moistoreSensorPin) >= moistureThreshold) {
     drawImage<uint16_t>("happy.bmp",0,0);
  } else {
     drawImage<uint16_t>("sad.bmp",0,0);
     analogWrite(WIO_BUZZER, 128);
  }
  
  delay(1000);
}

Credits

Slavko Zdravevski
1 project • 0 followers
Passionate about: electronics, web development, game development, AR/VR/XR, machine learning, and car locksmithing.
Contact

Comments

Please log in or sign up to comment.