Google Coral (Edge TPU) and ASI Biont: On-Device ML Meets Autonomous AI Control

Introduction

Edge AI is transforming how we process data — moving inference from the cloud to local devices for lower latency, privacy, and offline reliability. Google Coral (Edge TPU) is a leading edge accelerator that runs TensorFlow Lite models with up to 4 TOPS (tera-operations per second) on-device. But a standalone Coral board is just a compute module. To make it truly useful, you need an intelligent orchestrator that can receive inference results, make decisions, and trigger actions in real time.

ASI Biont is an autonomous AI agent that connects to any device through chat-based integration. Instead of writing custom firmware or cloud backends, you describe your hardware setup in natural language — ASI Biont generates the Python code, executes it in a sandbox, and establishes a two-way control loop. This article shows you how to integrate Google Coral (Edge TPU) with ASI Biont for real-time computer vision, object detection, and automated responses without a cloud dependency.

Why Connect Google Coral to an AI Agent?

Google Coral excels at running quantized neural networks locally — MobileNet, SSD, YOLO variants — at 30+ FPS. However, Coral itself lacks high-level decision logic. It outputs bounding boxes and class labels, but doesn't know what to do with them. By connecting Coral to ASI Biont via SSH or a companion microcontroller, you unlock:

  • Autonomous decision-making: AI processes detection results and triggers actions (alerts, motors, database writes).
  • Contextual awareness: ASI Biont can combine Coral's output with other sensor data (temperature, motion, time).
  • Remote management: Update models, change thresholds, or restart pipelines without physical access.
  • No cloud lock-in: All inference stays on the Edge TPU; ASI Biont runs on your server or locally via Hardware Bridge.

Connection Method: SSH + Python Script

Google Coral runs Mendel Linux (Debian-based) and supports Python, C++, and TensorFlow Lite. The most practical integration method is SSH — ASI Biont connects to the Coral board via paramiko inside the execute_python sandbox. The AI agent writes a Python script that:

  1. SSH into the Coral board using credentials you provide.
  2. Executes a pre-installed Python inference script or runs a remote command.
  3. Captures stdout/stderr — detection results.
  4. Parses the output and sends it back to ASI Biont for decision-making.

Alternatively, if your Coral is attached to a host PC (via USB), you can use Hardware Bridge (bridge.py) with a serial connection through a microcontroller that receives detection data from Coral via UART. For this guide, we focus on SSH — the most common setup for Coral Dev Board or Coral USB Accelerator on a Raspberry Pi.

Step-by-Step Integration: Object Detection with Automated Actions

Prerequisites

  • Google Coral Dev Board (or USB Accelerator + Raspberry Pi) with TensorFlow Lite runtime installed.
  • A sample model: ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite (download from Coral AI models page).
  • Python 3.7+ on the Coral with pycoral library.
  • ASI Biont account (free tier available at asibiont.com).
  • Your Coral board's IP address, username, password or SSH key.

Step 1: Prepare the Inference Script on Coral

Create a Python script on your Coral board that captures frames from a USB camera, runs inference, and outputs JSON results to stdout. Example detect.py:

import sys
import json
from pycoral.adapters import common
from pycoral.adapters import detect
from pycoral.utils.dataset import read_label_file
from pycoral.utils.edgetpu import make_interpreter
from PIL import Image
import cv2

# Load model
interpreter = make_interpreter('ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite')
interpreter.allocate_tensors()
labels = read_label_file('coco_labels.txt')

cap = cv2.VideoCapture(0)
ret, frame = cap.read()
if not ret:
    print(json.dumps({'error': 'No frame'}))
    sys.exit(1)

# Resize to model input size
_, height, width, _ = interpreter.get_input_details()[0]['shape']
frame_resized = cv2.resize(frame, (width, height))
common.set_input(interpreter, frame_resized)
interpreter.invoke()

objs = detect.get_objects(interpreter, score_threshold=0.5)
results = []
for obj in objs:
    results.append({
        'label': labels.get(obj.id, 'unknown'),
        'score': float(obj.score),
        'bbox': [obj.bbox.xmin, obj.bbox.ymin, obj.bbox.xmax, obj.bbox.ymax]
    })

print(json.dumps({'detections': results, 'count': len(results)}))
cap.release()

Make the script executable and test it locally:

python3 detect.py

Expected output: {"detections": [{"label": "person", "score": 0.89, "bbox": [10, 20, 100, 200]}], "count": 1}

Step 2: Connect ASI Biont to Coral via SSH

In the ASI Biont chat, describe your setup:

"Connect to my Google Coral board at 192.168.1.100 via SSH. Username: mendel, password: mypass. Run the script /home/mendel/detect.py and parse the JSON output. If a person is detected with confidence > 0.7, send me a Telegram alert. Also log the detection count to a local CSV file."

ASI Biont will generate and execute the following Python code (you can review it before running):

import paramiko
import json
import csv
import io

# SSH connection
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.1.100', username='mendel', password='mypass')

# Run inference script
stdin, stdout, stderr = ssh.exec_command('python3 /home/mendel/detect.py')
output = stdout.read().decode().strip()

# Parse JSON
if output:
    data = json.loads(output)
    detections = data.get('detections', [])
    count = data.get('count', 0)

    # Decision logic
    person_detected = any(d['label'] == 'person' and d['score'] > 0.7 for d in detections)
    if person_detected:
        # Send Telegram alert (ASI Biont provides Telegram tool)
        print('ALERT: Person detected!')

    # Log to CSV on the server
    csv_buffer = io.StringIO()
    writer = csv.writer(csv_buffer)
    writer.writerow(['timestamp', 'count', 'labels'])
    writer.writerow([datetime.now().isoformat(), count, [d['label'] for d in detections]])
    # Store CSV via ASI Biont's file system tool
    print(f'LOG: {csv_buffer.getvalue()}')

ssh.close()

The AI agent then runs this script in its sandbox (30-second timeout). The SSH connection is established, inference runs on Coral, results are parsed, and ASI Biont acts on them — all without you writing a single line of integration code.

Alternative Connection: Hardware Bridge + USB/UART

If your Coral board doesn't have network access or you prefer a wired connection, use Hardware Bridge (bridge.py). This method is ideal when Coral is connected to a host PC via USB and you want to control it locally.

  1. Download bridge.py from ASI Biont dashboard (Devices → Create API Key → Download bridge).
  2. Run on your PC:
pip install pyserial requests websockets
python bridge.py --token=YOUR_API_TOKEN --ports=COM3 --baud 115200
  1. Connect Coral's UART pins to your PC's USB-serial adapter (TX→RX, RX→TX, GND→GND).
  2. In ASI Biont chat: "Use Hardware Bridge to connect to Coral via COM3 at 115200 baud. Send command 'detect' and read JSON response."

The AI will use industrial_command(protocol='serial', command='serial_write_and_read', data='6465746563740a') to send the hex string for 'detect\n' and parse the response.

Real-World Use Cases

1. Smart Video Surveillance

Deploy Coral at a warehouse entrance. ASI Biont runs the detection loop every 5 seconds via SSH. When it detects a person without a safety helmet (custom model), it triggers an email alert and logs the event. No cloud video streaming — only inference results are transmitted.

2. Autonomous Sorting Line

On a conveyor belt, Coral identifies defective products by visual anomalies. ASI Biont receives the detection result and sends a command via Modbus TCP to a PLC that activates a pneumatic rejector arm. End-to-end latency under 100ms.

3. Real-Time Analytics Dashboard

Coral counts people entering a retail store. ASI Biont aggregates the counts every minute and writes to a PostgreSQL database. A Grafana dashboard visualizes foot traffic. The AI agent also adjusts HVAC setpoints via BACnet when occupancy exceeds a threshold.

Comparison of Integration Methods

Method Latency Complexity Best For
SSH 50-200ms Medium Networked Coral boards with full Python environment
Hardware Bridge (UART) 10-50ms Low Local, offline, or serial-only setups
MQTT (via ESP32 companion) 100-500ms High Distributed sensor networks with Coral as edge node
HTTP API (Coral serving) 20-100ms Medium RESTful inference with multiple clients

Why ASI Biont Eliminates Manual Integration Work

Traditional integration requires:
- Writing a Python daemon on Coral
- Setting up a message broker or REST server
- Building a dashboard or alerting system
- Handling error cases and reconnections

With ASI Biont, you describe the integration in natural language. The AI agent:
- Generates the exact paramiko or pyserial code
- Tests the connection (e.g., sends HELP to verify COM port)
- Writes decision logic (if-then rules, thresholds)
- Connects to external services (Telegram, email, databases)
- Runs everything in a sandbox with 30-second timeout for safety

You don't need to wait for platform updates — ASI Biont connects to any device through execute_python because it writes custom Python code for each scenario. Just provide the connection parameters (IP, port, credentials, API key) in the chat, and the AI handles the rest.

Code Example: Complete SSH-Based Integration

Here's the full conversation flow in ASI Biont:

User: "Connect to my Google Coral at 192.168.1.100 via SSH. Username: mendel, key file: ~/.ssh/id_rsa. Run detect.py every 10 seconds. If a person is detected, turn on a GPIO LED on pin 18. Write the detection log to a local CSV."

ASI Biont: "I'll set up a periodic task. Here's the code I'll run:"

import paramiko
import json
import csv
import time
from datetime import datetime

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.1.100', username='mendel', key_filename='/home/user/.ssh/id_rsa')

for _ in range(3):  # Limit iterations for sandbox timeout
    stdin, stdout, stderr = ssh.exec_command('python3 /home/mendel/detect.py')
    output = stdout.read().decode().strip()
    if not output:
        break
    data = json.loads(output)
    detections = data.get('detections', [])
    person = any(d['label'] == 'person' and d['score'] > 0.7 for d in detections)

    if person:
        # Turn on LED via GPIO (mraa or RPi.GPIO on Coral)
        ssh.exec_command('echo 1 > /sys/class/gpio/gpio18/value')
    else:
        ssh.exec_command('echo 0 > /sys/class/gpio/gpio18/value')

    # Append to CSV
    with open('detections.csv', 'a', newline='') as f:
        writer = csv.writer(f)
        writer.writerow([datetime.now().isoformat(), data['count'], [d['label'] for d in detections]])

    time.sleep(10)

ssh.close()
print('Integration complete. CSV updated.')

ASI Biont: "Executed successfully. Detected 2 persons in 3 runs. LED toggled accordingly. CSV saved."

Conclusion

Google Coral (Edge TPU) brings powerful on-device ML to the edge, but its true potential is unlocked when paired with an autonomous AI agent like ASI Biont. Whether you use SSH for remote control, Hardware Bridge for local serial access, or MQTT for IoT ecosystems, ASI Biont eliminates weeks of custom coding. You simply describe your goal, and the AI writes, tests, and runs the integration in seconds.

Ready to connect your Coral to an intelligent AI orchestrator? Start for free at asibiont.com. No dashboard setup, no plugin development — just chat with the AI and watch your edge device come alive.

← All posts

Comments