Arduino Due + ASI Biont: AI-Driven Integration for Microcontrollers and Telemetry

Introduction

Arduino Due is not your typical Arduino: it runs a 32-bit ARM Cortex-M3 at 84 MHz, has 54 digital I/O pins, 12 analog inputs, and a native USB port. It's a favorite for complex automation, data acquisition, and prototyping. But once you've built your device, you still need a way to monitor it, control it, and integrate it with other systems. That's where ASI Biont comes in — an AI agent that connects to your hardware through chat. Instead of building a custom dashboard, you simply describe what you want, and the AI writes the integration code, handles the protocol, and starts streaming data. In this article, we'll show you how to pair an Arduino Due with ASI Biont, examine the connection options, and walk through a real-world temperature monitoring example.

Why Connect Arduino Due to an AI Agent?

Microcontrollers generate a lot of data: sensor readings, GPIO states, error codes. The problem is getting that data to a place where it can be used. Traditional approaches require writing firmware, server code, and frontend code. With ASI Biont, the AI agent acts as the middleware. It can read your sensor, evaluate the data, send alerts to Telegram or Slack, and even control actuators based on natural language commands. This is especially useful for remote labs, greenhouses, and smart factory prototypes where you need fast iteration without learning cloud IoT stacks.

Connection Methods: Which One Works for Arduino Due?

ASI Biont supports many industrial protocols, but for Arduino Due, the most practical choices are:

  1. Serial over USB (COM port) via Hardware Bridge — the simplest, works out of the box.
  2. MQTT over Ethernet/WiFi (with a shield or native Ethernet) — good for longer distances and cloud integration.
  3. Modbus/TCP if you have a shield and need interoperability with SCADA.
  4. Universal execute_python — you can run any Python code (using pyserial, paho-mqtt, etc.) directly in the ASI Biont sandbox, no need to wait for a built-in integration.

Let's compare them quickly.

Method Hardware Needed Latency Best For
Hardware Bridge (Serial) USB cable only Low Local monitoring, quick start
MQTT Ethernet/WiFi shield Medium Remote telemetry, multi-device
Modbus/TCP Ethernet shield Low Industrial systems
execute_python Any Depends on script Custom one-off integrations, prototyping

The fastest route is the Hardware Bridge. You download bridge.py from the ASI Biont dashboard (you won't find it on GitHub; it's generated per user), then run it with your token and the serial port:

python bridge.py --token=YOUR_TOKEN --ports=COM3 --baud=115200 --rate=10

This opens a transparent serial connection, allowing the AI to send commands and receive data. In the chat, you just say: "Use COM3, baud 115200, and read the temperature every 10 seconds." The AI will respond with a call to industrial_command(protocol='serial', command='...').

Practical Example: Temperature Monitoring and Telegram Alerts

Let's build a complete example. On the Arduino Due side, we'll use a DS18B20 temperature sensor on GPIO 2. The sketch below reads the sensor and sends the value as a JSON string over serial whenever it receives a '?' character:

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup() {
  Serial.begin(115200);
  sensors.begin();
}

void loop() {
  if (Serial.available() > 0) {
    char c = Serial.read();
    if (c == '?') {
      sensors.requestTemperatures();
      float temp = sensors.getTempCByIndex(0);
      Serial.print("{\"temp\":");
      Serial.print(temp, 2);
      Serial.println("}");
    }
  }
}

Now, in ASI Biont chat, you tell the AI: "I have an Arduino Due on COM3 running this sketch. Read the temperature and if it exceeds 28°C, send me a Telegram message." The AI will configure the bridge and then repeatedly call industrial_command with something like:

industrial_command(
    protocol='serial',
    command='?',
    params={'port': 'COM3', 'baud': 115200}
)

It parses the JSON response and takes action. The Telegram notification uses a direct requests.post to api.telegram.org (no custom functions needed). Here's the logic the AI generates (truncated for readability):

import requests

temp = read_from_serial()  # via industrial_command
if temp > 28.0:
    requests.post(
        f"https://api.telegram.org/bot{TOKEN}/sendMessage",
        json={"chat_id": CHAT_ID, "text": f"⚠️ Temp is {temp:.2f}°C"}
    )

Of course, the actual generated code will be more robust — it includes error handling and checks that the bridge is running.

What If You Need a Custom Protocol?

Suppose your Arduino Due is behind a firewall or you're using a different sensor that requires a more complex handshake. That's when execute_python shines. You don't need to ask ASI Biont to add a new integration; the AI writes a Python script on the fly using pyserial or paho-mqtt and executes it in the sandbox. For example, you might say: "Write a script that connects to my Arduino over TCP port 9999, sends a Modbus request, and returns the register values." The AI will produce a self-contained script that reads the data and formats the response. Just be aware that execute_python has a 30-second execution limit, so it's not for infinite loops — use the Hardware Bridge or MQTT for continuous streaming.

Why This Approach Is a Game-Changer

The most powerful part is that ASI Biont doesn't have a pre-made "Arduino Due card" in a dashboard. Instead, it uses a universal execute_python capability: you describe the device and its protocol in natural language, and the AI writes the integration code for you. You don't have to wait for a vendor to support your particular sensor or shield; the AI can handle almost anything that works over serial, TCP, MQTT, Modbus, OPC-UA, CAN, etc. This cuts integration time from days to minutes.

I've used this with a prototype environmental station based on Arduino Due. Instead of writing a Java backend, I just told the AI to read the sensors and post to a webhook. It took about 10 minutes to get everything running, and the debugging was done through conversation.

Potential Pitfalls to Avoid

  • Baud rate mismatch — make sure the Arduino Serial baud and the --baud in bridge.py match. Otherwise you'll get garbage data.
  • Bridge rate — the --rate=10 parameter defines how often the bridge polls the serial port for new data. If you're sending continuous telemetry, set it higher.
  • Timeout — don't use while True in execute_python; it's designed for short, single-shot tasks. For long-running monitoring, use the Hardware Bridge or MQTT.
  • Power supply — Arduino Due runs at 3.3V. Use a proper regulator and avoid powering servos from the 5V pin.

Conclusion

Arduino Due is a serious microcontroller, and with ASI Biont it becomes part of a conversational IoT ecosystem. Whether you use the Hardware Bridge for direct serial access or let the AI write a custom Python integration, you get full control through a chat window. No dashboards, no web servers, just you and your device. Head over to asibiont.com and try the integration with your own Arduino Due. Describe what you want, and watch the AI do the rest.

← All posts

Comments