Sunday, April 13, 2025

How to Create Voice-Activated Raspberry Pi with Pomodoro Bot V2

Pomodoro Bot V2—a sleek, voice-activated productivity sidekick that’s here to make your focus sessions smarter, hands-free, and, frankly, a whole lot cuter. If you’re new to this project, our first Pomodoro Bot was a simple yet effective tool for tracking focus sessions with a display and physical buttons. It did the job, but we knew we could level it up. And boy, did we!

This second version brings a boatload of upgrades: a fully voice-enabled system powered by a large language model (LLM), a compact audio setup, a custom-designed PCB, and an adorable new look complete with 3D-printed ears. Whether you’re a coder, a maker, or just someone who loves geeking out over tech, this guide will walk you through every step of how we built this bot, from hardware tweaks to software integration. So grab a coffee, settle in, and let’s get hands-on with this 7,000-word deep dive into the Pomodoro Bot V2!

A Quick Look Back, Pomodoro Bot V1

Before we jump into the shiny new features, let’s take a moment to appreciate where we started. Our first Pomodoro Bot was a minimalist productivity tool built around the classic Pomodoro Technique—25 minutes of focused work followed by a 5-minute break. It featured a basic display to show the timer and physical buttons for starting, stopping, and resetting sessions. Powered by a Raspberry Pi, it was functional and reliable but lacked the interactivity we craved.

While V1 got the job done, we saw room for improvement. We wanted a bot that could talk back, respond to voice commands, and look a bit more… alive. That’s where Pomodoro Bot V2 comes in, with upgrades that make it smarter, sleeker, and way more fun to use. Let’s break down what’s new!

What’s New in Pomodoro Bot V2?

Pomodoro Bot V2 isn’t just a facelift—it’s a complete overhaul. Here’s a quick rundown of the key upgrades:

  • Voice Activation: Thanks to LLM integration and a wake word detector, the bot listens for commands like “Hey Pomo” and responds in real time. No buttons needed!
  • Audio System: A compact USB microphone and a 4-ohm speaker paired with a PAM8403 amplifier give the bot clear audio input and output.
  • Custom PCB: A two-layer printed circuit board (PCB) keeps the wiring tidy and components secure.
  • Sleek Design: A redesigned 3D-printed case with cute ears and a two-tone color scheme (white and purple) makes the bot a desk-friendly companion.
  • Hands-Free Productivity: Start, stop, or query your Pomodoro sessions using voice commands, powered by Viam and a local LLM.

These upgrades transform the bot from a simple timer into an interactive assistant that can answer questions, manage your focus sessions, and maybe even charm you with its new look. Ready to see how we made it happen? Let’s dive into the build process.

Building the Audio System

The biggest leap from V1 to V2 is the addition of voice interaction. To make this happen, we needed a robust audio system for both input (listening to your commands) and output (talking back). Here’s how we pulled it off.

Audio Input: Choosing the Right Microphone

For audio input, we needed a compact microphone that could fit inside the bot’s small housing without sacrificing quality. After some research, we settled on a tiny USB microphone. Its small size made it a perfect fit, requiring only a minor tweak to the 3D model to create a dedicated slot. The USB mic connects directly to the Raspberry Pi, keeping the setup simple and plug-and-play.

Audio Output: Speaker and Amplifier Setup

For audio output, we chose a 4-ohm, 2.5W speaker for its balance of size and sound clarity. To drive the speaker, we paired it with the PAM8403 amplifier module—a compact, efficient chip that delivers crisp audio without draining too much power.

Here’s where things got tricky: the Raspberry Pi 5 doesn’t have a built-in 3.5mm audio output. Instead of adding an external sound card (which would’ve bulked up the design), we got creative. We routed the audio signal through the display’s 3.5mm jack, feeding it into the PAM8403 amplifier, which then powers the speaker. This workaround kept the setup lean while maintaining clear audio.

Power Management and Noise Control

During testing, we noticed some electrical noise when powering the Raspberry Pi and PAM8403 from the same source. To fix this, we used separate power supplies for the two components. We also added a USB breakout board to power the amplifier conveniently, keeping the wiring clean.

Testing the Audio System

Before moving forward, we ran some basic tests to ensure the audio system worked as expected. For input, we used arecord to capture audio from the USB mic. For output, we played back test audio with aplay. The results? Crystal-clear sound and reliable voice detection. Our bot was officially ready to listen and talk!

Powering Voice Interaction

With the audio hardware in place, it was time to give the bot its smarts. We turned to Viam, a powerful robotics platform, and a local large language model (LLM) to enable real-time voice interactions. Let’s break down how these pieces fit together.

What Is Viam?

If you’re new to Viam, here’s the quick version: it’s an open-source platform that simplifies building, controlling, and managing robots. Viam has two main parts:

  • Server App: Runs locally on your single-board computer (like the Raspberry Pi) and acts as the brain, connecting hardware and software.
  • Cloud App: A remote dashboard for configuring your bot, monitoring performance, and collecting data.

Viam organizes your robot around two concepts:

  • Components: Physical hardware (e.g., cameras, speakers, or motors) paired with software drivers for smooth operation.
  • Services: Pre-built software packages that add advanced features like motion planning or speech recognition without complex coding.

For our Pomodoro Bot, Viam handles everything from audio processing to LLM integration, making it easy to add voice control.

Adding a Local LLM

To give the bot conversational abilities, we integrated a local LLM using Viam’s local-llm module. This lets the bot process speech and respond without relying on cloud servers, which is great for privacy and offline use. We chose DeepSeek’s DeepSeeker-1 model for its balance of performance and efficiency on the Raspberry Pi.

Here’s how we set it up:

  1. Download the Model: We headed to Hugging Face and searched for DeepSeeker-1’s .gguf file (the LLM file). Once found, we downloaded it to the Raspberry Pi.
  2. Get the Repo ID: From Hugging Face, we copied the repo ID for DeepSeeker-1 (e.g., deepseek/deepseeker-1).
  3. Configure Viam: In the Viam Cloud App, we navigated to the Configure tab, added the local-llm service, and entered the .gguf file path and repo ID. After saving, the LLM was ready to roll.

Viam uses llama.cpp under the hood to run models like DeepSeeker-1 efficiently on resource-constrained devices. With the LLM in place, the bot could now understand queries and generate natural responses.

Adding a Wake Word Detector

To make the bot truly hands-free, we added a wake word detector using Picovoice’s Porcupine engine. Porcupine is fast, offline, and perfect for edge devices like the Raspberry Pi. We chose “Hey Pomo” as our custom wake word to trigger the bot.

Here’s how we set it up:

  1. Create the Wake Word:
    • We logged into the Picovoice Console and navigated to the Porcupine section.
    • Instead of using a default wake word (like “Hey Google”), we clicked “Create Wake Word” and entered “Hey Pomo.”
    • Picovoice generated a .ppn model file for our custom wake word, which we downloaded to the Raspberry Pi.
  2. Get the Access Key:
    • In the Picovoice Console, we copied our API access key from the API Access Key section.
    • This key authenticates the Porcupine engine in our code.
  3. Integrate with Viam:
    • We added the .ppn file and access key to the Viam configuration, linking the wake word detector to the LLM service.
    • Now, saying “Hey Pomo” wakes the bot, which listens for your command and responds via the LLM.

With the wake word detector and LLM working together, the bot could now hear “Hey Pomo,” process voice commands, and reply in real time. Time to make it look as good as it sounds!



Designing the Custom PCB: Keeping It Neat

Wiring sprawl is every maker’s nightmare, so we designed a custom two-layer PCB to keep the Pomodoro Bot’s internals tidy. The PCB houses key components like the PAM8403 amplifier, ADS1115 ADC, sensors, and connectors, making assembly and maintenance a breeze.

PCB Design Process

We used EasyEDA, a free online PCB design tool, to create the board. Here’s what we included:

  • JST Connectors: For sensors, speakers, and the audio jack, ensuring modular connections.
  • PAM8403 Amplifier: Mounted directly on the PCB for a permanent audio solution.
  • ADS1115 ADC: Attached via female headers, creating a socket-like connection for easy removal or upgrades.
  • Power and Signal Routing: Carefully laid out to minimize noise and ensure reliable communication between components.

After finalizing the design, we exported the Gerber files and sent them to a PCB fabrication service. About a week later, our shiny new boards arrived, ready for soldering.

Why a Custom PCB?

A custom PCB might sound overkill for a small project, but it offers big benefits:

  • Compactness: Replaces messy breadboards and loose wires.
  • Reliability: Ensures secure connections that won’t wiggle loose.
  • Scalability: Makes it easier to replicate or modify the bot later.

With the PCB ready, it was time to rethink the bot’s exterior.

Redesigning the Case

Pomodoro Bot V2 isn’t just smarter—it’s also a total charmer. We redesigned the 3D-printed case to be both functional and adorable, complete with a few aesthetic upgrades.

New Features in the Case

  • Ears!: We added cute, attachable ears to give the bot personality. They’re printed separately for easy assembly.
  • Dedicated Component Slots: Spaces for the USB mic, speaker, and sensors ensure everything fits snugly.
  • Two-Tone Look: The main body is printed in white filament, while the front ring and ears use vibrant purple for a striking contrast.

3D Printing Process

We used a standard FDM 3D printer with PLA filament. The main body printed in about 6 hours, while smaller parts like the ears and front ring took less time. After printing, we sanded any rough edges and test-fitted the components to ensure a perfect fit.

The redesigned case not only looks great but also makes assembly easier by providing clear mounting points for the PCB, Raspberry Pi, and audio components. Speaking of assembly, let’s get to the fun part: putting it all together.

Assembling the Pomodoro Bot V2

With all the components ready—PCB, 3D-printed case, audio system, and software—it was time to bring the Pomodoro Bot V2 to life. Here’s how we assembled it, step by step.

Step 1: Front Section Assembly

We started with the front of the bot, which houses the speaker and PCB:

  1. Mount the Speaker:
    • We secured the 4-ohm speaker to the speaker grill inside the front housing using screws.
    • This keeps the speaker firmly in place while allowing sound to project clearly.
  2. Solder the PCB:
    • We soldered the PAM8403 amplifier directly to the PCB for a permanent connection.
    • For the ADS1115 ADC, we used female headers to create a removable socket, making future upgrades or troubleshooting easier.
    • JST connectors for the speaker and audio jack were also soldered onto the PCB.
  3. Connect the Audio Jack:
    • We plugged the 3.5mm audio jack into the PCB, routing the signal from the display to the PAM8403.
  4. Stack the PCB:
    • The completed PCB was carefully stacked onto the Raspberry Pi, aligning the GPIO pins.
    • We double-checked all connections to avoid shorts or loose wires.
  5. Insert into Housing:
    • The Raspberry Pi-PCB stack was slid into the front housing, with the speaker and audio jack connected to the PCB’s JST connectors.

Step 2: Back Section Assembly

Next, we tackled the back section, which holds the sensors and USB mic:

  1. Solder JST Connectors:
    • We soldered JST connectors to the sensors, creating standardized plugs that interface with the PCB.
    • This modular approach makes it easy to swap sensors if needed.
  2. Mount Components:
    • The USB mic and sensors were secured to their dedicated slots in the back housing using adhesive and screws.
    • We ensured the mic’s pickup was unobstructed for clear audio capture.
  3. Connect Back to Front:
    • We ran wires from the back section’s JST connectors to the PCB in the front, completing the electrical pathways.

Step 3: Final Touches

With the internals assembled, we added the finishing touches:

  1. Attach the Front Ring and Ears:
    • The purple front ring and ears were glued to the main body, giving the bot its signature look.
    • We used a small amount of adhesive to keep them secure without damaging the PLA.
  2. Test Fit:
    • Before sealing everything up, we powered on the bot to ensure all components were aligned and functional.
    • A quick “Hey Pomo” confirmed the wake word detector and audio system were working.

The assembly process took a few hours, but the result was worth it: a compact, professional-looking bot ready to assist.

Putting the Bot to Work

With the Pomodoro Bot V2 fully assembled, it was time to see it in action. We tested its core features to ensure everything worked as planned.

Voice Commands

The wake word “Hey Pomo” triggers the bot, which listens for your command. Here are a few things we tried:

  • Basic Queries:
    • “Hey Pomo, what is 2 + 2?”
    • Response: “The sum of 2 + 2 is 4.” The LLM handled simple math like a champ.
  • Pomodoro Control:
    • “Hey Pomo, start timer.”
    • The bot kicked off a 25-minute focus session, confirming with a cheerful “Timer started!”
    • We also tested “Hey Pomo, stop timer” and “Hey Pomo, how much time is left?”—both worked flawlessly.

Audio Quality

The USB mic picked up voice commands clearly, even in a moderately noisy room. The speaker, powered by the PAM8403, delivered crisp responses loud enough to hear across a desk. The separate power supplies eliminated any noticeable noise, ensuring clean audio.

Productivity Features

Beyond voice control, the bot retains the core Pomodoro functionality:

  • Tracks 25-minute focus sessions with 5-minute breaks.
  • Alerts you (via voice) when a session starts or ends.
  • Keeps a tally of completed sessions to gamify your productivity.

We ran a few sessions to test reliability, and the bot didn’t miss a beat. It’s a hands-free dream for anyone juggling work and focus.

Challenges and Lessons Learned

No project is without hiccups, and Pomodoro Bot V2 had its share. Here’s what we ran into and how we solved it:

  • Audio Noise: Early tests had static in the speaker output. Using separate power supplies for the Raspberry Pi and PAM8403 fixed it.
  • PCB Sizing: Our first PCB design was slightly too large for the case. A quick tweak in EasyEDA solved the issue.
  • LLM Performance: DeepSeeker-1 occasionally lagged on complex queries. We optimized Viam’s settings to prioritize simpler tasks, which smoothed things out.

These challenges taught us the importance of iterative testing and keeping hardware modular for easy fixes.

Why Build a Pomodoro Bot?

You might be wondering: why go through all this trouble when a phone app can track Pomodoro sessions? Here’s why this project is worth your time:

  • Hands-Free Convenience: Voice control means no tapping screens or clicking buttons—just say “Hey Pomo” and get to work.
  • Customization: From the PCB to the LLM, every part of this bot is tweakable to suit your needs.
  • Learning Opportunity: Building the bot teaches you about audio systems, PCB design, 3D printing, and AI integration—a maker’s playground!
  • Desk Charm: Let’s be honest—those ears make it a conversation starter.

Whether you’re boosting productivity or flexing your DIY skills, this bot delivers.

Scaling Up

Pomodoro Bot V2 is a big step forward, but we’re already dreaming of V3. Here are some ideas:

  • Vision System: Add a camera and Viam’s vision service for gesture control or desk monitoring.
  • Mobile App: Pair the bot with a Viam-powered app for remote control and session tracking.
  • More Personality: Train the LLM with custom prompts to give the bot a quirkier voice.
  • Battery Power: Swap the wall adapter for a LiPo battery for portability.

For now, V2 is a capable companion, but the possibilities are endless.

Getting Started with Your Own Pomodoro Bot

Feeling inspired? Here’s how to build your own Pomodoro Bot V2:

Hardware You’ll Need

  • Raspberry Pi 5 (or Pi 4 for a budget option)
  • USB Microphone (small, high-quality)
  • 4-ohm, 2.5W Speaker
  • PAM8403 Amplifier Module
  • ADS1115 ADC Module
  • Sensors (e.g., temperature or motion, optional)
  • 3.5mm Audio Jack
  • JST Connectors
  • 3D Printer (or access to one)
  • PLA Filament (white and purple recommended)
  • Custom PCB (Gerber files available—check EasyEDA tutorials)

Software Setup

  1. Install Viam:
    • Follow Viam’s setup guide for Raspberry Pi (viam.com/docs).
    • Configure the server app and connect to the cloud app.
  2. Add the LLM:
    • Download DeepSeeker-1’s .gguf file from Hugging Face.
    • Set it up in Viam’s Configure tab.
  3. Set Up Porcupine:
    • Create a custom wake word at console.picovoice.ai.
    • Add the .ppn file and access key to Viam.
  4. Test Everything:
    • Use arecord and aplay for audio tests.
    • Try “Hey Pomo” to verify voice commands.

Assembly Tips

  • Double-check PCB soldering to avoid shorts.
  • Test-fit 3D-printed parts before gluing.
  • Keep wires short to minimize clutter.

With patience and a bit of elbow grease, you’ll have your own Pomodoro Bot in no time.

Conclusion

Pomodoro Bot V2 is more than a timer—it’s a testament to what you can build with a Raspberry Pi, some creativity, and a sprinkle of code. From its voice-activated smarts to its custom PCB and adorable design, this bot is ready to help you crush your focus sessions while looking good on your desk.

We’ve walked through every step: building the audio system, integrating Viam and an LLM, designing the PCB and case, and assembling the final product. Whether you’re a seasoned maker or a curious beginner, this project is a fantastic way to dive into robotics, AI, and hardware hacking.

0 comments:

Post a Comment