Stufin
Home Quick Cart Profile

Gravity: Huskylens - An Easy-to-use AI Camera | AI Machine Vision Sensor

Buy Now on Stufin

Component

GravityHuskylens - An Easy-to-use AI Camera | AI Machine Vision Sensor

Overview

The Gravity

Huskylens is a powerful AI camera that simplifies the integration of machine vision and AI capabilities into IoT projects and devices. Its ease of use, compact design, and robust features make it an ideal choice for developers, engineers, and makers looking to create innovative and intelligent systems.

Camera Module

324x324 resolution, 120 wide angle lens, adjustable illumination

AI Chip

High-performance AI processor with on-device processing capabilities

Interfaces

UART, I2C, SPI, and USB

Power Consumption

100mA (typical), 200mA (max)

Operating Temperature

-20C to 70C

Dimension

45x25x15mm

Conclusion

Pin Configuration

  • Gravity: Huskylens - An Easy-to-use AI Camera | AI Machine Vision Sensor
  • Pinout Explanation:
  • The Gravity: Huskylens AI Camera features a 10-pin interface, which includes power supply, communication, and control pins. Here's a detailed explanation of each pin and their functions:
  • 1. VCC (5V)
  • Description: Power supply pin, provides 5V power to the module.
  • Connection: Connect to a 5V power source, such as a microcontroller or a power supply module.
  • 2. GND
  • Description: Ground pin, provides a common ground connection for the module.
  • Connection: Connect to the ground of the power source or the microcontroller.
  • 3. TX (UART TX)
  • Description: Serial communication transmission pin, used for sending data from the Huskylens module to the microcontroller or other devices.
  • Connection: Connect to the RX (receive) pin of the microcontroller or other serial communication devices.
  • 4. RX (UART RX)
  • Description: Serial communication reception pin, used for receiving data from the microcontroller or other devices.
  • Connection: Connect to the TX (transmit) pin of the microcontroller or other serial communication devices.
  • 5. SCL (I2C Clock)
  • Description: I2C clock pin, used for I2C communication with the microcontroller or other I2C devices.
  • Connection: Connect to the SCL pin of the microcontroller or other I2C devices.
  • 6. SDA (I2C Data)
  • Description: I2C data pin, used for I2C communication with the microcontroller or other I2C devices.
  • Connection: Connect to the SDA pin of the microcontroller or other I2C devices.
  • 7. INT (Interrupt)
  • Description: Interrupt pin, used to trigger an interrupt on the microcontroller when the Huskylens module detects a specific event or condition.
  • Connection: Connect to an interrupt pin on the microcontroller or other devices that support interrupt handling.
  • 8. RST (Reset)
  • Description: Reset pin, used to reset the Huskylens module to its default state.
  • Connection: Connect to a digital output pin on the microcontroller or other devices, and set it to LOW to reset the module.
  • 9. BUSY (Busy Indicator)
  • Description: Busy indicator pin, indicates when the Huskylens module is processing data or performing a task.
  • Connection: Connect to a digital input pin on the microcontroller or other devices to monitor the module's status.
  • 10. FPS (Frame Sync)
  • Description: Frame sync pin, used to synchronize the camera's frame rate with the microcontroller or other devices.
  • Connection: Connect to a digital input pin on the microcontroller or other devices to synchronize the frame rate.
  • Connection Structure:
  • When connecting the Gravity: Huskylens AI Camera to a microcontroller or other devices, ensure the following:
  • Use a breadboard or PCB to connect the pins.
  • Connect the VCC pin to a 5V power source.
  • Connect the GND pin to the ground of the power source or microcontroller.
  • Connect the TX pin to the RX pin of the microcontroller or other serial communication devices.
  • Connect the RX pin to the TX pin of the microcontroller or other serial communication devices.
  • Connect the SCL pin to the SCL pin of the microcontroller or other I2C devices.
  • Connect the SDA pin to the SDA pin of the microcontroller or other I2C devices.
  • Connect the INT pin to an interrupt pin on the microcontroller or other devices.
  • Connect the RST pin to a digital output pin on the microcontroller or other devices.
  • Connect the BUSY pin to a digital input pin on the microcontroller or other devices.
  • Connect the FPS pin to a digital input pin on the microcontroller or other devices.
  • Remember to consult the datasheet and user manual for specific connection requirements and recommendations for your particular project.

Code Examples

Gravity: Huskylens - An Easy-to-use AI Camera | AI Machine Vision Sensor
Overview
The Gravity: Huskylens is an innovative AI camera module that integrates machine vision capabilities with a user-friendly interface. This module is designed to simplify the development of AI-powered IoT projects, allowing developers to focus on building intelligent systems without requiring extensive expertise in machine learning or computer vision.
Technical Specifications
Sensor: 1/4" CMOS sensor with 640x480 pixels resolution
 Processor: Kendryte K210 dual-core 64-bit processor
 Memory: 6MB SRAM, 2MB Flash
 Interface: I2C, UART, SPI, USB
 Power Supply: 3.3V-5V DC
 Operating System: Kendryte OS
Programming Languages
The Gravity: Huskylens supports programming in various languages, including:
MicroPython: A lightweight implementation of the Python language
 C: For developing low-level applications
 Arduino: Compatible with the Arduino IDE
Code Examples
Here are a few examples to demonstrate the usage of the Gravity: Huskylens module:
Example 1: Object Detection using MicroPython
In this example, we will use the Gravity: Huskylens to detect objects in a frame using the built-in object detection model.
```python
import huskylens
# Initialize the Huskylens module
hl = huskylens.Huskylens()
# Set the mode to object detection
hl.set_mode(huskylens.MODE_OBJECT_DETECTION)
while True:
    # Capture a frame from the camera
    frame = hl.capture()
# Perform object detection
    objects = hl.detect_objects(frame)
# Print the detected objects
    for obj in objects:
        print("Object detected: ", obj)
# Wait for 100ms before capturing the next frame
    time.sleep(0.1)
```
Example 2: Image Classification using Arduino
In this example, we will use the Gravity: Huskylens to classify images using a pre-trained model.
```arduino
#include <Huskylens.h>
// Initialize the Huskylens module
Huskylens hl;
void setup() {
  // Initialize the serial communication
  Serial.begin(115200);
// Initialize the Huskylens module
  hl.begin();
}
void loop() {
  // Capture a frame from the camera
  hl.captureImage();
// Classify the image using the pre-trained model
  int classId = hl.classifyImage();
// Print the classification result
  Serial.print("Image classified as: ");
  Serial.println(classId);
// Wait for 1 second before capturing the next frame
  delay(1000);
}
```
Example 3: Line Following using C
In this example, we will use the Gravity: Huskylens to detect lines in a frame and control a robot to follow the line.
```c
#include <kendryte/k210.h>
#include <huskylens.h>
// Initialize the Huskylens module
Huskylens hl;
int main() {
  // Initialize the Huskylens module
  hl.init();
// Set the mode to line detection
  hl.set_mode(HUSKY_LENS_MODE_LINE_DETECTION);
while (1) {
    // Capture a frame from the camera
    uint16_t frame = hl.capture_frame();
// Find the line in the frame
    int x, y, w, h;
    hl.find_line(frame, &x, &y, &w, &h);
// Control the robot to follow the line
    if (x > 320) {
      // Turn right
      printf("Turn right
");
    } else if (x < 320) {
      // Turn left
      printf("Turn left
");
    } else {
      // Move forward
      printf("Move forward
");
    }
// Wait for 50ms before capturing the next frame
    delay_ms(50);
  }
return 0;
}
```
These examples demonstrate the capabilities of the Gravity: Huskylens module and provide a starting point for developing more complex AI-powered IoT projects.