Maker.io main logo

Yoga Pose Chime

2024-06-14 | By Adafruit Industries

License: See Original Project Displays LCD / TFT

Courtesy of Adafruit

Guide by John Park

Overview

 

While practicing Yoga on your own, it can be helpful to use an ‎interval timer to let you know when you have completed a certain ‎pose. While there are myriad apps that offer this functionality that ‎play a sound when the time is right, there is something wonderful ‎about the sound of a physical gong being struck.‎

This project uses a CLUE board to display poses, proximity control to ‎start your pose timer with the wave of a hand, and a solenoid striker ‎to chime a singing bowl.‎

Parts

Singing Bowl

You'll also need a metal singing bowl for the solenoid to strike, such ‎as this one.‎

bowl_1

Assemble the Pose Chime

assemble_2

The Yoga Pose Chime uses the CLUE to keep track of time spent in a ‎pose, and to trigger the solenoid to ring the pleasant chime when it ‎is complete. The solenoid draws more current at a higher voltage ‎than the CLUE is meant to provide directly, so we'll create a ‎transistor-based circuit to drive the solenoid.‎

The way the driver circuit works is that a small signal current tells ‎the transistor to open up the flow of a larger current. When it's time ‎to chime, the CLUE will send a 3V signal over pin 2 to the transistor, ‎which opens the floodgate of the full 6V of the four AA batteries, at ‎the much higher amperage needed to drive the solenoid.‎

For much more info on transistors, check out this excellent ‎guide, Transistors 101.

Breadboarding

Carefully place the Dragon Tail breakout into the breadboard as ‎shown. Pay special attention that the 3V pins are aligned with the ‎left side power rail.‎

Use jumper wires and the components to build the circuit as shown ‎in the circuit diagram above and the photos here.‎

You can use two male/male jumper wires to extend and connect the ‎solenoid cable to the board.‎

breadboard_3

breadboard_4

NOTE: We're using the right-side power rail for the 6V 4xAA battery ‎pack and must connect only the black ground rails. DO NOT connect ‎the right-side red rail's +6V to the left side's +3V red rail!‎

Attach Solenoid

One tricky part of this type of build can be how to mount the ‎solenoid to strike the bowl or gong. We're going to use the weight of ‎the battery pack to hold it in place, and it's height for positioning.‎

Use double-stick foam tape to attach the solenoid to the battery ‎pack as shown. You will want to check the height against the singing ‎bowl for height positioning.‎

attach_5

attach_6

Add CLUE

If you haven't already, plug the CLUE into the Dragon Tail.‎

add_7

Breadboard Mount

Breadboards come with double-stick foam tape already attached to ‎their bottoms. We'll use this to attach the breadboard and the rest of ‎the circuit/CLUE to the battery case as shown.‎

Remove the protective backing and align the board with the battery ‎pack so they can stand freely, then press and hold them together for ‎ten seconds or so to allow the adhesive to set.‎

mount_8

mount_9

mount_10

mount_11

Add Feet

Add the four rubber bumper feet to the bottom as shown. This will ‎give the device some needed friction to prevent it from moving ‎when the solenoid strikes the bowl.‎

feet_12

CLUE Power

The 3x AAA battery pack will power the CLUE itself (the 4x AA being ‎used only for the solenoid). Adhere it to the breadboard's double-‎stick foam tap as shown and then plug it into the JST battery ‎connector on the CLUE.‎

We'll use the on/off switches on the battery cases to turn on and off ‎the entire device.‎

power_13

power_14

setup_15

Next, we'll code the CLUE in CircuitPython.‎

CircuitPython on CLUE

CircuitPython is a derivative of MicroPython designed to simplify ‎experimentation and education on low-cost microcontrollers. It ‎makes it easier than ever to get prototyping by requiring no upfront ‎desktop software downloads. Simply copy and edit files on ‎the CIRCUITPY flash drive to iterate.‎

The following instructions will show you how to install CircuitPython. ‎If you've already installed CircuitPython but are looking to update it ‎or reinstall it, the same steps work for that as well!‎

Set up CircuitPython Quick Start!‎

Follow this quick step-by-step for super-fast Python power :)‎

Download the latest version of CircuitPython for CLUE from ‎circuitpython.org

Click the link above to download the latest version of ‎CircuitPython for the CLUE.‎

Download and save it to your desktop (or wherever is handy).‎

download_16

Plug your CLUE into your computer using a known-good USB cable.‎

A lot of people end up using charge-only USB cables and it is very ‎frustrating! So, make sure you have a USB cable you know is good ‎for data sync.‎

Double-click the Reset button on the top (magenta arrow) on your ‎board, and you will see the NeoPixel RGB LED (green arrow) turn ‎green. If it turns red, check the USB cable, try another USB port, ‎etc. Note: The little red LED next to the USB connector will pulse red. ‎That's ok!‎

If double-clicking doesn't work the first time, try again. Sometimes it ‎can take a few tries to get the rhythm right!‎

board_17

You will see a new disk drive appear called CLUEBOOT.‎

Drag the adafruit-circuitpython-clue-etc.uf2 file to CLUEBOOT.‎

drag_18

drag_19

The LED will flash. Then, the CLUEBOOT drive will disappear, and a ‎new disk drive called CIRCUITPY will appear.‎

If this is the first time, you're installing CircuitPython or you're doing ‎a completely fresh install after erasing the filesystem, you will have ‎two files - boot_out.txt, and code.py, and one folder - lib on ‎your CIRCUITPY drive.‎

If CircuitPython was already installed, the files present before ‎reloading CircuitPython should still be present on ‎your CIRCUITPY drive. Loading CircuitPython will not create new ‎files if there was already a CircuitPython filesystem present.‎

That's it, you're done! :)‎

done_20

Code the Yoga Pose Chime in ‎CircuitPython

Text Editor

Adafruit recommends using the Mu editor for editing your ‎CircuitPython code. You can get more info in this guide.‎

Alternatively, you can use any text editor that saves files.‎

Installing Project Code

To use with CircuitPython, you need to first install a few libraries, into ‎the lib folder on your CIRCUITPY drive. Then you need to ‎update code.py with the example script.‎

Thankfully, we can do this in one go. In the example below, click ‎the Download Project Bundle button below to download the ‎necessary libraries and the code.py file in a zip file. Extract the ‎contents of the zip file, open the directory Yoga_Pose_Chime/ and ‎then click on the directory that matches the version of CircuitPython ‎you're using and copy the contents of that directory to ‎your CIRCUITPY drive.‎

Your CIRCUITPY drive should now look similar to the following ‎image:‎

drive_21

Download Project Bundle

Copy Code
# SPDX-FileCopyrightText: 2020 John Park for Adafruit Industries
#
# SPDX-License-Identifier: MIT

# Yoga pose timer
# Requires CLUE with solenoid transistor driver circuit

import time
import board
from digitalio import DigitalInOut, Direction
from adafruit_clue import clue
from adafruit_slideshow import SlideShow, PlayBackDirection

pose_time = 30 # choose the time to hold each pose in seconds

solenoid = DigitalInOut(board.D2) # pad #2 on CLUE driving a MOSFET
solenoid.direction = Direction.OUTPUT
solenoid.value = False

def chime(repeat):
for _ in range(repeat):
solenoid.value = True
time.sleep(0.03)
solenoid.value = False
time.sleep(0.25)

slideshow = SlideShow(clue.display, None, folder="/icons", auto_advance=False)

while True:
if clue.proximity > 10:
time.sleep(1)
chime(1)
time.sleep(pose_time)
chime(2)
slideshow.direction = PlayBackDirection.FORWARD
slideshow.advance()

if clue.button_b: # skip ahead
slideshow.direction = PlayBackDirection.FORWARD
slideshow.advance()

if clue.button_a: # skip back
slideshow.direction = PlayBackDirection.BACKWARD
slideshow.advance()

View on GitHub

Pose Bitmaps

You'll need to load some compatible bitmap files onto ‎your CIRCUITPY drive. We've included a series of Yoga pose icons ‎from svgrepo.com that are Creative Commons licensed.‎

To use them, first download the .zip file linked below, and ‎uncompress it. Create a directory on the CLUE's root level ‎called icons. Then, copy a few pose .bmp files into the icons folder.‎

For information on how to create your own compatible bitmaps, ‎check out the Customization section of the Notification Icons page in ‎this guide.‎

pose_22

pose_23

yoga_pose_bmps.zip

How to use the Yoga Pose Chime

  • Turn on both battery packs first, so the CLUE turns on and the ‎solenoid can be triggered
  • You'll begin the first pose timer by waving your hand close to ‎the CLUE's proximity sensor which is mounted right above the ‎screen
  • The solenoid triggers once to chime the bowl, signaling the ‎pose can begin
  • After 30 seconds (or your chosen interval time) the solenoid will ‎chime twice, signaling the end of the pose
  • You can press the B button on the CLUE to skip ahead to a ‎different pose, the A button to go back to a pose

 

制造商零件编号 4500
CLUE NRF52840 EXPRESS
Adafruit Industries LLC
¥365.90
Details
制造商零件编号 3695
DRAGONTAIL FOR MICRO:BIT
Adafruit Industries LLC
¥72.85
Details
制造商零件编号 4539
HALF-SIZE BREADBOARD WITH MOUNTI
Adafruit Industries LLC
¥42.13
Details
制造商零件编号 727
BATTERY HOLDER AAA 3 CELL LEADS
Adafruit Industries LLC
¥17.27
Details
制造商零件编号 830
BATTERY HOLDER AA 4 CELL LEADS
Adafruit Industries LLC
¥24.86
Details
制造商零件编号 4482
SILICONE M-M JUMPER 200MM X 40
Adafruit Industries LLC
¥80.99
Details
制造商零件编号 1311
HOOK-UP 22AWG SOLID - 6 X 25FT
Adafruit Industries LLC
¥133.82
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum