Break Buddy - a Portable Mindfulness Companion

by bergmaad in Circuits > Raspberry Pi

7 Views, 0 Favorites, 0 Comments

Break Buddy - a Portable Mindfulness Companion

Break Buddy.jpg
Break Buddy Demo

During a busy day, remembering to zoom out and take a breather can be hard. Thankfully, you can build your own aesthetically pleasing desk-sized friend to gently notify you throughout the workday to take a 1-minute break and refocus. Calming sounds and animations usher you in and out of these mindful moments, and the easily customizable code means you can make it work for your needs.


This was created for a final project submission for the Physical Computing course taught by Prof. John Gallaugher at Boston College.

Supplies

Circuitry components

  1. Raspberry pi pico W
  2. Adafruit EYESPI Breakout Board - 18 Pin FPC Connector
  3. EYESPI Cable - 18 Pin 200mm long Flex PCB (FPC) A-B type
  4. Adafruit 1.44" Color TFT LCD Display with MicroSD Card breakout - ST7735R
  5. Push button (not exactly the one I used, but similar, same brand)
  6. 3.5mm plug mini speaker
  7. 3.5mm mono jack (female)
  8. Micro Connectors Micro-USB 5V/2.5A Power Adapter with on/off Switch for Raspberry Pi
  9. Breadboard
  10. 12 jumper wires
  11. Wire strippers
  12. Soldering iron

Assembly components

  1. 96 square-inches of 1/8" material that's safe for a laser cutter. I used opaque blue acrylic
  2. Hot glue

Solder & Wire

Break Buddy.png


Soldering

I had to solder the header pins on my EYESPI as well as two wires onto my button, one each leg.


Wiring

1. EYESPI Breakout Board to 1.44" Color TFT LCD Display: EYESPI Cable

2. Pico to EYESPI Breakout Board

GP5 -->TCS

GP6 --> DC

GP7 --> RST

GP8 --> LITE

GP14 --> SCK

GP15 --> MOSI

Ground (Pin 18) --> GND

3.3v out --> Vin

3. Pico to audio

GP16 --> Data

Ground (Pin 38) --> GND

4. Pico to button

GPO --> Leg 1

Ground (Pin 3) --> Leg 2

Code in Circuit Python

Connect your Raspberry Pi Pico W to Your WiFi Network Using CircuitPython

Import the attached Circuit Python code onto your board's code.py file.

  1. First, make sure that you have all the necessary libraries to run the code
  2. You'll also need to add or update a settings.toml file to your board with the wifi credentials of the wifi to which your Break Buddy will be connected.

Libraries

The attached code uses many additional libraries. You'll want to make sure that all of these are in your Raspberry Pi's lib folder.

  1. adafruit_display_text
  2. adafruit_ntp.mpy
  3. adafruit_st7735r.mpy
  4. circuitpython_schedule.mpy

Setting up your settings.toml file

In addition to importing the attached code into your board's code.py file, you will also want to create a settings.toml file to connect your board to your local wifi connection.. My Physical Computing professor, Prof. John Gallaugher created a helpful video on this process.

# Replace with your Wifi credentials
CIRCUITPY_WIFI_SSID="Your_WIFI_SSID"
CIRCUITPY_WIFI_PASSWORD="Your_WIFI_Password"

Downloads

Laser Cut & Assemble

The attached illustrator file has the cut dimensions for the enclosure. Once it's printed, use the hot glue to assemble but be sure to leave the top unglued. Secure the LCD display with electrical tape inside the box. Remove the button wires to feed it through the top and screw it in place. Rewire the button. Place the wired up breadboard inside the box and run your power adapter through to power your pico.

Make It Your Own!

Here are a few ideas for how you can personalize the code and make it uniquely serene for you!

1) Adjust the colors of the default background and the breathing background and animation square.

Default background: Replace both hexcodes with new colors

fade_background(bg_tile, bg_palette, 0x102840, 0x9575CD) # default background

Breathing background: Replace this hexcode with a new color

bg_palette[0] = 0x102840 # reset background

Breathing square: Replace these two hexcodes with a new color, note that color_b matches bg_palette[0] above

color_a = 0x9575CD # Lavender
color_b = 0x102840 # Midnight blue


2) Adjust the default and breathing animation text.

Default text: Change the text double quotes

text_area = label.Label(terminalio.FONT, text="just keep swimming", color=0xFFFFFF)

Breathing animation text: Change the text in double quotes

breathe_text = label.Label(terminalio.FONT, text="Take a moment\nto breathe", color=0xFFFFFF)


3) Change the chimes that mark beginning/end of the breathing animation.

Change the notes in the two functions below to different frequences.

def play_intro_chime():
play_note(261.63, 0.6) # C4 (Middle C)
play_note(329.63, 0.6) # E4 (Major third)
play_note(392.00, 0.6) # G4 (Perfect fifth)
def play_exit_chime():
play_note(392.00, 0.6) # G4
play_note(329.63, 0.6) # E4
play_note(261.63, 0.6) # C4


4) Adjust the automation schedule based on your own needs.

Change the maybe_run_breathing_animation() function to suit your needs. This one checks to see if it's between 9 and 5pm every 45 minutes and if so, it runs the breathing animation. You can also add in checks for certain days of the week too, but I plan to turn off my Break Buddy on the weekends.

# --- Schedule breathing animation every 45 minutes during the workday ---
def maybe_run_breathing_animation():
now = time.localtime()
if 9 <= now.tm_hour < 17: # Between 9am and 5pm
run_breathing_animation()

schedule.every(45).minutes.do(maybe_run_breathing_animation)


Have fun!! Let me know if you tried this - tag me in any builds or reach out with questions on Bluesky!

https://bsky.app/profile/abbybergman.bsky.social