I am a rock fan and I really enjoy live house performances; the main reason is that in such environment, audience can feel the vibrations from the speaker and visual simulations in addition to audio effects, and the experience is more engaging. Now with the pandemic, it’s harder to “feel” the music in person, and I think the haptic wristband can bring that combination of senses back.
PocketBeagle Set Up- First prepare female headers with long leads and short leads. Remove the extra leads and cut to the appropriate length
- Then solder the headers with short leads to the inner rows, the ones with long leads to the outer rows
- Use solder to enable USB host port by bridging ID to GND, VB to VI
- Wire up the 4 pin USB port
- Plug in PocketBeagle on top of the wires
- Connect to the USB hub, power up the hub, and plug in bluetooth adaptor and USB speaker; use the hub to supply 5V voltage difference to the positive and negative power rails.
- In the terminal, do: sudo apt-get update & sudo apt-get install alsa-utils libasound2 -y
- Check the available device: aplay -l
- Edit the sound configuration file using nano ~/.asoundrc; make sure that the card and device numbers (HW IDs) match with the ones provided in the last step
- Add MP3 capabilities using sudo apt-get install mplayer -y, with this, we can play music in the command line easily by typing mplayer file_name.mp3
- There are two sets of SPI ports on PocketBeagle (shown in orange). I chose to use the ones on P2.
- First solder header onto the SPI side of the display, and bridge IM1, IM2, IM3
- Then, connect the corresponding ports, and configure them as appropriate:
GND: GND (P2_21)
VIN: 3.3V (P2_23)
CLK: CLK (P2_29)
MISO: MISO (P2_27)
MOSI: MOSI (P2_25)
CS: GPIO19 (P2_31)
D/C: GPIO45 (P2_33)
RST: GPIO86 (P2_35)
- In the terminal, run:
sudo apt get update
sudo pip3 install upgrade Pillow
sudo pip3 install adafruit circuitpython busdevice
sudo pip3 install adafruit circuitpython rgb display
sudo apt get install ttf dejavu y
- Use the spi_screen_test.py to test the connection (make sure to configure pins first!)
- The button can be controlled using any GPIO pin. In the project, I used P1_26, which is GPIO12. In addition to that, a pull-up resistor of 1kN is connected, and the other end of the button is connected to ground. Note that if only one set of button pins is used, remove the other set so that it won't accidentally bridge some other connections.
- To interact with the button, change directory to /sys/class/gpio/gpio12, and print the value using cat value. When the button is unpressed, the value is 1; when it is pressed and held, the value is 0. With AdafruitBBIO.GPIO library, the button value can be obtained using function call input().
- First wire up the level shifter
- Then wire up the LED strip as demonstrated
- Configure the pin: config-pin P1_08 gpio
- Download the following files (all available in the repository):
- Modify boot settings using sudo nano /boot/uEnv.txt
First comment out RPROC firmware
Then uncomment UIO firmware
Check whether UIO is availble by ls/sys/class/uio
- Open two terminals on PocketBeagle. For terminal 1, run sudo./run-opc-server. For terminal 2, use./run to run the led_strip_test.py
- The connections are very straight forward: positive ends go to PWM ports (shown in green), negative ends go to ground. Use config-pin to configure the appropriate pins as PWM.
- Use buzzer_test.py to check the connections.
- With the 3D printed bracelet, I used super glue to fix the vibration motors and the led strip.
- To give user a larger range of motion, I soldered and crimped the vibration motor wires.
It is straightforward to operate the system. Using sudo crontab -e, the program autoboot 30 seconds after PocketBeagle is turned on. When song names are displayed on the screen, press button to select the song to play. Wait for several seconds, the speaker and bracelet will start to work!
Problems Unsolved- The USB hub or the soundcard might be defected, and sometimes PocketBeagle couldn't recognize it upon reboot.
- Because multiprocessing takes a lot of processing power and overwhelms the PocketBeagle, the SPI screen sometimes can't work without a reboot.
- Because unpacking the wave file takes some time, the effects vibration motors and LEDs are slightly off from the music.
- Because of a wiring issue, the vibration motors are burnt. (The system was fully functional before the issue, and therefore should be working after replacing the motors.)
- The LEDs couldn't work upon reboot, possibly because the sudo server command couldn't be executed.
- Replace the vibration motors.
- Try integrate the time lag of the unpacking wave file into the code to make everything syncs better.
- Try find a way to make LEDs work upon reboot.
- Change the USB speaker into a bluetooth speaker, and change the power source from wall outlet to rechargeable battery, which will significantly improve the mobility of the whole device. This will probably solve the sound
- Simplify the wirings into a PCB, ideally small enough to be attached on the bracelet. This will make the device aesthetically more pleasant.
- Add more interactive functions to the screen, such as showing a selection box when the user is selecting song by pressing the button.
- Integrate the button to the screen or make it a touch screen, which will make it easier to use.
Comments
Please log in or sign up to comment.