This $5 Chip Can Run A Full OpenClaw AI Agent (zclaw)

BBetter Stack
컴퓨터/소프트웨어가전제품/카메라AI/미래기술

Transcript

00:00:00Can you tell me what is the meaning of life and display it on screen? Let's go.
00:00:0342. Oh my god. Zclaw says the meaning of life is 42. I knew it. I knew it, guys.
00:00:15Ever since the explosion of OpenClaw, the internet has been flooded with all sorts of
00:00:21lobster-themed AI agents. PicoClaw, NanoClaw, IronClaw, ZeroClaw, TrustClaw, and even Nanobot.
00:00:29Okay, that last one is not really a lobster, but you get the point. And amongst all of these claws,
00:00:34I think I've stumbled upon the smallest one of them all. It's called ZClaw. It's an OpenClaw
00:00:39equivalent specifically made for microcontrollers like the ESP32. And it's incredibly tiny. The
00:00:46entire firmware budget is just 888 kilobytes. But despite that, it offers the same agentic AI
00:00:53features as its bigger brothers, but it runs on a $5 chip instead of an $800 Mac Mini. In this video,
00:01:01we're gonna take a look at what ZClaw is capable of, how to install it on your own hardware,
00:01:06and then we'll test it out with a fun little demo. It's gonna be a lot of fun, so let's dive into it.
00:01:11So ZClaw advertises itself as the smallest possible AI assistant for ESP32 microcontrollers with an
00:01:23all-in firmware budget of just 888 kilobytes. It's built on top of the ESP-IDF development framework
00:01:31and it ships with a ready-to-use networking stack that supports Wi-Fi along with the TLS
00:01:36and crypto stack and a certificate bundle with app metadata. This allows the tiny ESP32 to talk
00:01:43directly and securely to HTTPS endpoints like chatting with your AI model through a telegram
00:01:49chat without exposing your keys to an unencrypted middleman. And since it's built on the ESP-IDF
00:01:55framework, you can add additional drivers for your IoT sensors or custom firmware plugins to augment
00:02:02your assistance capabilities. I even managed to successfully pair it with my circular TFT display
00:02:08for the demo you will see later in this video. But what is the actual use case for this tool? Well,
00:02:13first of all, ZClaw has full access to your microcontroller, so you can use it for reading GPIO
00:02:19and sensor pins, monitoring health checks, and you can also ask it to do scheduled tasks like setting
00:02:25a blinking LED status reminder, whenever it's time to water the plants, or like scheduling a recurring
00:02:32equipment check for your system. And all of this is done by chatting with your AI agents through
00:02:37a messaging app like Telegram, where the ESP32 acts as a client, the LLM processes your prompts
00:02:43on the cloud using your chosen AI provider, and the logic execution happens locally on the chip.
00:02:50And since the ESP32 has a limited NVS or non-volatile storage, you can type something like,
00:02:56remember that GPIO4 is my door sensor, and from that point on, ZClaw will store these mappings
00:03:02in the local storage, and it will know to trigger the specific GPIO pin when talking about door
00:03:09sensors. So all that sounds cool in theory, but now I want to try it for myself on my own little
00:03:14ESP32-C3 microcontroller and see how it performs. First of all, let's flash ZClaw onto the controller
00:03:22itself. So let's connect the controller to our laptop via USB-C, and then let's clone the ZClaw
00:03:28repo. From here, we just need to run the install script, and the setup is pretty straightforward.
00:03:34It will first ask you to build the firmware, and if this is your first time running the build,
00:03:39it might take a minute or two to finish. Next, we need to flash it onto our ESP32
00:03:44by running the flash script. And finally, we have to provision it by running the provision script.
00:03:50And here in the provision step, it will ask you for your Wi-Fi SSID you want to connect to,
00:03:55then it will ask you to choose an AI provider. It can either be OpenAI, Anthropic, OpenRouter,
00:04:01or Ollama. In my case, I will choose OpenRouter. Next, you will need to input your API key as well
00:04:07as your Wi-Fi password. And at this point, it might say that it has some issues connecting to the
00:04:12network, but don't worry about that. It might still go through when we run it, so just type Y to
00:04:18proceed. And now it will ask you for your Telegram access token. And in order to get this, you have
00:04:24to message the BotFather on Telegram to create a new bot for you. Once you go through that process,
00:04:30BotFather will supply you with an access token for your specific bot. And that's the one you have to
00:04:35paste in here. And then it will ask you for your user IDs that are allowed to chat with this bot.
00:04:41And here you need to specify your own ID. But in order to get that, you need to send a message to
00:04:47UserInfoBot, and it will give you back the user ID on the Telegram app. Once you input all of that,
00:04:53your Zclaw should be installed and ready to run. We can then execute the monitor script to activate
00:04:59it and see the logs coming in from Zclaw in real time. So now comes the fun part. Let's test the
00:05:05actual hardware. So I was planning to do this demo on a normal breadboard setup. I even soldered the
00:05:11header pins on my chip for this purpose. But then I noticed that for some reason, when running the chip
00:05:17attached to the board, it could not reliably hold a stable Wi-Fi connection. Possibly because the
00:05:23metal rails on the breadboard interfere with the Wi-Fi signal. You have no idea how long it took me
00:05:28to realize this issue. But anyway, so instead, I had to hook up my chip to these special pin clamps
00:05:34that let me wire them up to the breadboard externally. And for some weird reason, this
00:05:40setup worked perfectly. There were no connection issues and the chip could hold a reliable Wi-Fi
00:05:45connection this way. So next, I set up a simple circuit. I've got the 3.3 volt rail powered up
00:05:51and the single LED acting as our status indicator. The anode is tied to GPIO3, which the Zclaw agent
00:05:58will toggle as a digital output. And on the other side, I've got a simple 220 ohm resistor hooked up
00:06:05in the ground rail to keep the current in check, so we don't blow out our diode. This is your simple
00:06:11hello world setup for embedded hardware tests. And now comes the exciting part. I can now ask Zclaw
00:06:18to activate this diode by chatting with it through Telegram. So with this setup now I can tell Zclaw
00:06:24that this diode connected to the GPIO2 pin is a light. So I can say treat GPIO as the main light.
00:06:34And you can see the GPIO2 is now saved as the main light. And it will remember this for future
00:06:42commands. So now I can ask it turn on the main light. And as I do this now, the main light is
00:06:51now turned on and flashing. So after a few minutes of chatting with Zclaw, you soon realize that its
00:06:58capabilities are quite limited. And that's because if we look at the code, it only has a limited
00:07:03amount of tools at its disposal. It can perform read writes on GPIOs. It can handle basic memory storage
00:07:11operations, address you in a specific persona. And that's basically it. But that doesn't mean we can't
00:07:17add our own tools, right? So for the next demo, I decided to do something more interesting. So I
00:07:23have a GC9A01240x240 TFT display here. And I want to hook it up to Zclaw and make sure it can display
00:07:32any text that I prompt on the screen. So for this purpose, I modified the code a bit. I added a new
00:07:38tool call in the tool C file that lets me prompt a specific text to display. And I can also specify
00:07:44what color I want the text to be. Next, I asked Claude code to vibe code the display function for
00:07:50me in a separate C file. And lastly, I added it to the tools handlers header file. And I also needed
00:07:56to add the specific driver for my GC9A01 display as a dependency for the ESP IDF project. And with
00:08:05those changes, I recompiled the project, reflashed it and reprovisioned it again. So now I've augmented
00:08:12the original Zclaw project with my own custom tool. So let's see if we can get it to draw some text
00:08:18on my display. So for the second demo, the wiring is a bit more complicated. But basically, this is
00:08:24just a standard way of hooking up an external device to your microcontroller. I'm not going to go over
00:08:29the whole wiring setup in detail. But if you're interested, you can pause this video here and take
00:08:34a note of the wiring diagram if you want to replicate it on your own. So I have my ESP 32
00:08:41right over here. It's hooked up to my display here. And now I have the telegram chat open with the Z
00:08:48claw bot. And now I can, for example, ask the bot to display text saying hello world. Let's see what
00:08:58that does. Oh, look at that. It instantly displays hello world on our display. Can you display on the
00:09:09screen how you are feeling today? I'm not capable of feelings like humans, but I'm here and ready
00:09:17to assist with whatever you need. See, the bot says subscribe. So I think you should really listen to
00:09:24Z claw on this one. Let's do a hard one now. Can you tell me what is the meaning of life and display
00:09:29it on screen? Let's go. 42 Oh my god. Z claw says the meaning of life is 42. I knew it. I knew it,
00:09:42guys. So there you have it. That is Z claw in a nutshell. I feel like it's a very fun little AI
00:09:47project to play around with. But for real production builds, I don't really see the point of conducting
00:09:53this agent communication via a messaging app, when in fact, you could probably do all of it more
00:09:59efficiently through a custom built web API interface. But it's a cool novelty concept,
00:10:04nonetheless. Now, what would be impressive, though, is if I could prompt Z claw to write custom code
00:10:11via the messaging app, and then it would immediately compile and execute that newly written code on the
00:10:17controller on the fly. Now that would be something special. If you can figure out how to do that,
00:10:22let me know in the comments down below. And folks, we don't do hardware tutorials on this channel
00:10:27very often. But if you like this one, and you would like to see more hardware topics explored
00:10:33in the future, please let me know by clicking that like button underneath the video. This has
00:10:38been Andris from Betterstack and I will see you in the next videos.

Key Takeaway

ZClaw enables sophisticated, agentic AI control of low-cost ESP32 microcontrollers through a secure Telegram interface, bridging the gap between cloud LLMs and embedded hardware.

Highlights

ZClaw is an ultra-lightweight AI agent framework designed for ESP32 microcontrollers with a tiny 888 KB firmware budget.

The system uses the ESP-IDF framework to handle secure HTTPS communication, allowing direct interaction with AI providers like OpenAI and Anthropic.

Users can interact with their hardware through a Telegram bot, enabling remote GPIO control and sensor monitoring via natural language.

ZClaw supports non-volatile storage (NVS) to remember custom pin mappings and user-defined device names for persistent automation.

The project is highly extensible, allowing developers to add custom C-based tools and drivers for peripherals like TFT displays.

The hardware costs significantly less than traditional AI hosts, running on a $5 chip rather than expensive desktop hardware.

Timeline

Introduction to the ZClaw Ecosystem

The speaker introduces ZClaw as the smallest entry in the 'OpenClaw' family of lobster-themed AI agents. While other agents require high-end hardware, ZClaw is specifically optimized for $5 microcontrollers like the ESP32. It operates within a strict 888 kilobyte firmware budget while maintaining the agentic features of its larger counterparts. The section highlights the shift from using expensive Mac Minis to accessible embedded chips for AI tasks. This sets the stage for a demonstration of how tiny hardware can process complex human prompts.

Technical Architecture and Security

The technical foundation of ZClaw is built upon the ESP-IDF development framework, which provides a robust networking stack. It includes integrated support for Wi-Fi, TLS encryption, and a certificate bundle to ensure secure communication with HTTPS endpoints. This architecture allows the ESP32 to communicate directly with AI models without needing an unencrypted middleman that might expose API keys. The speaker emphasizes the importance of the crypto stack for maintaining privacy in IoT applications. Additionally, the framework's modularity allows for the integration of custom drivers and plugins for various sensors.

Use Cases and Local Logic Execution

This segment explores practical applications for ZClaw, such as reading GPIO pins, monitoring system health, and scheduling recurring tasks. The AI agent functions by receiving prompts through Telegram, processing them in the cloud, and executing the resulting logic locally on the chip. A key feature mentioned is the use of non-volatile storage (NVS) to create persistent mappings, such as naming a specific pin as a 'door sensor.' This allows the user to interact with hardware using natural language terms rather than technical pin numbers. The section illustrates how the chip acts as an intelligent client within a larger messaging ecosystem.

Installation and Provisioning Workflow

The speaker walks through the step-by-step process of flashing the ZClaw firmware onto an ESP32-C3 controller via USB-C. The setup involves cloning a repository, running a build script, and then proceeding to a detailed provisioning phase. During provisioning, the user configures Wi-Fi credentials, selects an AI provider like OpenRouter or Ollama, and inputs API keys. The process also requires setting up a Telegram bot via 'BotFather' to obtain an access token and identifying specific user IDs for security. This walkthrough provides a comprehensive guide for developers looking to replicate the project on their own hardware.

Hardware Demo: GPIO Control and Troubleshooting

In the first live demonstration, the speaker encounters and solves a common hardware issue involving Wi-Fi interference caused by breadboard metal rails. After switching to external pin clamps, a stable connection is established for a basic 'Hello World' circuit featuring an LED and a 220-ohm resistor. The agent is successfully commanded via Telegram to treat a specific GPIO pin as the 'main light.' Once the mapping is saved, the speaker demonstrates turning the light on and off using simple text commands. This section confirms the functional reliability of the agent's core GPIO manipulation capabilities.

Custom Tooling: Adding a TFT Display

The speaker acknowledges the inherent limitations of the stock ZClaw firmware and demonstrates how to extend it by adding custom C-based tools. He integrates a GC9A01 circular TFT display by modifying the tool C files and adding new header handlers. The update involves writing specific display functions and including the necessary driver dependencies within the ESP-IDF project. After recompiling and reflashing, the agent gains the ability to output visual text and colors to the screen. This highlight showcases the 'vibe coding' approach to rapidly augmenting the AI agent's physical capabilities.

Final Testing and Future Outlook

The final demonstration shows the ZClaw agent successfully displaying 'Hello World' and answering philosophical questions like the meaning of life on the TFT screen. The speaker notes that while the Telegram interface is a fun novelty, a custom web API might be more efficient for serious production environments. He poses a future challenge of enabling the agent to write and execute its own C-code on the fly through messaging. The video concludes with a request for user feedback on more hardware-focused AI content. It leaves the viewer with a clear sense of the potential for ultra-low-cost AI edge devices.

Community Posts

View all posts