edit

Grove AI HAT for Edge Computing

The Grove AI HAT for Edge Computing(hereafter called 'Grove AI HAT') is built around Sipeed MAix M1 AI MODULE with Kendryte K210 processor inside. It's a low cost but powerful raspberry pi AI hat which assists raspberry pi run the AI at the edge, it also can work independently for edge computing applications.

The MAix M1 is a powerful RISC-V 600MHz AI module features dual core 64-bit cpu, 230GMULps 16-bit KPU(Neural Network Processor), FPU(Float Point Unit) supports DP&SP, and APU(Audio Processor) supports 8 mics.

In addition to the powerful Kendryte K210 processor, the Grove AI HAT for Edge Computing board provide a wealth of peripherals: I2C/UART/SPI/I2S/PWM/GPIO. The hat also offers LCD and camera interface, which support the Sipeed 2.4inch QVGA LCD and DVP camera, it will be helpful and convenience with your AI vision project. Just like the Sipeed MAix BiT Kit for RISC-V AI+IoT, we will release the kit with camera and LCD soon. For AI voice recognition applications, we add a high-quality microphone. And for robot or motion applications, there is a onboard 3-axis accelerometers sensor, which is more accurate and easy to use compared to external sensors.

We have released varies of SIPPED AI products, we believe it is time to make it Grove, and bring all our hundreds of grove senors and grove acvotors to your AI applications. So here comes the Grove AI HAT for Edge Computing. We've added 6 grove connectors to this hat, including 1xDigital IO, 2xAnalog IO, 1xI2C, 1xUART and 1xPWM. On top of that, based on kendryte-standalone-sdk, we added the full ArduinoCore-API interface to support Arduino IDE, Linux, Windows, Mac OS X and other development environments. Which means you can run Grove Arduino Libraries and many excellent Arduino libraries on this board easily.

We hope this board may help you with your edge computing, AI vision, voice recognition, and other AI projects, just enjoy it.

Features

  • Processor: Sipeed MAIX-I module w/o WiFi ( 1st RISC-V 64 AI Module, K210 inside )
  • 1x USB 2.0 Device, Type C(Power and Programming)
  • 6x Grove Interface: include 1x Digital IO, 1x PWM, 1x I2C, 1x UART, 2x ADC
  • 1x Power LED, 1x Boot LED
  • 1x Reset Button, 1x Boot Button
  • 1x LCD Interface
  • 1x Camera Interface
  • 1x Digital Mic
  • 1x Accelerometers Sensor
  • 1x JTAG & ISP UART Pin Header
  • 2x 20 Pin Header with I2C, UART, SPI, I2S, PWM, GPIO

Specification

Parameter Value
CPU K210 RISC-V Dual Core 64bit, 400Mh(Max. 600Mhz)
FPU IEEE754-2008 compliant high-performance pipelined FPU
KPU(Neural Network Processor ) • Supports the fixed-point model that the mainstream training framework trains according to specific restriction rules
• Support for 1x1 and 3x3 convolution kernels
• Support for any form of activation function
• The maximum supported neural network parameter size for real-time work is 5MiB to 5.9MiB
APU(Audio Processor) • Up to 192kHz sample rate
• Up to 8 channels of audio input data, ie 4 stereo channels
Debugging Support High-speed UART and JTAG interface for debugging
Supply Voltage 5V
can not exceed 5.5V
IO Voltage 3.3V
Operating Ambient Temperature -20 – 70℃
ADC Onboard 16-bit ADC
3-Axis Accelerometers ADXL345 ±2 g/±4 g/±8 g/±16 g
Micrephone Sensitivity:-26 dB;SNR:61 dB
GPIO 2x 20 Pin Header compatible with Raspberry Pi
Grove Interface 1x Digital IO, 1x PWM, 1x I2C, 1x UART, 2x ADC
USB Interface USB 2.0 Device, Type C(Power and Programming)
LCD Interface 8bit MCU LCD 24P 0.5mm FPC connector
DVP Camera Interface 24P 0.5mm FPC connector
Button 1x Reset Button, 1x Boot Button (can be used as User Button)
LED 1x Power LED, 1x Boot LED(can be used as User LED)

Attention

  • All digital and analog IO interface levels are 3.3V. Please do not input more than 3.3V, otherwise the CPU may be damaged.
  • The input power supply voltage is 5V and cannot exceed 5.5V.

Applications

  • AI for Edge Computing
  • Smart Building
  • Medical equipment
  • Automation & Process Control
  • Robot

Hardware Overview

Grove AI HAT for Edge Computing hardware overview
Figure 1. Grove AI HAT for Edge Computing hardware overview

Platforms Supported

Arduino Raspberry Pi BeagleBone Wio LinkIt ONE

Getting Started

Readme

  • When the board is used in standalone mode, please turn the toggle switch J4 to the ON terminal. Then the Pin2 and Pin4 of the 2x20Pin socket J6 will connect to 5V power.
  • When the board is plugged into the Raspberry Pi, if only one board is powered, J4 needs to be dialed to the ON end; if the board and the Raspberry Pi use different USB power at the same time, J4 needs to be dialed to the OFF end to disconnect The two sets of 5V connections on the J6 avoid the two USB power supplies being directly connected.

Play With Arduino

Attention

If this is the first time you work with Arduino, we strongly recommend you to see Getting Started with Arduino before the start.

In theory, Grove AI HAT can be compatible with all Grove modules, but inevitably there will be compatibility issues. If you find a Grove module that is not compatible with the Grove AI HAT, please submit it to our Github Page.

Arduino config

  • Step 1. Configure the Arduino Board Manager URL.
    Click File → Preference, copy the following URL into the Additional Boards Manager URLs
1
https://raw.githubusercontent.com/Seeed-Studio/Seeed_Platform/master/package_seeeduino_boards_index.json
Grove AI HAT Arduino config
Figure 2. Arduino Board URL config
Grove AI HAT Arduino config
Figure 3. Arduino Board URL config
  • Step 2. Add the Grove AI HAT board into Arduino IDE.
    Click Tools → Board:"xxxx" →Boards Manager, tap K210 into the search bar.
    Find the Grove AI HAT for Edge Computing by Seeed Studio, click Install button.
Grove AI HAT Arduino config
Figure 4. Open Board Manager
Grove AI HAT Arduino config
Figure 5. Install the Grove AI HAT Board

When the installation is complete, you can find the Seeed K210 Pi board in the Arduino board list.

Grove AI HAT Arduino config
Figure 6. Select Seeed K210 Pi

Also, to use the Grove AI HAT in the Arduino IDE, you need to select the K-flash Programmer at the Arduino Programmer list.

Grove AI HAT Arduino config
Figure 7. Select K-flash Programmer

Digital Demo

Materials required

Hardware Connection
  • 1 Connect the Grove - LED to the Grove J2 port(D13 pin) of the Grove AI HAT
  • 2 Connect the Grove AI HAT to the computer via USB Type C port.
Grove AI HAT Arduino demo
Figure 8. Hardware connection
Software
  • Step 1. Creat a new blank sketch in your Arduino IDE, copy the following code into that sketch.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(13, OUTPUT);
}


void loop() {
  digitalWrite(13, HIGH);   // 
  delay(1000);                       // wait for a second
  digitalWrite(13, LOW);    // 
  delay(1000);                       // wait for a second
}
  • Step 2. Upload the demo. If you do not know how to upload the code, please check How to upload code.

After done uploading, the Grove - LED will flash.

Analog Demo

Materials required

Hardware Connection
  • 1 Conect the Grove - Round Force Sensor (FSR402) to the Grove J11 port(A0 pin) of the Grove AI HAT
  • 2 Conect the Grove AI HAT to the computer via USB Type C port.
Grove AI HAT Arduino demo
Figure 9. Hardware connection
Software
  • Step 1. Download the ADS1115 library

  • Step 2. Open the demo at File → Examples →ADS-1115-master →Example →ADS1115_ReadVoltage

Grove AI HAT Arduino demo
Figure 10. ADC Demo Path
  • Step 3. Upload the demo. If you do not know how to upload the code, please check How to upload code.

  • Step 4. Open the Serial Monitor of Arduino IDE by click Tool-> Serial Monitor. Or tap the Ctrl+Shift+M key at the same time. Set the baud rate to 115200.

Then, press the Grove - Round Force Sensor, the A0 valnue will change.

Grove AI HAT Arduino demo
Figure 11. Output

kendryte k210 Standalone SDK

In order to use the kendryte k210 Standalone SDK with Grove AI HAT you should config the Arduino IDE as the previous chapter Play with Arduino.

Now let's assume that you have downloaded the K210 development board in the Arduino IDE, selected Seeed K210 Pi board and k-flash.

First of all download the kendryte-standalone-demo at github.

We will take the face_detect for instance.

Face Detect Demo

Materials required

Hardware Connection
  • a. Connect the OV2640 camera into the Grove AI Hat 24 pin FPC camera connector
  • b. Connect the 2.4 inch TFT LCD into the Grove AI Hat 24 pin FPC LCD connector
  • c. Connect the Grove AI HAT to the computer via USB Type C port.
Grove AI HAT face detect demo-1
Figure 12. Hardware connection of face detect demo
Software
Download the AI module
  • Step 1. Enter the folder, D:XXXXXX\kendryte-standalone-demo\face_detect\kfpkg, D:XXXXXX is the path where you download the kendryte-standalone-demo. You will find four files as following:
Grove AI HAT face detect demo-1
Figure 13. This folder contains the AI module of face detect
  • Step 2. Open the Arduino IDE, click File → Preferences, click on the part marked in the red box to open the Arduino package folder.
Grove AI HAT face detect demo-2
Figure 14. Open preferences windows
Grove AI HAT face detect demo-3
Figure 15. Click on the part marked in the red box
Grove AI HAT face detect demo-4
Figure 16. Click on the part marked in the red box
  • Step 3. Find the Kflash_py.exe in the path XXXXX\packages\Seeeduino\tools\kflash\1.1.0, XXXX is the folder you just open by click the links in the Arduino references Windows. For instance mine is C:\Users\seeed\AppData\Local\Arduino15\packages\Seeeduino\tools\kflash\1.1.0, copy the whole path of your own, we need to use it in the next step.
Grove AI HAT face detect demo-5
Figure 17. Copy the path of Kflash_py.exe
  • Step 4. Back to the kfpkg folder, enter a command console, you can use any console you like. If you don't know how to open one, for win10 user, you can click File →Open Windows Power Shell →Open Windows Power Shell
Grove AI HAT face detect demo-6
Figure 18. Open power shell
Grove AI HAT face detect demo-7
Figure 19. Open power shell
  • Step 5. Download the AI module into your Grove AI Hat
    Remember the path we copied in the step3? Mine is:
1
C:\Users\seeed\AppData\Local\Arduino15\packages\Seeeduino\tools\kflash\1.1.0

For windows user, you should change all the \ in the path into /, then we get:

1
C:/Users/seeed/AppData/Local/Arduino15/packages/Seeeduino/tools/kflash/1.1.0

Replace the following command with you own Path

1
C:/Users/seeed/AppData/Local/Arduino15/packages/Seeeduino/tools/kflash/1.1.0/kflash_py -n -p COM31 -b 2000000 -B dan face_detect.kfpkg

Check your COM number in the Computer Device Manager

Grove AI HAT face detect demo-8
Figure 20. Check the COM number

Replace the COM number with your own COM number, as you can see, mine is COM21, then enter the following command and run:

1
C:/Users/seeed/AppData/Local/Arduino15/packages/Seeeduino/tools/kflash/1.1.0/kflash_py -n -p COM21 -b 2000000 -B dan face_detect.kfpkg
Grove AI HAT face detect demo-9
Figure 21. Replace the Path of kflash_py and the COM port number with your own path and COM port

When the download is finish, you will see:

Grove AI HAT face detect demo-10
Figure 22. Download Success

Now you will see the LCD screen light on with full white. Let's move to next step.

Download Demo code
  • Step 1. Creat a new folder, creat a new blank xxx.ino file. xxx must be the same as the folder name. For instance both of mine is Face_Detect_Demo

Attention

Please make sure the .ino file is blank and the .ino name is the same as your folder.

Grove AI HAT face detect download-1
Figure 23. Great blank ino
  • Step 2. Copy all the files in the folder XXXXX\kendryte-standalone-demo\face_detect into the new folder you've just created.
Grove AI HAT face detect download-2
Figure 24. Copy file into the ino folder
  • Step 3. Open the .ino file with your Arduino IDE. The whole project will opened in the Arduino IDE.
Grove AI HAT face detect download-3
Figure 25. Open the .ino file with Arduino IDE
  • Step 4. Board Config. Before building, we need to config the camera and LED. In this demo, we use OV2604 and Grove AI Hat.
    The code for Grove AI Hat is BOARD_LICHEEDAN, so we need to config as below:
Grove AI HAT face detect download-4
Figure 26. Board Config
  • Step 5. Build the main.c, please make sure you have selected the right board and flasher.
    K-flash/Seeed k210 Pi/
Grove AI HAT face detect download-6
Figure 27. Board Select
Grove AI HAT face detect download-5
Figure 28. Build the main.c
  • Step 6. Download the face_detect_demo into your Grove AI Hat. When the downloading is success, you can see as below:
Grove AI HAT face detect download-7
Figure 29. Success

Now you can use the camera to shoot faces, rotate the focus ring on the camera or adjust the distance from the camera to the face to make the face clear. A red box appears when it recognizes a face.

Resources

Tech Support

Please submit any technical issue into our forum