Work record: , 4 minute read

Dristy (দৃষ্টি)

A camera that answers with a number, not a video stream. Open firmware for a K210 that does the seeing so the robot doesn't have to.

Dristy is Bengali for sight. It’s open firmware and a host API for a Kendryte K210 camera module (a DFRobot SEN0305) that does vision on the camera itself, so a robot gets a compact answer over a serial line (“target at error_x, error_y”) instead of a video stream it has to decode.

A robot doesn’t see. It has a sensor that turns light into numbers, and a program that has to decide what those numbers mean before the motors move. Dristy is that program, running on the sensor.

Five boxes: light, pixels, look, answer, robot; from the lens to a few bytes on a UART
From light to a number a robot can use. The last box receives four bytes, not a frame.Open image to inspect at full size.

Why put the brain in the camera

A flight controller or a Raspberry Pi can run vision. Usually you shouldn’t make it. If the main computer does vision, it has to ingest JPEG or YUV at tens of frames a second, and a stall in OpenCV stalls attitude control: you end up debugging why your PID is late. If the camera does vision, it sends a few bytes (an id, x, y, a size), and the robot’s loop stays boring and fast. Dristy is the same idea as a GPS module: a specialist that speaks a short protocol.

It’s also the same idea as Mongla’s board split, at a smaller scale: keep the slow, heavy thinking away from the thing that has to be on time.

What it does, shown rather than claimed

Every LCD picture here was pulled off a live board over UART, from the device’s own 320 × 240 screen.

The same firmware also reads QR codes, AprilTags and ArUco markers, follows a line by regression on a contrast strip, estimates optical flow, detects faces on the KPU, and runs a hybrid detect-and-track mode for a lock that survives a missed frame.

jobmodemeasured on the desk
VOC detectDETECTabout 7 FPS when the net runs
colourCOLOUR_TRACK16 blobs, about 19 FPS
lineLINE_FOLLOWline valid, about 20 FPS
motionMOTION_DETECT55 %, then 99 in the shot above
tags, QR, facethose modeshandshake ok; zero hits until shown a marker or face

Zeros there mean the scene had no tag or face in it, not that the mode is dead. The audit says which.

The budget is the architecture

The K210 has two 64-bit RISC-V cores, a convolution engine (the KPU), 8 MiB of SRAM, no Linux and no MMU. On a chip that small, where every buffer goes is the design.

K210 SRAM budget: SRAM0 4 MiB for code and classical vision, SRAM1 2 MiB for trackers and overlays, AI SRAM 2 MiB for KPU feature maps
One chip, 8 MiB of SRAM, spent on the latest frame. Model input widths are multiples of 64 so the camera can DMA straight into AI SRAM without the CPU touching a pixel.Open image to inspect at full size.
400 MHz
PLL1 raised at boot: about +33 % KPU speed before any micro-optimisation
320 × 240
one mailbox frame; the newest wins
0x55 0xAA
the industry-common packet framing, so stock tools still work

One rule runs through all of it, the same one that runs through Mongla:

Keep the newest frame, throw the rest away. Dristy is a mailbox, not a queue.

A robot that steers on a picture from 200 ms ago is worse off than one that missed a frame. The camera preview and the neural net even share one camera lease, so opening the detector has to stop the preview first. That isn’t a bug; it’s the physics of one pipe.