In today's fast-paced world, staying productive while maintaining focus can be challenging. Meet the Pomodoro Bot, your desktop companion designed to revolutionize the way you work. Built using Viam's versatile robotics platform and powered by the Raspberry Pi, this innovative tool goes beyond the traditional Pomodoro timer by integrating modern sensors and smart alerts to create a seamless productivity experience.

Features include:

With a sleek design and a focus on intelligent functionality, the Pomodoro Bot is more than just a timer; it's your dedicated partner in productivity. Whether you're working from home or at the office, this bot ensures you stay productive, healthy, and on schedule.

finished product

Prerequisites

Watch The Video

Let's start by seeing our Pomodoro Bot in action!

The Raspberry Pi boots from a USB flash drive (or microSD card). You need to install Raspberry Pi OS on a USB flash drive that you will use with your Pi. For more details about alternative methods of setting up your Raspberry Pi, refer to the Viam docs.

Install Raspberry Pi OS

  1. Connect the USB flash drive (or microSD card) to your computer.
  2. Download the Raspberry Pi Imager and launch it. raspberry pi imager
  3. Click CHOOSE DEVICE. Select your model of Pi, which is Raspberry Pi 5.
  4. Click CHOOSE OS. Select Raspberry Pi OS (64-bit) from the menu.
  5. Click CHOOSE STORAGE. From the list of devices, select the USB flash drive you intend to use in your Raspberry Pi. raspberry pi storage
  6. Configure your Raspberry Pi for remote access. Click Next. When prompted to apply OS customization settings, select EDIT SETTINGS.
  7. Check Set hostname and enter the name you would like to access the Pi by in that field, for example, raspberrypi.
  8. Select the checkbox for Set username and password and set a username (for example, your first name) that you will use to log into the Pi. If you skip this step, the default username will be pi (not recommended for security reasons). And specify a password.
  9. Connect your Pi to Wi-Fi so that you can run viam-server wirelessly. Check Configure wireless LAN and enter your wireless network credentials. SSID (short for Service Set Identifier) is your Wi-Fi network name, and password is the network password. Change the section Wireless LAN country to where your router is currently being operated. raspberry pi hostname username and password
  10. Select the SERVICES tab, check Enable SSH, and select Use password authentication. raspberry pi enable SSH
  11. Save your updates, and confirm YES to apply OS customization settings. Confirm YES to erase data on the USB flash drive. You may also be prompted by your operating system to enter an administrator password. After granting permissions to the Imager, it will begin writing and then verifying the Linux installation to the USB flash drive.
  12. Remove the USB flash drive from your computer when the installation is complete.

Connect with SSH

  1. Place the USB flash drive into your Raspberry Pi and boot the Pi by plugging it in to an outlet. A red LED will turn on to indicate that the Pi is connected to power.
  2. Once the Pi is started, connect to it with SSH. From a command line terminal window, enter the following command. The text in <> should be replaced (including the < and > symbols themselves) with the user and hostname you configured when you set up your Pi.
    ssh <USERNAME>@<HOSTNAME>.local
    
  3. If you are prompted "Are you sure you want to continue connecting?", type "yes" and hit enter. Then, enter the password for your username. You should be greeted by a login message and a command prompt. raspberry pi SSH login
  4. Update your Raspberry Pi to ensure all the latest packages are installed
    sudo apt update
    sudo apt upgrade
    

Enable communication protocols

  1. Launch the Pi configuration tool by running the following command
    sudo raspi-config
    
  2. Use your keyboard to select "Interface Options", and press return. raspi config
  3. Enable the relevant protocols to support our hardware. Since you are using a sensor that communicates over the I2C, enable I2C. enable serial
  4. Confirm the options to enable I2C interface. And reboot the Pi when you're finished.

Create Your Machine

  1. In the Viam app under the LOCATIONS tab, create a machine by typing in a name and clicking Add machine. add machine
  2. Click View setup instructions. setup instructions
  3. Install viam-server on the Raspberry Pi device that you want to use to communicate with and control your Pomodoro Bot. Select the Linux / Aarch64 platform for the Raspberry Pi, and leave your installation method as viam-agent. select platform
  4. Use the viam-agent to download and install viam-server on your Raspberry Pi. Follow the instructions to run the command provided in the setup instructions from the SSH prompt of your Raspberry Pi. installation agent The setup page will indicate when the machine is successfully connected.

Add your Raspberry Pi

  1. In the Viam app, find the CONFIGURE tab. It's time to configure your hardware.
  2. Click the + icon in the left-hand menu and select Component. select component
  3. Select board, and find the pi5 module. This adds the module for working with the Raspberry Pi 5's GPIO pins. select board
  4. Notice adding this module adds the board hardware component called PI5. The collapsible card on the right corresponds to the part listed in the left sidebar. added board
  5. Click Save in the top right to save and apply your configuration changes.

Now let's set up your Pomodoro Bot to work with Google Calendar, so you can stay on top of your schedule without losing focus. Once integrated, your bot will automatically sync with your calendar to manage events and reminders.

Set Up a Google Cloud Project

  1. Go to the Google Cloud Console.
  2. Create a new project specifically for this integration. new project
  3. Once the project is ready:
    • Open the API Library.
    • Search for "Google Calendar API". calendar API
    • Click "Enable" to activate the API. enable API

Create a Service Account

  1. In the Google Cloud Console, navigate to IAM & Admin > Service Accounts. IAM & Admin
  2. Set up a new service account:
    • Create a new service account Create Service AccountName Service Account
    • Assign the role "Editor" or "Owner" to give it the necessary permissions. Assign Roles
    • Create and download the key file in JSON format. This file will be essential later. Manage KeysCreate KeyDownload Key
    • Keep the file in a secure location.
    • To transfer this file from your PC to Raspberry Pi, you can use SCP command in the following format

      Using hostname
         #Format: scp service-account-file.json username@hostname.local:/path/on/raspberrypi
         scp pomodorobot-service-account-file.json pi@raspberrypi.local:/home/pi/
      
      Using IP Address
         #Format: scp service-account-file-name.json username@ip-address-of-raspberrypi:/path/on/raspberrypi
         scp pomodorobot-service-account-file.json pi@192.168.1.4:/home/pi/
      

Share Your Calendar with the Service Account

  1. Open Google Calendar. Google Calendar
  2. Select the calendar you want to use. Select Calendar
  3. In Settings and Sharing, find the "Share with specific people" section: Share With Specific People
    • Enter the email address from the service account key file.
    • Give it permission to "Make changes to events." Share Access
    • Scroll down to "Integrate Calendar" and copy the Calendar ID for the next steps. Calendar ID

Connect Your Calendar to the Pomodoro Bot

  1. Open the Viam app and go to the CONFIGURE tab.
  2. Add the Calendar module, and provide: Google Calendar Service
    • The Calendar ID you copied earlier.
    • The path to the service account JSON file. Calendar Configuration
  3. Save your changes to complete the setup.

Test the Integration

  1. Create a test event in Google Calendar:
    • Name it something like "Test Meeting" and save the event. Test Meeting
  2. Go back to the Viam app and open the Control tab. Control Tab
  3. Use the given command in the DO COMMAND interface to check for upcoming calendar events.
       {
          "get_events": {
             "max_results": 10
          }
       }
    
    Test Calendar

If everything is working correctly, you should see your test event ("Test Meeting") listed in the results. This confirms that your Pomodoro Bot is successfully linked to your Google Calendar.

Let's integrate the ENS160 air quality sensor with your Pomodoro Bot to monitor indoor air quality effectively. The ENS160 sensor tracks VOCs (volatile organic compounds), eCO2 (equivalent carbon dioxide), and provides an Air Quality Index (AQI) – vital for maintaining an optimal workspace environment.

ENS160

Hardware Setup

ENS160 Connection Diagram

Ensure all connections are secure and double-check your wiring to avoid any issues.

Software Integration

Enhance your Pomodoro Bot by integrating the TEMT6000 ambient light sensor, which monitors light levels to help optimize workspace lighting for improved productivity. With this sensor, your bot can detect ambient light intensity and make adjustments as necessary to create a comfortable and efficient working environment.

Hardware Setup

Software Integration

Adding a display to your Pomodoro Bot elevates it from a functional productivity tool to an interactive and engaging companion. With a screen, your bot can visually communicate, provide intuitive feedback, and motivate you with friendly reminders or fun animations.

Display

Features

Hardware Connection

  1. Set the touch switch on the back of the screen to "I2C".
  2. Fix the Raspberry Pi to the screen through the copper posts, and pay attention to aligning the position of the ejector pins.
  3. Connect the HDMI port of the Raspberry Pi to the LCD.
  4. Connect USB-C on Display to USB port on Raspberry Pi to enable touch interactions.

LCD Connected To RPI 5

Software Setup

  1. Follow the instructions to Setup Raspberry Pi using Pi Imager.
  2. After the setup is completed, insert the SD card into your computer and open the config.txt file in the root directory of the SD card, and add the following code at the end of the file:
dtparam=i2c_arm=on
dtoverlay=waveshare-4dpic-3b
dtoverlay=waveshare-4dpic-4b
dtoverlay=waveshare-4dpic-5b
hdmi_force_hotplug=1
config_hdmi_boost=10
hdmi_group=2
hdmi_mode=87
hdmi_timings=720 0 100 20 100 720 0 20 8 20 0 0 0 60 0 48000000 6
start_x=0
gpu_mem=128
  1. Download the 4inch HDMI LCD (C) DTBO file and extract the 3 dtbo files. Copy these 3 files to the overlays directory (/boot/overlays/).
  2. Save the changes to the config.txt file, eject the SD card safely, and insert it into the Raspberry Pi.
  3. Power on the Raspberry Pi and wait for more than ten seconds to display normally

To enhance the functionality of your Pomodoro Bot, you can integrate a push button to allow manual control, such as starting or stopping tasks, resetting timers, or triggering specific actions. Here's how to add a push button:

Hardware Setup

Components Needed:

Wiring:

By adding a push button, you can make your Pomodoro Bot more interactive and user-friendly!

Aesthetics and Personality

We envisioned the Pomodoro Bot as more than just a functional tool. It needed to be visually appealing and possess a unique personality. To achieve this we used Fusion 360, to craft a 3D model, carefully balancing aesthetics and practicality. This process involved refining every detail to ensure the bot was both charming and functional.

3D Design

The final result is a compact and modern 3D-printed bot that is not only a productivity powerhouse but also a delightful desk companion designed to bring a smile to your face while helping you stay focused.

3D Printing Process

After finalizing the design, we brought our concept to life through 3D printing. We utilized the Bambu A1 3D printer to:

3D Printing

3D Printed Parts

3D Printed Parts

This 3D printing step was crucial in transforming the digital design into a tangible, high-quality physical product.

Find the STL Files here.

1. Power Up the Raspberry Pi

Once the assembly process is complete, power up your Raspberry Pi. You can do this by connecting the power supply to the Raspberry Pi's power jack.

2. Verify Functionality

After powering up, take a moment to verify that everything is functioning as expected. This may involve checking the Raspberry Pi's LED indicators and ensuring the Waveshare display turns on.

3. Download Source Code

The next step is to download the source code for the Pomodoro Bot application on to your Raspberry Pi. You can download the code from the following GitHub repository:

4. Edit the Source Code (main.py)

5. Run the Pomodoro Bot Code

6. See Your Pomodoro Bot Alive!

If everything is configured correctly, the Pomodoro Bot application should launch and your Raspberry Pi will transform into a functional Pomodoro Bot, ready to help you manage your work sessions and boost your productivity.

Assembled Product