Ralph Yamamoto
Created December 18, 2021

Kria Smart Security Camera

A Smart Camera that can switch AI detection models based on distance measured by a time-of-flight sensor.

482

Things used in this project

Hardware components

Kria KV260 Vision AI Starter Kit
AMD Kria KV260 Vision AI Starter Kit
×1
Xilinx Kria KV260 Basic Accessory Pack
×1
Logitech Brio Ultra HD Pro Web Cam
×1
Digilent -Pcam 5C
×1
DFRobot LIDAR07 TOF IR Distance Sensor
×1
QGOO USB 3.0 WiFi Dongle 802.11 ac
×1
Digilent - PMOD PYNQ Grove Adapter
×1
Ulanzi ST-04 Aluminum Smartphone Tripod Adapter
×1
Logitech K400 Wireless Touch Keyboard
×1
SanDisk Ultra microSDHC UHS-I 32GB Card 10 pack
×1

Software apps and online services

Vitis Unified Software Platform
AMD Vitis Unified Software Platform
Vivado Design Suite
AMD Vivado Design Suite
PetaLinux
AMD PetaLinux
PYNQ Framework
AMD PYNQ Framework
Certified Ubuntu for Xilinx Devices
Jupyter Notebook
Jupyter Notebook
Edge Impulse Studio
Edge Impulse Studio
balenaEtcher
balenaEtcher
FFmpeg
OpenScad

Hand tools and fabrication machines

AnyCubic Mega-S

Story

Read more

Custom parts and enclosures

Kria Clip

Used to attach Kria Starter Board to tripod mounting adapter

Kria shim

Use shims to attach Kria Starter Board in the Kria Clip

Kria Accessory Mount

Use to attach the PCam 5, Lidar07, and Brio WebCam to the Kria Starter Board

Schematics

Grove I2C to LIDAR07 Cable

Connect LIDAR07 to Kria PMOD Connector using PYNQ-Grove Adapter

Code

Xiao_Lidar07_Expansion_Board.ino

C/C++
Test of Lidar07 measurement capability using Xiao with Arduino IDE
#include"DFRobot_LIDAR07.h"

//If using IIC mode, please enable macro USE_IIC
#define USE_IIC
#ifdef USE_IIC  
DFROBOT_LIDAR07_IIC  LIDAR07;
#endif

void setup()
{
  uint32_t version;
  Serial.begin(115200);
  while(!Serial);
  delay(5000);

#ifdef USE_IIC
  while(!LIDAR07.begin()){
    Serial.println("The sensor returned data validation error");
    delay(1000);
  }
#endif
  
  version = LIDAR07.getVersion();
  Serial.print("VERSION: ");
  Serial.print((version>>24)&0xFF,HEX);
  Serial.print(".");Serial.print((version>>16)&0xFF,HEX);
  Serial.print(".");Serial.print((version>>8)&0xFF,HEX);
  Serial.print(".");Serial.println((version)&0xFF,HEX);

  LIDAR07.startFilter();  //After enabling the filter, it can be stopped by calling LIDAR07.stopFilter()
  
}
 
void loop()
{ 
  while(!LIDAR07.startMeasure()){
    Serial.println("Incorrect data was returned");
    delay(1000);
  }
  Serial.print("Distance:");Serial.print(LIDAR07.getDistanceMM());Serial.println(" mm");
//  Serial.print("Amplitude:");Serial.println(LIDAR07.getSignalAmplitude());
  delay(200);
}

PYNQ/Notebooks

Notebooks that I used for PYNQ Demos

Kria Smart Security Camera

Code and Models for basic implementation to switch between person and face detection based on distance from camera

Credits

Ralph Yamamoto

Ralph Yamamoto

10 projects • 20 followers

Comments