Raspberry Pi Pico W + ASI Biont: From Zero to Smart Home in One Chat Session
1. Introduction
The Raspberry Pi Pico W is a $6 microcontroller that packs Wi-Fi into the Pico family. It's perfect for IoT projects, but the real challenge is making it talk to the cloud and your daily tools. Most developers spend hours writing firmware, setting up MQTT brokers, building dashboards, and wiring alert logic. What if an AI agent did all of that for you in a single chat session? That's exactly what ASI Biont offers. In this practical guide, I'll show you how to integrate a Pico W with ASI Biont, step by step, with real code, wiring diagrams, and the mistakes I made along the way.
2. Why Pico W and Why an AI Agent?
The Pico W uses the RP2040 chip: dual-core ARM Cortex-M0+ at 133 MHz, 264 KB SRAM, and 2 MB flash. It runs MicroPython, C/C++, and Arduino. For IoT tasks, its main draws are low cost, low power, and built-in 2.4 GHz Wi-Fi. But it's not just the hardware — it's how quickly you can turn an idea into a working system. With ASI Biont, you don't need to write a single line of integration code. You describe your goal, and the AI agent writes the MicroPython firmware, configures the MQTT connection, and sets up Telegram alerts. By 2026, industry observers agree that the number of connected devices will keep rising sharply, and tools like ASI Biont make it possible for hobbyists and professionals to keep up without becoming protocol experts.
3. How ASI Biont Talks to Your Pico W
ASI Biont is not another dashboard with a "Add Device" button. It's an AI agent that connects through chat. It supports many industrial protocols out of the box: MQTT (paho-mqtt), Modbus/TCP (pymodbus), HTTP API/WebSocket (aiohttp), OPC-UA (opcua-asyncio), SSH (paramiko), serial via Hardware Bridge, and more. For the Pico W, I recommend MQTT over Wi-Fi. MQTT is lightweight, asynchronous, and the MicroPython umqtt.simple library is built in. ASI Biont subscribes to the same broker, so you get a clean channel between the device and the AI. In the chat, you simply say: "Connect to my MQTT broker at 192.168.1.50 and subscribe to home/pico/w." ASI Biont does the rest.
4. Hardware Setup and Wiring
For this guide, I used:
- Raspberry Pi Pico W (the one with Wi-Fi, not the original Pico)
- DHT22 temperature/humidity sensor
- Relay module (for the light control example)
- Breadboard and jumper wires
- USB cable with data pins (not just charging)
Wiring DHT22 to Pico W: Connect the DHT22 data pin to GPIO15, VCC to 3.3V pin, and GND to GND. A 10kΩ pull-up resistor between VCC and data is recommended but often not required for short wires.
Before flashing code, install MicroPython on your Pico W. Hold the BOOTSEL button, plug in the USB, and drag the latest MicroPython .uf2 file (from the official Raspberry Pi Pico documentation) onto the mounted drive. Then open Thonny and select the MicroPython interpreter.
5. Use Case 1: Temperature Monitoring + Telegram Alerts
This is the classic "my greenhouse is too hot" scenario. The Pico W reads a DHT22 every 10 seconds and publishes JSON to the MQTT topic home/pico/w. ASI Biont listens to that topic and triggers a Telegram message when the temperature exceeds 30°C.
MicroPython firmware on Pico W (main.py):
from machine import Pin
import dht, time, network
from umqtt.simple import MQTTClient
SSID = "YOUR_WIFI"
PASSWORD = "YOUR_WIFI_PASSWORD"
BROKER = "192.168.1.50"
CLIENT_ID = "pico_w_dht22"
dht22 = dht.DHT22(Pin(15))
# Connect to Wi-Fi
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(SSID, PASSWORD)
while not wlan.isconnected():
time.sleep(0.5)
print("Wi-Fi connected")
# MQTT client
client = MQTTClient(CLIENT_ID, BROKER)
client.connect()
while True:
dht22.measure()
temp = dht22.temperature()
hum = dht22.humidity()
payload = '{{"temperature": {}, "humidity": {}}}'.format(temp, hum)
client.publish("home/pico/w", payload)
time.sleep(10)
Now the magic: Open ASI Biont chat and type:
"Subscribe to MQTT topic home/pico/w. If temperature > 30°C, send me a Telegram message."
ASI Biont creates an MQTT connector and a rule. The generated alert code looks like this (you don't write it; it's for reference):
import requests
import paho.mqtt.client as mqtt
def on_message(client, userdata, msg):
import json
data = json.loads(msg.payload)
if data['temperature'] > 30:
requests.post(
f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage",
data={"chat_id": CHAT_ID, "text": "🔥 Pico reports temp: {}°C!".format(data['temperature'])}
)
mqtt_client = mqtt.Client()
# ... ASI Biont handles the connection and rule in the background
Within minutes, you'll get a Telegram alert every time your room crosses 30°C. No webhook, no API gateway, no manual coding.
6. Use Case 2: Controlling a Light from Chat
Now let's flip the direction — from the cloud to the Pico. Connect a relay module to GPIO18 and power it with 5V. The Pico subscribes to an MQTT topic and switches the relay based on messages.
MicroPython code for the Pico W:
from machine import Pin
import network, time
from umqtt.simple import MQTTClient
relay = Pin(18, Pin.OUT)
relay.value(0)
# Wi-Fi setup as before...
client = MQTTClient("pico_light", "192.168.1.50")
client.connect()
def on_message(topic, msg):
if msg.decode() == "ON":
relay.value(1)
elif msg.decode() == "OFF":
relay.value(0)
client.set_callback(on_message)
client.subscribe("home/pico/light")
while True:
client.check_msg()
time.sleep(0.1)
Then tell ASI Biont in chat:
"When I say 'turn on the light', publish ON to home/pico/light."
ASI Biont links your chat message to an MQTT publish. You can even set conditions: "Only turn it on after sunset." The AI writes the logic for you. This turns your Pico W into a voice-controllable smart switch using only Telegram (or the chat itself).
7. Use Case 3: USB Serial via Hardware Bridge
What if your Pico W is tethered to a PC via USB? ASI Biont can talk to it directly over the COM port using the Hardware Bridge. Download bridge.py from the ASI Biont dashboard (never from random GitHub repos — the token is secret). Launch it:
python bridge.py --token=YOUR_TOKEN --ports=COM3 --baud 115200 --rate=10
The bridge exposes industrial_command() to ASI Biont's AI sandbox. For a Pico that listens for serial commands, you could ask:
"Send 'READ_TEMP' to the Pico on COM3 and tell me the response."
ASI Biont generates:
result = industrial_command(protocol='serial', command='READ_TEMP', port='COM3')
print(result)
Important: The bridge has no HTTP API — you must use industrial_command(). Also, inside ASI Biont's execute_python sandbox, scripts can't run while True (there's a 30-second timeout). So use the bridge's built-in polling rate (--rate=10) instead of inventing loops.
8. Pico W vs ESP32: Performance and Pitfalls
| Feature | Raspberry Pi Pico W | ESP32 |
|---|---|---|
| CPU | Dual-core Cortex-M0+ @ 133 MHz | Dual-core Xtensa @ 240 MHz |
| SRAM | 264 KB | 520 KB |
| Wi-Fi | 802.11n (2.4 GHz) | 802.11n (2.4 GHz) |
| ADC | 3 (12-bit) | 18 (12-bit) |
| Price | ~$6 | ~$4-7 |
| MicroPython | Excellent | Excellent |
The ESP32 is faster and has more memory, but the Pico W's simplicity and low power are big wins. For MQTT polling every 10 seconds, both are overkill. However, beware of these pitfalls:
- DHT22 timing: In MicroPython, always call
dht22.measure()before accessingtemperature()orhumidity(). Forgetting this givesUnboundLocalError. - Wi-Fi reconnect: A bare
while not wlan.isconnected()hangs forever if your router drops. Add a timeout and reconnect logic. - MQTT QoS: The
umqtt.simpleclient supports only QoS 0. If you need reliability, add your own acknowledgment or use a different library. - Telegram rate limits: Sending a message every second will get you throttled. Add a 60-second cooldown in your alert rule.
- Power supply: The Pico W's Wi-Fi can draw peak currents. Use a stable 5V supply, not a random phone charger with flimsy cables.
9. execute_python: Universal Connector for Anything
The best part of ASI Biont is execute_python. If you have a device that speaks a weird proprietary protocol, you don't have to wait for developers to add a integration. Just describe the connection parameters in chat — IP, port, baud rate, register addresses, API keys — and the AI writes a Python script using pyserial, paramiko, paho-mqtt, pymodbus, aiohttp, or opcua-asyncio. The script runs in a sandbox, interacts with your device, and returns results to the chat. I've used it to talk to a Pico W running custom UART commands, a legacy industrial sensor with Modbus RTU, and even a GPS tracker with a TCP socket. The workflow is always the same:
- Tell ASI Biont what device you have and how to reach it.
- Describe what you want to read or control.
- The AI generates and runs the Python code immediately.
- If the result looks wrong, iterate in chat: "Change the baud rate to 9600" or "Use big-endian byte order."
This means there is no device too obscure. Pico W, ESP32, Arduino, industrial PLCs, or anything with a network or serial port — ASI Biont connects to it.
10. Step-by-Step Chat Walkthrough
Here's a real conversation I had with ASI Biont to set up my Pico W monitor:
- Me: "I have a Raspberry Pi Pico W with a DHT22 on GPIO15. It's running MicroPython and publishing MQTT to 192.168.1.50, topic home/pico/w. Can you monitor it?"
- ASI Biont: "Sure. I'll subscribe to home/pico/w. What should trigger an alert?"
- Me: "If temperature goes above 30°C, send a Telegram message to my chat."
- ASI Biont: "Done. I've created the MQTT connection and a Telegram alert rule. I'll also log the readings in the chat. Do you want a cooldown period?"
- Me: "Yes, 10 minutes."
- ASI Biont: "Updated. I'll send at most one alert every 600 seconds."
That's it. No web UI, no YAML config, no port forwarding. The entire integration was two messages.
11. Sources and Further Reading
- Raspberry Pi Pico W official documentation: https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html
- MicroPython
umqtt.simplelibrary reference: https://docs.micropython.org/en/latest/library/umqtt.simple.html paho-mqttPython client on PyPI: https://pypi.org/project/paho-mqtt/- ASI Biont official website: https://asibiont.com
12. Conclusion
Integrating a Raspberry Pi Pico W with ASI Biont turns a good microcontroller into a smart, conversational IoT system. You can monitor sensors, control relays, and receive alerts without writing a single integration framework yourself. The AI agent does the heavy lifting — generating firmware, configuring MQTT, and even handling quirky protocols via execute_python. By 2026, with millions of new IoT devices coming online, tools like this are more than a convenience; they're a necessity. Stop fighting device ecosystems and try ASI Biont today at asibiont.com. Your Pico W will thank you.
Comments