Kurbas-640b: integration manual

Integration manual
Updated 1 month ago

Wire pinout

The camera comes with a standard ribbon cable featuring a SHR-08V-S-B (JST 8-pin) connector.

1. Black (thick) — GND (ground)

2. Red — +5 V

3. Green — USB D+

4. White — USB D-

5. Blue — RX (UART)

6. White — TX (UART)

7. Yellow — analog video output

8. Black — shield (ground)

Connection diagram to the drone using the example of Vyriy

Red — 5 V

Black — G

Yellow — CAM

Blue — R3

White — T3

Configuring the corresponding UART port

In Betaflight, open the Ports tab and enable the “Configuration/MSP” option on UART3. Pay attention to the maximum number of MSP ports that can be active simultaneously on the flight controller.

 

USB connection (Linux)

1. Solder the USB cable to the camera’s supplied cable according to the following wiring diagram:

Camera

USB

Signal

Red

Red

+5 V

Black

Black

GND

Green

Green

USB D+

White

White

USB D-

 

2. Plug the cable into the USB connector on the board.

3. Check the camera in the console.

4. Install the tools required to test the camera:

sudo apt update && sudo apt install -y v4l-utils ffmpeg

5. Make sure the camera has been detected. Enter the command and look for a block in the output whose name contains the prefix usb-… in parentheses — this is your connected USB camera. The first line under that block (usually /dev/video0) indicates the video stream device you should use. If no such block appears, the system has not recognized the camera, and you should check the cable, power supply, or try reconnecting it.

v4l2-ctl --list-device

6. Check the camera image:

ffplay -f v4l2 -video_size 640x512 -i /dev/video0

Connection using Python + OpenCV

1. Install the tools required to test the camera:

sudo apt update

sudo apt install -y python3-opencv python3-numpy v4l-utils

2. Make sure the camera has been detected. Run the command and look for a block in the output whose name contains the prefix usb-… in parentheses — this is your connected USB camera. The first line under that block (usually /dev/video0) indicates the video stream device you should use. If no such block appears, the system has not recognized the camera, and you should check the cable, power supply, or try reconnecting it.

v4l2-ctl --list-devices

3. Navigate to the home directory:

cd ~

 

4. Create a file:

nano test.py

 

5. Copy and paste the code:

import cv2

import time

DEVICE = "/dev/video0"       # замініть, якщо іншій нод

WIDTH, HEIGHT = 640, 512

cap = cv2.VideoCapture(DEVICE, cv2.CAP_V4L2)

cap.set(cv2.CAP_PROP_FRAME_WIDTH,  WIDTH)

cap.set(cv2.CAP_PROP_FRAME_HEIGHT, HEIGHT)

if not cap.isOpened():

    raise IOError(f"Не вдалося відкрити {DEVICE}")

print("Натисніть 'q' для виходу")

t0, frames = time.time(), 0

while True:

    ret, frame = cap.read()

    if not ret:

        print("Кадр не зчитано"); break

    cv2.imshow("UVC 640×512", frame)

    frames += 1

    if cv2.waitKey(1) & 0xFF == ord('q'):

        break

print(f"Середній FPS: {frames / (time.time() - t0):.1f}")

cap.release()

cv2.destroyAllWindows()

 

6. Save the code → Ctrl + O, Enter; exit → Ctrl + X.

 

7. Run the file:

python3 test.py

 

Mounting the camera on the board

The camera can be installed in any preferred way. For convenience, you can use the mounting option provided in the Kurbas-640b housing STL link or adapt it to your own needs. In this setup, the camera is secured with four M2 side screws.

Did this answer your question?