Edge AI Meets Smart Automation: Integrating Google Coral (Edge TPU) with ASI Biont

Why Hook Google Coral Up to an AI Agent?

Google Coral (Edge TPU) is a purpose-built AI accelerator that runs TensorFlow Lite models at blazing speeds—up to 4 TOPS (trillions of operations per second) for int8 inference. While it excels at on-device computer vision, the real magic happens when you bridge that local intelligence with a higher-level orchestrator like the ASI Biont AI agent. Instead of writing boilerplate MQTT brokers, custom REST APIs, or polling loops, you can simply describe your automation goal in natural language, and ASI Biont generates and runs the integration code on the fly.

Imagine a retail store: a Coral Dev Board counts customers at the entrance, sends the raw count via MQTT, and ASI Biont decides when to alert staff about queue lengths or to adjust HVAC based on occupancy. All without manual scripting—just a chat conversation.

Which Connection Method Does ASI Biont Use?

Google Coral devices (Dev Board, USB Accelerator, or Dev Board Mini) typically run a Linux-based Mendel OS or Debian. ASI Biont connects to them via two primary channels:

  1. SSH – for remote command execution, model deployment, and live camera feed handling. The AI agent writes a Python/Paramiko script that runs in its sandbox (execute_python) and connects to the Coral over SSH to start or stop inference scripts.
  2. MQTT – for continuous data exchange. The Coral publishes detection results (object class, confidence, timestamp) to a topic like coral/detections. ASI Biont subscribes to that same topic using paho-mqtt inside execute_python, processes the data, and can even publish commands back (e.g., coral/command to switch models or adjust thresholds).

No custom bridges or COM ports needed—just network connectivity and a broker (Mosquitto, HiveMQ, or Aerospike). The AI agent handles all protocol details.

Real-World Scenario: AI-Powered People Counting & Queue Alerts

Consider a smart retail or office environment where you want to:
- Detect people entering/exiting using a camera with Google Coral.
- Send real-time occupancy data to a central AI agent.
- Automate actions: turn on lights when someone enters, send Slack alerts when queues exceed 3 people, or log data for analytics.

Step 1: Deploy a TFLite Model on Coral

On the Coral Dev Board, you'd normally run a script using the pycoral library. The model (ssd_mobilenet_v2_coco_quant.tflite) is pre-compiled for the Edge TPU. The script captures frames from a USB camera, runs inference, and publishes detections via MQTT.

Python code that runs ON the Coral (simplified):

import paho.mqtt.client as mqtt
from pycoral.adapters import common, detect
from pycoral.utils.dataset import read_label_file
from pycoral.utils.edgetpu import make_interpreter

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

# MQTT setup
client = mqtt.Client()
client.connect('mqtt-broker.local', 1883, 60)

# Capture and detect (pseudo)
while True:
    frame = capture_frame()
    common.set_input(interpreter, frame)
    interpreter.invoke()
    objs = detect.get_objects(interpreter, score_threshold=0.6)
    for obj in objs:
        msg = f'{labels[obj.id]},{obj.score:.2f},{obj.bbox.xmin},{obj.bbox.ymin}'
        client.publish('coral/detections', msg)
    time.sleep(0.1)

This script runs autonomously on the Coral, continuously publishing detection events.

Step 2: Connect ASI Biont via MQTT (execute_python)

Now, instead of writing a separate listener, you open the ASI Biont chat and describe:

“I have a Coral device publishing object detections to MQTT topic 'coral/detections' at broker 192.168.1.50. Subscribe and count how many 'person' detections I get per minute. If the count exceeds 5 in a minute, send me a Telegram alert.”

ASI Biont’s AI agent will generate and execute a Python script in its sandbox that does exactly that:

import paho.mqtt.client as mqtt
import json
import time
from collections import defaultdict
from datetime import datetime

person_count = 0
window_start = time.time()
last_alert = 0

def on_message(client, userdata, msg):
    global person_count, window_start, last_alert
    payload = msg.payload.decode()
    # format: "person,0.87,100,200"
    parts = payload.split(',')
    if parts[0] == 'person' and float(parts[1]) > 0.6:
        person_count += 1
    # Check window (60 seconds)
    now = time.time()
    if now - window_start >= 60:
        print(f'[LOG] Person count in last minute: {person_count}')
        if person_count > 5 and now - last_alert > 120:  # avoid spam
            send_telegram_alert(f'High traffic! {person_count} people detected.')
            last_alert = now
        person_count = 0
        window_start = now

client = mqtt.Client()
client.on_message = on_message
client.connect('192.168.1.50', 1883, 60)
client.subscribe('coral/detections')
client.loop_forever()  # runs until timeout (30s in sandbox)

Note: In ASI Biont’s sandbox, loop_forever() will be stopped after 30 seconds to prevent infinite loops. For production, you’d deploy this script on a permanent server or use ASI Biont’s industrial_command tool for stateless queries. But for prototyping, this is perfectly fine.

Step 3: Automate with Industrial Commands

If you prefer not to run a persistent subscriber, you can use the MQTT publish command from ASI Biont to send commands back to the Coral. For example, you could tell the AI:

“Publish a message to topic 'coral/command' with payload 'SWITCH_MODEL,people_detector'.”

The AI uses industrial_command(protocol='mqtt', command='publish', topic='coral/command', payload='SWITCH_MODEL,people_detector'). The Coral script subscribes to that topic and changes its model on the fly.

Why This Approach Beats Manual Coding

Building such a pipeline from scratch requires:
- Writing MQTT client code (with error handling)
- Setting up a broker
- Implementing queues, thresholds, and alerting logic
- Debugging network issues

With ASI Biont, you simply describe what you want in natural language. The AI agent writes the correct paho-mqtt script, configures the broker address, and runs it in a sandbox. No Python environment setup, no pip installs, no manual while True loops. The agent even handles reconnection logic if you ask.

Real deployment example: A test facility integrated a Coral-based anomaly detector on a conveyor belt. The Coral published “defect” or “pass” via MQTT. ASI Biont aggregated stats and triggered a PLC (via Modbus/TCP) to divert defective parts—all orchestrated through a single chat conversation.

Getting Started

  1. Set up Coral – Flash the Dev Board with Mendel Linux, install pycoral, and run your model.
  2. Choose a connection method – For long-running detection streams, MQTT is ideal. For one-off model updates, SSH works.
  3. Open ASI Biont – Describe your device, its IP/broker, and what you want to automate.
  4. The AI does the rest – It write the Python integration, executes it in the cloud, and returns results or sets up persistent tasks.

No dashboard buttons, no “add device” forms—just pure conversational automation.

Conclusion

Google Coral brings edge AI inference down to a $60 device, yet integrating it into a larger automation ecosystem often involves tedious glue code. ASI Biont eliminates that friction by acting as an intelligent middleware that speaks MQTT, SSH, Modbus, and dozens of other protocols. Whether you're building a smart retail system, a manufacturing inspection station, or a home security setup, you can connect Coral to an AI agent in minutes—not days.

Ready to try it? Head over to asibiont.com and start chatting with your devices.

← All posts

Comments