Introduction
In the world of industrial IoT and predictive maintenance, sensor fusion — combining data from accelerometers, IMUs, LiDAR, and cameras — is transforming how we monitor equipment. According to a 2025 Gartner report, 64% of industrial companies plan to deploy Edge AI by 2027, citing latency reductions of up to 82% compared to cloud-only inference. But integrating multiple sensors with on-device machine learning (ML) models often requires custom firmware, middleware, and complex scripting. Enter ASI Biont: an AI agent that connects to any sensor fusion system via chat. No dashboards. No drag-and-drop builders. Just describe your hardware and task, and the AI writes the integration code in seconds.
This article walks through a real use case: connecting a sensor fusion board (ESP32 with IMU + camera) to ASI Biont, running a TensorFlow Lite model for anomaly detection, and automating alerts — all through conversational commands.
Why Sensor Fusion + AI Inference at the Edge?
Sensor fusion combines data from multiple sources to create a more accurate representation of the environment. For example:
- IMU (accelerometer + gyroscope): detects vibration patterns in rotating machinery.
- Camera: captures visual signs of wear or misalignment.
- LiDAR: measures distance and 3D shape changes.
Running inference on-device (Edge AI) eliminates cloud round-trips, enabling real-time decisions. A 2025 study by McKinsey found that Edge AI reduces decision latency from 200 ms (cloud) to under 10 ms, critical for safety systems.
Connecting to ASI Biont: The Integration Method
ASI Biont supports multiple connection protocols, but for sensor fusion with on-device ML, MQTT is the ideal choice. Here’s why:
- ESP32 (or Raspberry Pi) can publish sensor readings and inference results to an MQTT broker.
- AI agent subscribes to the topic, analyzes data, and acts.
- No need for direct COM port or SSH — MQTT is lightweight, async, and reliable.
Step-by-Step Integration
- Hardware: ESP32 with MPU6050 IMU and OV2640 camera, flashed with a TensorFlow Lite model (trained via Edge Impulse) that detects motor bearing faults.
- Broker: Mosquitto running locally or on a VPS.
- ASI Biont setup: User opens the chat and describes the task.
User prompt:
"Connect to my MQTT broker at 192.168.1.100:1883. Subscribe to topic 'factory/motor1/sensors'. Read JSON payload with fields: vibration_x, vibration_y, temperature, inference_label. If inference_label is 'fault', publish alert to topic 'factory/alerts' and send me a Telegram message."
AI response: The agent writes and executes the following Python script (sandbox-compatible):
import paho.mqtt.client as mqtt
import json
import asyncio
import aiohttp
BROKER = "192.168.1.100"
PORT = 1883
TOPIC_SENSORS = "factory/motor1/sensors"
TOPIC_ALERTS = "factory/alerts"
TELEGRAM_BOT_TOKEN = "your_bot_token"
TELEGRAM_CHAT_ID = "your_chat_id"
def on_message(client, userdata, msg):
payload = json.loads(msg.payload.decode())
label = payload.get("inference_label", "normal")
if label == "fault":
# Publish alert
alert_payload = {"device": "motor1", "status": "fault", "data": payload}
client.publish(TOPIC_ALERTS, json.dumps(alert_payload))
# Send Telegram alert
asyncio.run(send_telegram(f"⚠️ Motor1 fault detected! Data: {payload}"))
def on_connect(client, userdata, flags, rc):
print("Connected to broker")
client.subscribe(TOPIC_SENSORS)
async def send_telegram(text):
url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
async with aiohttp.ClientSession() as session:
await session.post(url, json={"chat_id": TELEGRAM_CHAT_ID, "text": text})
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
client.connect(BROKER, PORT, 60)
client.loop_forever() # Will run until sandbox timeout (30s) — use client.loop_start() for persistent
Note: In production, run the script externally on a server. ASI Biont sandbox has a 30-second timeout, so for long-running listeners, use client.loop_start() with a sleep loop or deploy the code via SSH to a Raspberry Pi.
Real-World Scenario: Predictive Maintenance
A factory uses an ESP32 with an accelerometer (ADXL345) and a microphone (for acoustic analysis) to monitor conveyor belt motors. The on-device ML model (Edge Impulse) classifies audio signatures into three states: normal, worn bearing, imminent failure.
- Without AI agent: Engineers manually check dashboards, set static thresholds, and miss early signs.
- With ASI Biont: The agent subscribes to MQTT, receives inference results, and automatically:
- Logs all data to a CSV file (via
openpyxl). - Sends Slack alerts when "imminent failure" is detected.
- Queries historical data to predict next failure date using linear regression (scikit-learn).
User prompt:
"Connect to the same broker. Subscribe to 'factory/conveyor1/inference'. Every time you receive data, append it to a CSV file. If the label is 'imminent_failure', send a Slack message to #maintenance."
AI generates:
import paho.mqtt.client as mqtt
import csv
import json
from datetime import datetime
BROKER = "192.168.1.100"
TOPIC = "factory/conveyor1/inference"
CSV_FILE = "/tmp/conveyor_log.csv"
def on_message(client, userdata, msg):
data = json.loads(msg.payload.decode())
data["timestamp"] = datetime.now().isoformat()
# Append to CSV
with open(CSV_FILE, "a", newline="") as f:
writer = csv.DictWriter(f, fieldnames=data.keys())
if f.tell() == 0:
writer.writeheader()
writer.writerow(data)
# Check for alarm
if data.get("label") == "imminent_failure":
# Send Slack (simplified)
print(f"ALERT: {data}")
# In real code, use slack_sdk
client = mqtt.Client()
client.on_message = on_message
client.connect(BROKER, 1883, 60)
client.subscribe(TOPIC)
client.loop_start()
import time
time.sleep(30) # runs for 30s in sandbox
Alternative: Direct SSH to Raspberry Pi with Camera
If you need real-time video inference (e.g., object detection on a conveyor belt), ASI Biont can connect via SSH to a Raspberry Pi running OpenCV and a YOLO model. The AI agent writes a paramiko script that:
- Remotely executes a Python script on the Pi.
- Captures frames, runs inference, and returns results.
- Controls GPIO to stop the belt if a defect is detected.
User prompt:
"SSH into 192.168.1.50 with user pi, key in my chat. Run ~/detect.py. If it returns 'defect', write 'STOP' to /dev/ttyUSB0 via serial."
AI generates:
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("192.168.1.50", username="pi", key_filename="/path/to/key")
stdin, stdout, stderr = ssh.exec_command("python3 ~/detect.py")
result = stdout.read().decode().strip()
if result == "defect":
# Use Hardware Bridge to write to COM port
# (This requires bridge.py running on the user's PC)
# For demonstration, we send command via chat
print("Defect detected — belt stop required")
ssh.close()
Why This Matters
Traditional integration of sensor fusion with AI agents requires:
- Writing MQTT client code.
- Handling JSON parsing.
- Implementing alerting logic.
- Debugging connection issues.
With ASI Biont, you describe your setup in natural language, and the AI generates, tests, and runs the integration code — often in under 10 seconds. You don’t need to wait for platform updates or learn every protocol. Just connect.
Conclusion
Sensor fusion with on-device ML is the backbone of Industry 4.0 predictive maintenance. By connecting your Edge AI hardware to ASI Biont via MQTT, SSH, or COM port, you unlock real-time anomaly detection, automated alerts, and data logging — all through conversational AI. No coding required beyond describing your needs.
Ready to integrate your sensor fusion system? Visit asibiont.com and start chatting with the AI agent. Just tell it what device you have and what you want to automate — it handles the rest.
Comments