The promise of Edge AI is finally materializing. With multi-core MCUs and dedicated NPUs in everything from ESP32-S3 to Raspberry Pi 5, we can run sensor fusion and lightweight neural networks right where the data is born. But the last mile—connecting that on-device intelligence to a business workflow—still feels like plumbing. That's where ASI Biont changes the game. Instead of writing glue code and maintaining dashboards, you simply tell the AI agent what you have and what you want, and it writes the integration for you. In this guide, I'll show you how to hook up a typical sensor fusion node (IMU + environmental sensors + an ML classifier) to ASI Biont using MQTT, Modbus, and even a raw COM port, and how to turn the raw predictions into automated actions.
Why Connect a Sensor Fusion Device to an AI Agent?
A sensor fusion device is only as valuable as the decisions it enables. On-device ML gives you real-time predictions—like "motor bearing wear high" or "room occupancy 3 people"—but unless those predictions reach a system that can act on them, they're just numbers. ASI Biont acts as that intelligent bridge: it ingests your device's data, correlates it with other sources, and triggers workflows (alerts, data logging, or even control signals) through chat-based interaction. You don't need a dedicated integration server; you just talk to the agent.
Connection Options: From COM to Cloud
ASI Biont supports a wide range of industrial protocols, so you can pick the one that matches your hardware and network constraints. For a typical sensor fusion node based on an ESP32 or STM32, the most common paths are:
- MQTT (paho-mqtt): Ideal for Wi-Fi-enabled nodes publishing JSON telemetry.
- Modbus/TCP (pymodbus): When you have a PLC or industrial gateway that aggregates sensors.
- COM port (via Hardware Bridge): For RS-232/RS-485 connections, especially with legacy equipment.
- HTTP API (aiohttp): For RESTful endpoints on the device.
- OPC-UA (opcua-asyncio): For industrial ecosystems that require standard information models.
The best part: ASI Biont also has a universal execute_python capability. If none of the standard connectors fit, you simply describe your device's interface, and the AI writes a custom Python script (using pyserial, paho-mqtt, etc.) that runs in a sandboxed environment. This means you can connect anything—even a proprietary sensor with a weird binary protocol—in minutes.
Real-World Use Case: Predictive Maintenance on a Conveyor Belt
Imagine you have a custom sensor fusion board on a conveyor belt that measures vibration (accelerometer), temperature, and acoustic emissions. On-device, it runs a TinyML model that classifies the belt state as "healthy", "worn", or "critical" every second. You want ASI Biont to receive these classifications and, when a "critical" event occurs, send an alert to your team's Telegram channel and log a timestamped record to a local CSV file.
Step 1: Publish Telemetry via MQTT
Your device (ESP32 with MicroPython) publishes to topic factory/belt1/status with a JSON payload:
# MicroPython on ESP32
import umqtt.simple as mqtt
import json
client = mqtt.MQTTClient('belt1', '192.168.1.100', port=1883)
client.connect()
while True:
# Assume get_status() returns a dict with 'state' and 'confidence'
status = get_status() # e.g., {'state': 'worn', 'confidence': 0.85}
client.publish('factory/belt1/status', json.dumps(status))
time.sleep(1)
Step 2: Connect ASI Biont to MQTT Broker
In the ASI Biont chat, you simply type:
"Connect to MQTT broker at 192.168.1.100, subscribe to factory/belt1/status. Parse the JSON and if state is 'critical', send an alert to Telegram chat ID 123456789 and append a line to a CSV file on the bridge machine."
The agent will respond with the Python code it generated (using paho-mqtt) and then run it as a background task. Here's a snippet of what it might produce:
# Generated by ASI Biont
import paho.mqtt.client as mqtt
import json
import csv
import requests
from datetime import datetime
def on_message(client, userdata, msg):
data = json.loads(msg.payload)
if data.get('state') == 'critical':
# Send Telegram alert
requests.post('https://api.telegram.org/bot<YOUR_TOKEN>/sendMessage',
json={'chat_id': '123456789', 'text': '⚠️ Belt1 CRITICAL'})
# Log to CSV
with open('alerts.csv', 'a') as f:
writer = csv.writer(f)
writer.writerow([datetime.now().isoformat(), msg.topic, data])
client = mqtt.Client()
client.on_message = on_message
client.connect('192.168.1.100', 1883)
client.subscribe('factory/belt1/status')
client.loop_forever()
Notice that the agent used requests.post to the official Telegram API—no invented endpoints, just standard HTTP.
Step 3: Run and Monitor
The generated task runs in the background. You can ask ASI Biont for a summary of recent alerts, or even have it analyze the CSV to detect trends (e.g., "how many critical events per shift?"). All through natural language.
Alternative: Direct COM Port via Hardware Bridge
If your sensor fusion device is connected via RS-232 (e.g., an industrial controller that outputs ASCII strings), you can use the Hardware Bridge. You download bridge.py from the ASI Biont dashboard, then run it on the machine that has the COM port:
python bridge.py --token=YOUR_TOKEN --ports=COM3 --baud 115200 --rate=10
Now, in the chat, you can issue commands to read from or write to the device using industrial_command. For example:
"Read the latest line from COM3 and parse the temperature and vibration values."
The AI will respond with something like:
response = industrial_command(
protocol='serial',
command='read_line',
port='COM3',
baud=115200
)
# Then parse the line, e.g., "T=25.4,V=0.02"
This is especially handy for legacy equipment that only has a serial port.
The Power of execute_python: Connect Anything
Let's say your sensor fusion device uses a proprietary binary protocol over UDP. No standard connector exists. With ASI Biont, you just describe it:
"I have a device sending 20-byte UDP packets to port 5005. Bytes 0-1 are a header (0xAA55), bytes 2-5 are a float temperature, bytes 6-9 are a float vibration, and byte 10 is a status byte. Write a script to decode these and publish to MQTT."
The AI will generate a Python script using socket and struct to parse the packets, then publish the decoded data to an MQTT topic. It runs in the sandbox, and you can set it to run continuously. No waiting for vendor SDKs, no middleware.
Why This Matters: Speed and Flexibility
In my experience, integrating a new sensor node into a monitoring system usually takes a day of coding and debugging. With ASI Biont, it's minutes. The agent handles protocol specifics, error handling, and even suggests improvements (like adding a watchdog timer). This is a game-changer for rapid prototyping and small-scale deployments where you can't afford a dedicated integration engineer.
Practical Tips for Reliable Integration
- Use JSON for structured data—it's human-readable and easy to parse in Python.
- Set MQTT QoS to 1 for important alerts to avoid message loss.
- Test with a simulator first—many devices offer a test mode.
- Keep your scripts idempotent—if the bridge restarts, it should reconnect cleanly.
Conclusion
Connecting a sensor fusion device to ASI Biont is not just about data transfer—it's about creating an intelligent loop where on-device predictions trigger real-world actions. Whether you use MQTT, Modbus, or a raw COM port, the AI agent does the heavy lifting. The execute_python capability ensures that even the most exotic device can be integrated without waiting for official support.
Ready to try it? Head over to asibiont.com and start your first integration. You'll be amazed at how fast you can go from a bare sensor to a fully automated alerting system.
Comments