Skip to content

Commit 094b01d

Browse files
committed
Submit projects
1 parent 612f1f4 commit 094b01d

6 files changed

Lines changed: 214 additions & 0 deletions
53.6 KB
Binary file not shown.

public/202606/claude-pocket_0.avif

75 KB
Binary file not shown.
39.5 KB
Binary file not shown.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Claude Pocket
3+
summary: Claude Pocket is a voice-activated AI assistant firmware for the M5Stack
4+
Cardputer ADV, powered by Anthropic's Claude and OpenAI's Whisper and TTS APIs.
5+
It features a custom C++ implementation that handles voice activity detection, streaming
6+
transcription, and real-time audio playback on hardware without external PSRAM.
7+
slug: claude-pocket
8+
codeUrl: https://github.com/Nachtfux/claude-pocket
9+
version: v0.2.0
10+
lastUpdated: '2026-05-27'
11+
licenses:
12+
- MIT
13+
image: /202606/claude-pocket_0.avif
14+
rtos: freertos
15+
libraries:
16+
- littlefs
17+
- platformio-platformio-core
18+
topics:
19+
- anthropic-api
20+
- arduino
21+
- cardputer
22+
- claude
23+
- embedded
24+
- esp32
25+
- m5stack
26+
- openai-tts
27+
- openai-whisper
28+
- voice-assistant
29+
isShow: true
30+
createdAt: '2026-06-18T08:45:45+00:00'
31+
updatedAt: '2026-06-18T08:45:45+00:00'
32+
---
33+
34+
## Overview
35+
36+
Claude Pocket is a portable, voice-first interface for Anthropic's Claude AI, specifically designed for the M5Stack Cardputer ADV. Originally conceived during the "Code with Claude" event in London, this project transforms a compact, keyboard-equipped microcontroller into a fully functional voice assistant. By pressing a single button, users can speak to the device, which then transcribes the audio, generates a response using Claude 3.5 Sonnet, and speaks back using high-quality text-to-speech.
37+
38+
The project is notable for its direct integration with APIs, bypassing the need for cloud middleware. It communicates straight from the device to Anthropic and OpenAI endpoints, making it a powerful example of what can be achieved on modern ESP32-S3 hardware when memory and network constraints are handled with precision.
39+
40+
## Hardware and Architecture
41+
42+
The primary target for Claude Pocket is the M5Stack Cardputer ADV, which utilizes the StampS3A module (ESP32-S3). The hardware suite includes:
43+
44+
* **Display**: 1.14" ST7789V2 LCD
45+
* **Audio**: ES8311 codec, NS4150 amplifier, and a 1 W speaker
46+
* **Input**: Onboard MEMS microphone and a full TCA8418-driven keyboard
47+
* **Power**: 1750 mAh battery
48+
49+
The user interface is themed with Anthropic’s brand palette, featuring an "Ivory" background and a signature orange "spark" animation that indicates the assistant's state, such as understanding, thinking, or speaking.
50+
51+
## Engineering for Limited Memory
52+
53+
One of the most significant technical achievements of Claude Pocket is its ability to function on the StampS3A, which lacks PSRAM. After the Wi-Fi stack, mbedTLS, and graphics libraries are initialized, the device is left with approximately 90 KB of heap memory. This is insufficient for traditional in-memory audio buffering of high-quality speech.
54+
55+
To overcome this, the developer implemented a flash-based buffering system using LittleFS. Microphone samples are written directly to a file on the internal flash memory (`/rec.pcm`) during recording. When the recording is complete, the file is streamed to the Whisper API in 1 KB chunks. Similarly, the Text-to-Speech (TTS) response is fully downloaded to flash before playback begins. This decoupling ensures that network jitter or TLS record gaps do not cause audio underruns or system crashes.
56+
57+
## Key Features
58+
59+
Beyond the core voice assistant, the firmware includes a variety of specialized applications:
60+
61+
* **Claude Pocket Assistant**: The main voice interface featuring a 10-message conversation history and Voice Activity Detection (VAD) that automatically stops recording when the user finishes speaking.
62+
* **Orbit Fighter**: A unique, Claude-themed side-scrolling shooter. Players battle through biomes like "STAGING" and "PROD" while fighting bosses named REGEX_TYRANT and CONTEXT_OVERFLOW.
63+
* **Voice-to-Voice Translator**: A dedicated mode that uses Claude to translate speech between languages (defaulting to German and English), utilizing specific system prompts to ensure concise translation output.
64+
* **Internet Radio**: Streams HTTP/HTTPS radio stations using the libhelix-mp3 and libhelix-aac libraries, demonstrating the device's capability as a general-purpose media player.
65+
* **Weather and Utilities**: Includes an IP-based geolocation weather app and a comprehensive settings menu for Wi-Fi roaming, volume control, and system diagnostics.
66+
67+
## Implementation Details
68+
69+
The conversation logic is built around the `claude-sonnet-4-6` model. To maintain context, the assistant stores a small JSON-based history array. Each turn in the conversation is appended to this array, allowing for follow-up questions that rely on previous context. To prevent memory exhaustion and runaway API costs, the system enforces a 30-second cap on both recording and spoken responses.
70+
71+
Audio playback is managed through a sophisticated buffer pool. Since the `M5.Speaker.playRaw` function uses pointers to sample data rather than making copies, the project utilizes 16 rotating memory slabs. This allows the system to prepare new audio data while the speaker is still draining previous slabs, eliminating the audible doubling or echoing effects often found in simpler implementations.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: ESP32 RTSP Microphone for BirdNET
3+
summary: A high-performance network microphone firmware for Seeed Studio XIAO ESP32
4+
boards that streams 16-bit PCM audio via RTSP. It is designed for integration with
5+
BirdNET-Go and BirdNET-Pi for automated bird sound identification and includes a
6+
Web UI, MQTT telemetry, and OTA support.
7+
slug: esp32-rtsp-microphone-for-birdnet
8+
codeUrl: https://github.com/Sukecz/esp32-birdnet-mic
9+
siteUrl: https://esp32mic.msmeteo.cz/
10+
version: v1.10.0
11+
lastUpdated: '2026-06-11'
12+
licenses:
13+
- MIT
14+
image: /202606/esp32-birdnet-mic_0.avif
15+
rtos: freertos
16+
libraries:
17+
- lwip
18+
topics:
19+
- audio
20+
- audio-streaming
21+
- bird-net
22+
- birdnet
23+
- birdnet-go
24+
- birdnet-pi
25+
- birdnetgo
26+
- birdnetpi
27+
- esp32
28+
- esp32c3
29+
- esp32c6
30+
- esp32s3
31+
- esp35c5
32+
- ics43434
33+
- mic
34+
- rtsp
35+
- rtsp-stream
36+
- streammic
37+
- xiao
38+
- xiaoc6
39+
isShow: true
40+
createdAt: '2026-06-18T08:46:32+00:00'
41+
updatedAt: '2026-06-18T08:46:32+00:00'
42+
---
43+
44+
## High-Quality Audio Streaming for Wildlife Monitoring
45+
46+
The `esp32-birdnet-mic` project is a specialized firmware designed to turn Seeed Studio XIAO ESP32 modules into high-performance network microphones. Primarily targeted at users of BirdNET-Go and BirdNET-Pi, this project simplifies the process of capturing and streaming ambient bird sounds for automated identification. By utilizing I2S MEMS microphones, the system provides 16-bit PCM/L16 mono audio, ensuring the clarity required for complex acoustic analysis.
47+
48+
## Advanced Audio Processing and Streaming
49+
50+
At its core, the firmware implements a robust audio pipeline. It uses a dedicated audio producer task that captures data from the I2S interface and passes it through a ring buffer to the RTSP packet output. This architecture, built on FreeRTOS, prevents audio drops and ensures a stable stream even when the network experiences minor fluctuations.
51+
52+
Users can configure two independent RTSP streams, which is particularly useful for feeding different analysis engines or monitoring tools simultaneously. The firmware supports both TCP and UDP transports, allowing it to adapt to the specific requirements of the target software—TCP for BirdNET-Go and UDP for BirdNET-Pi.
53+
54+
## Hardware Compatibility and Optimization
55+
56+
The project is optimized for the Seeed Studio XIAO ESP32 family, including the C3, S3, C5, and C6 variants. While the XIAO ESP32-C6 is the primary reference platform, the firmware includes runtime hardware validation to support the unique pinouts and RF configurations of other models.
57+
58+
A notable feature for the XIAO ESP32-C6 is the automatic management of the external antenna RF switch, ensuring maximum Wi-Fi range and stability. For environments where RF interference might affect audio quality, the firmware allows users to adjust the Wi-Fi TX power directly from the web interface, reducing coupling noise into the microphone wiring.
59+
60+
## Features for Long-Term Deployment
61+
62+
Designed for 24/7 operation, the firmware includes several reliability and integration features:
63+
64+
- **Web-Based Management**: A full English Web UI on port 80 for live status monitoring, log viewing, and configuration.
65+
- **Smart Home Integration**: MQTT telemetry and Home Assistant MQTT Discovery allow users to monitor device health, temperature, and stream status within their existing automation dashboards.
66+
- **Audio Enhancements**: A configurable high-pass filter (defaulting to 500 Hz) helps eliminate low-frequency rumble and environmental noise.
67+
- **Thermal Protection**: Includes a persistent latching thermal protection system to prevent hardware damage in extreme outdoor conditions.
68+
- **Scheduling**: Support for stream schedules and deep sleep modes to conserve power or limit data usage to specific times of day.
69+
70+
## Getting Started
71+
72+
Deploying the microphone is streamlined through a dedicated web flasher. Once flashed, the device boots into a captive portal mode (ESP32-RTSP-Mic-AP), allowing users to input their Wi-Fi credentials. After connecting to the local network, the device becomes accessible via a unique mDNS hostname (e.g., `esp32mic-a1b2c3.local`).
73+
74+
### Example RTSP Usage
75+
76+
Once the device is active, the audio streams can be accessed using standard tools like `ffplay` or VLC:
77+
78+
```bash
79+
ffplay -rtsp_transport tcp rtsp://<device-ip>:8554/audio1
80+
```
81+
82+
This URL can then be plugged directly into BirdNET-Go or BirdNET-Pi to begin real-time bird sound identification. The firmware defaults to 48 kHz mono 16-bit PCM, providing a balanced profile that avoids the common UDP stuttering observed in some ffmpeg-based clients.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Temperature-Controlled Ventilation System for Indoor Environments
3+
summary: An STM32F103R6-based embedded system that provides automated and manual ventilation
4+
control based on real-time temperature monitoring. It utilizes an LM35 sensor, PWM
5+
for fan speed regulation, and an L298N H-bridge for direction control, with status
6+
updates displayed on an LCD1602. The project demonstrates peripheral integration
7+
using the STM32 HAL for ADC, timers, and external interrupts.
8+
slug: temperature-controlled-ventilation-system-for-indoor-environments
9+
codeUrl: https://github.com/Seymagocmez/STM32_Temperature_Ventilation_Control
10+
lastUpdated: '2025-07-25'
11+
licenses:
12+
- MIT
13+
image: /202606/STM32_Temperature_Ventilation_Control_0.avif
14+
rtos: ''
15+
topics:
16+
- cubemx
17+
- embedded-systems
18+
- exti
19+
- hvac
20+
- keil-uvision
21+
- l298n
22+
- lcd-display
23+
- lm35
24+
- proteus
25+
- pwm-fan
26+
- stm32f103
27+
- temperature-monitoring
28+
- uart-protocol
29+
- ventilation
30+
isShow: true
31+
createdAt: '2026-06-18T08:51:44+00:00'
32+
updatedAt: '2026-06-18T08:51:44+00:00'
33+
---
34+
35+
Maintaining a comfortable indoor environment requires a delicate balance between temperature sensing and mechanical response. This project implements a sophisticated ventilation control system built on the STM32F103R6 microcontroller, designed to manage airflow automatically or via manual user intervention. By integrating analog sensors, motor drivers, and visual feedback, it serves as a robust example of a closed-loop control system in the embedded space.
36+
37+
## System Architecture and Logic
38+
39+
The heart of the system is the STM32F103R6, which processes data from an LM35 analog temperature sensor. The system logic is divided into two primary operating modes: Automatic and Manual.
40+
41+
In **Automatic Mode**, the system acts as an autonomous climate controller. It monitors the ambient temperature and responds based on predefined safety thresholds. If the temperature rises above 20°C, the system enters a "cooling mode," spinning the fan counter-clockwise to facilitate airflow. Conversely, if the temperature drops below 10°C, it switches to a "heating mode," reversing the fan direction to circulate warm air. When the temperature resides in the safe 10–20°C range, the fan stops to conserve energy. Visual and audible alerts—consisting of a red LED and a buzzer—trigger whenever the temperature exits the safe zone, while a green LED indicates stable conditions.
42+
43+
**Manual Mode** provides the user with granular control over the environment. Using five dedicated push buttons, a user can manually set the fan direction (Forward, Reverse, or Stop) and adjust the motor speed. The speed is regulated via Pulse Width Modulation (PWM), allowing for 10% incremental adjustments per button press, ranging from 0% to 100% duty cycle.
44+
45+
## Hardware Integration
46+
47+
The project utilizes several key hardware components to achieve its goals:
48+
- **LM35 Sensor**: Provides a linear analog voltage output proportional to the Celsius temperature, which is read by the STM32's ADC (PA1).
49+
- **L298N Dual H-Bridge**: This motor driver is essential for controlling the DC fan's direction and speed. It receives PWM signals from the MCU to modulate speed and uses GPIO pins (PC8, PC9) to toggle direction.
50+
- **LCD1602 Display**: Real-time data, including current temperature and system status, is displayed on a 16x2 character LCD. Interestingly, this project uses a custom-written `lcd1602.h` driver, interacting directly with the STM32 HAL GPIO functions rather than relying on generic third-party libraries.
51+
- **UART Communication**: The system transmits the current PWM duty cycle over a serial interface (PA9), allowing for remote monitoring via a virtual terminal.
52+
53+
## Software Implementation
54+
55+
The firmware is developed using the STM32 HAL (Hardware Abstraction Layer) within the Keil MDK-ARM environment. The configuration is managed through STM32CubeMX, which handles the initialization of the ADC for sensor reading, TIM3 for PWM generation, and EXTI (External Interrupts) for responsive button handling.
56+
57+
The control flow follows a standard embedded loop: the MCU polls the ADC for temperature changes, updates the LCD only when a significant change (≥0.5°C) is detected to prevent flickering, and then evaluates the motor logic based on the active mode. The use of external interrupts for the control buttons ensures that user inputs are processed immediately, providing a snappy interface even while the main loop handles display and sensor math.
58+
59+
## Simulation and Testing
60+
61+
For developers looking to explore the project without physical hardware, the repository includes a comprehensive Proteus simulation setup. By loading the generated `.hex` file from the Keil build into the Proteus schematic, users can interact with the virtual buttons, observe the fan's behavior, and see the real-time temperature updates on the virtual LCD. This makes it an excellent educational resource for understanding the interaction between firmware logic and electronic hardware.

0 commit comments

Comments
 (0)