Zeller,MA
Published © GPL3+

Gesture-Controlled Trash Bin Bot

The Gesture-Controlled Trash Bin Bot made based on Grove Vision AI Module V2 and XIAO ESP32S3

BeginnerFull instructions provided20 hours294

Things used in this project

Hardware components

Grove Shield for Seeeduino XIAO - with embedded battery management chip
Seeed Studio Grove Shield for Seeeduino XIAO - with embedded battery management chip
×1
Seeed Studio XIAO ESP32S3 Sense
Seeed Studio XIAO ESP32S3 Sense
Because I have this board without the camera, the ordinary XIAO ESP32S3 is already sufficient.
×1
Grove Vision AI Module V2
Seeed Studio Grove Vision AI Module V2
×1
SparkFun Motor Driver - Dual TB6612FNG (1A)
SparkFun Motor Driver - Dual TB6612FNG (1A)
×2
EMax 12g ES08MD high Sensitive servo
Seeed Studio EMax 12g ES08MD high Sensitive servo
×1
DC Motor, 12 V
DC Motor, 12 V
×4

Software apps and online services

PlatformIO IDE
PlatformIO IDE
VS Code
Microsoft VS Code
SenseCraft AI
Seeed Studio SenseCraft AI

Hand tools and fabrication machines

Onshape
Cloud CAD Tools

Story

Read more

Custom parts and enclosures

3D Shell

Side

Schematics

chrome_aqujthlsyv_NyxcDYX28f.png

Code

main.cpp

C/C++
#include <Seeed_Arduino_SSCMA.h>
#include "motor.h"
#include "servo.h"
#include "ai_handler.h"

SSCMA AI;
void task_init(void *arg);
void task_ai_recognition(void *arg);

//FreeRTOS task handle
TaskHandle_t task_ai_handle = NULL;
TaskHandle_t task_init_handle = NULL;

void setup()
{
    Serial.begin(9600);
    
    // Waiting for serial port initialization
    delay(1000);
    Serial.println("System Starting...");
    
    
    if (!AI.begin()) {
        Serial.println("AI initialization failed!");
        while(1);
    }
    Serial.println("AI initialized successfully");
    
    // Create initialization task
    xTaskCreate(task_init, "Init", 4096, NULL, 1, &task_init_handle);
    
    // Create an AI recognition task
    xTaskCreate(task_ai_recognition, "AI_Recognition", 8192, NULL, 2, &task_ai_handle);
    
    Serial.println("Tasks created, system ready!");
}

void task_init(void *arg)
{
    Serial.println("Initializing peripherals...");
    
    // Initialize the motor
    motor_init();
    Serial.println("Motor initialized");
    
    // Initialize the Servo
    servo_init();
    servo_set_angle(90); // Set the initial angle to 90 degrees.
    Serial.println("Servo initialized at 90 degrees");
    
    // Initialize the AI processor
    ai_handler_init(&AI);
    
    // Register the target processing function
    register_target_handler(0, handle_target_0); // move forward
    register_target_handler(1, handle_target_1); // move backward
    register_target_handler(2, handle_target_2); // Servo
    
   
    register_box_handler(dispatch_box_by_target);
    
    Serial.println("AI handler configured");
    Serial.println("Initialization complete!");
    
    
    vTaskDelete(NULL);
}

// Handle the results of AI recognition
void task_ai_recognition(void *arg)
{
    Serial.println("AI Recognition task started");
    
    while (1)
    {
      
        process_ai_results();
        
        vTaskDelay(100 / portTICK_PERIOD_MS);
    }
}


void loop()
{
    // In the FreeRTOS mode, the loop function is usually empty
    // or only performs simple monitoring.
    vTaskDelay(1000 / portTICK_PERIOD_MS);
}

Gesture_ai

Credits

Zeller,MA
2 projects • 4 followers
I am an electronics enthusiast who enjoys all kinds of interesting things and also loves to learn new things. Welcome to communicate with me

Comments