Akshay Sankar
Created September 4, 2024

A Watchful Guardian, an overseer

Imagine a device offering you freedom where you once struggled—organizing furniture safely, finding lost items, Lets dive into my Journey

15
A Watchful Guardian, an overseer

Things used in this project

Hardware components

Seeed Studio XIAO ESP32S3 Sense
Seeed Studio XIAO ESP32S3 Sense
×1
Seeed Studio XIAO SAMD21 (Pre-Soldered) - Seeeduino XIAO
Seeed Studio XIAO SAMD21 (Pre-Soldered) - Seeeduino XIAO
×1
M5StickC ESP32-PICO Mini IoT Development Board
M5Stack M5StickC ESP32-PICO Mini IoT Development Board
×1
GSM Module SIM800L with MIC & Headphone Jack
M5Stack GSM Module SIM800L with MIC & Headphone Jack
×1
Jumper wires (generic)
Jumper wires (generic)
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
360 for better view
×1
Camera Module
Raspberry Pi Camera Module
×1

Software apps and online services

Fusion 360
Autodesk Fusion 360
PCBWAY
Neuton
Neuton Tiny ML Neuton
microsoft designer

Hand tools and fabrication machines

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
PCBWay 3D Printing
PCBWay 3D Printing

Story

Read more

Custom parts and enclosures

3d Model

Schematics

Schematic

Connect according to diagram

Trained model on furniture v3

Load using sensecap

3d model Image

Code

Ai parsing code for Xiao

C/C++
Load into Xiao using Aurduino IDE for Driving AI Model
#include <Wire.h>

#include "Seeed_Arduino_GroveAI.h"


GroveAI ai(Wire);
uint8_t state = 0;
void setup()
{
  Wire.begin();
  Serial.begin(115200);
  
   Serial.println("begin");
  if (ai.begin(ALGO_OBJECT_DETECTION, (MODEL_INDEX_T)0x11)) // Object detection and pre-trained model 1 MODEL_PRE_INDEX_1
  {
    Serial.print("Version: 0x");
    Serial.println(ai.version(), HEX);
    Serial.print("ID: 0x");
    Serial.println( ai.id(), HEX);
    Serial.print("Algo: ");
    Serial.println( ai.algo());
    Serial.print("Model: ");
    Serial.println(ai.model());
    Serial.print("Confidence: ");
    Serial.println(ai.confidence());
    state = 1;
  }
  else
  {
    Serial.println("Algo begin failed.");
  }
}

void loop()
{
  if (state == 1)
  {
    uint32_t tick = millis();
    if (ai.invoke()) // begin invoke
    {
      while (1) // wait for invoking finished
      {
        CMD_STATE_T ret = ai.state(); 
        if (ret == CMD_STATE_IDLE)
        {
          break;
        }
        delay(20);
      }

     uint8_t len = ai.get_result_len(); // receive how many people detect
     if(len)
     {
       int time1 = millis() - tick; 
       Serial.print("Time consuming: ");
       Serial.println(time1);
       Serial.print("Number of people: ");
       Serial.println(len);
       object_detection_t data;       //get 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)); //get result
  
          Serial.print("confidence:");
          Serial.print(data.confidence);
          Serial.println();
        }
     }
     else
     {
       Serial.println("No identification");
     }
    }
    else
    {
      delay(1000);
      Serial.println("Invoke Failed.");
    }
  }
  else
  {
    state == 0;
  }
}

Credits

Akshay Sankar

Akshay Sankar

4 projects • 31 followers
I m a Science Enthusiast And I Love Fixing Things.

Comments