Grove AI vision manual object detection - D0nnaz/DET-IoT GitHub Wiki
In this manual, we will guide you through the process of setting up your Arduino and components to identify plants and determine their health status. A green light will illuminate when the plant is healthy, a red light will indicate a sick plant, and an orange light will signify no plant detected. This functionality is achieved using the Grove - Vision AI Module.
Hardware
-
Arduino, for this manual I am using the NodeMCU https://www.seeedstudio.com/NodeMCU-v2-Lua-based-ESP8266-development-kit.html
-
Grove - Vision AI Module. https://www.seeedstudio.com/Grove-Vision-AI-Module-p-5457.html
-
Capacitive Soil Moisture Sensor https://www.tinytronics.nl/shop/en/sensors/liquid/capacitive-soil-moisture-sensor-module-with-cable
-
Ledstrip
-
USB C - USB C cable
-
Wires to connect
Accounts
-
Roboflow account (optional)
-
Google Account/ Google drive account
-
OpenWeather account
Bronnen:
- Download and install the Arduino IDE if you do not have it installed already.
- Go to Preferences > Additional Boards Manager URLs and add the following URL:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
. You can add multiple URLs by separating them with commas. - Click "OK."
- Navigate to the menu Tools > Board > Boards Manager.
- Look for "esp8266" by ESP8266 Community in the list.
- Click on "Install."
- Once the installation is complete, click "OK."
NodeMCU | Grove - Vision AI module | Ledstrip | Moisture Sensor |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Connect to the right board and port.

Create a new sketch and paste the following code:
#include "Seeed_Arduino_GroveAI.h"
#include <Wire.h>
GroveAI ai(Wire);
uint8_t state = 0;
// Define LED strip parameters
#define NUM_LEDS 15
#define DATA_PIN D5
#define CLOCK_PIN 13
CRGB leds[NUM_LEDS];
void setup()
{
Wire.begin();
Serial.begin(115200);
// Initialize AI
if (ai.begin(ALGO_OBJECT_DETECTION, MODEL_EXT_INDEX_1))
{
// FastLED setup
FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
FastLED.show();
Serial.println("Version: 0x" + String(ai.version(), HEX));
Serial.println("ID: 0x" + String(ai.id(), HEX));
Serial.println("Algo: " + String(ai.algo()));
Serial.println("Model: " + String(ai.model()));
Serial.println("Confidence: " + String(ai.confidence()));
state = 1;
}
else
{
Serial.println("Algo begin failed.");
}
}
void loop()
{
if (state == 1)
{
uint32_t tick = millis();
if (ai.invoke())
{
while (1)
{
CMD_STATE_T ret = ai.state();
if (ret == CMD_STATE_IDLE)
{
break;
}
delay(20);
}
uint8_t len = ai.get_result_len();
if (len)
{
int time1 = millis() - tick;
Serial.print("Time consuming: ");
Serial.println(time1);
Serial.print("Happy plants: ");
Serial.println(len);
object_detection_t data;
for (int i = 0; i < len; i++)
{
Serial.println("result: detected");
Serial.print("Detecting and calculating: ");
Serial.println(i + 1);
ai.get_result(i, (uint8_t *)&data, sizeof(object_detection_t));
Serial.print("Confidence: ");
Serial.print(data.confidence);
Serial.println();
fill_solid(leds, NUM_LEDS, CRGB::Green);
FastLED.show();
}
}
else
{
Serial.println("No identification");
fill_solid(leds, NUM_LEDS, CRGB::Red);
FastLED.show();
}
}
else
{
delay(1000);
Serial.println("Invoke Failed.");
}
}
else
{
state == 0;
}
}
Before you continue, please download the ZIP library from https://github.com/Seeed-Studio/Seeed_Arduino_GroveAI. Once the download is finished, open the Arduino IDE and follow these steps:
Go to Sketch > Include Library > Add .ZIP Library. Locate the recently downloaded ZIP file and install it in the Arduino IDE.
Insert the USB-C cable into both the Grove - Vision AI and your computer. Press the boot button twice. If everything is done correctly, you will see Grove AI (see image).
Boot button | Outcome |
---|---|
![]() |
![]() |
Download the following file:
Upload the .uf2 file to the AI Grove. If done correctly, the Grove AI will disappear within a few seconds.
Upload the code to your arduino. Open the serial monitor and set baud rate as 115200 and the result of plants detection should be showed continuously. To see the result, go to this site: https://vision-ai-demo.seeed.cn/.
Error: If the GroveAI doesn't appear when connecting the USB-C cable initially, try pressing the boot button again twice. If that doesn't resolve the issue, reinsert the cable.
If the camera doesn't display an image, attempt the following steps:
- Check the hardware connections.
- Press the boot button four times.
- Reinsert the cable.
- Re-upload the code.
- As a last resort, consider restarting your computer.