Skip to content

This project is a for Barnard's BC3930 Class: Creative Embedded Systems. It is a simple music box that incorporates the use of an LILYGO ESP32 T-display, a servo motor, and a photo resistor. When the box is open, music will play. This project also uses software tools such as Processing for audio elements within the project.

Notifications You must be signed in to change notification settings

toonwuka04/BC3930-FinalProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BC3930 - FinalProject

Simple Music Box

Goal:

Create a box that plays music when opened (triggered by a light sensor).

Tools Needed:

  1. LILYGO ESP32 Board
  2. Arduino IDE
  3. Processing
  4. TFT Espi Library (Downloadable) - Documentation
  5. USB-c cord
  6. 7 male/male wires (for breadboard)
  7. 10k Ω resistor
  8. Servo Motor
  9. Photoresistor
  10. Wires
  11. Breadboard
  12. (Optional) Figurine & Glue
  13. (Optional) Bluetooth Speaker

Code Description

/lightsensing - holds the arduino file for code to uploaded to the ESP32 board for sensing light and gathering serial communication

  • lightsensing.ino - arduino file with ESP 32 code

/enclosuredesign - holds the svg files related to the enclosure for laser cutting

/musicbox - holds the code for launching the audio element of the music box through the Processing application

  • musicbox.pde - processing file with audio playing code

Fritzing Diagram

Screenshot 2024-12-10 at 4 04 53 PM

Setup

  1. Solder wires to your photoresistor.
  2. Use the enclosure svg file in /enclosuredesign and some wood to laser cut the box design
  3. Follow the Fritzing diagram and add your servo motor, photoresistor, 10K Ω resistor, and ESP32 board to the breadboard
  4. Loop your connected servo motor and photoresistor through the hole at the bottom of the closure design
  5. Glue the figurine to the servo motor while its inside the enclosure box
  6. Add the speaker inside the box and connect to your computer audio
  7. Connect your ESP32 board to your computer via a USB-C cord
  8. Download the /lightsensing and /musicbox folders
  9. Open these folders in the Arduino IDE application and Processing application, respectively
  10. Confirm that your ESP32 board connects to the Arduino application by running the arduino code file lightsensing.ino (you should see printed light values read from the serial communication)
  11. Open the musicbox.pde from the /musixbox folder in the Processing application and ensure that it runs and complies
  12. Once a screen pops up from the Processing application, you should be able to test out your music box!

~ Feel free to make any edits to the code after downloading and experiment on your own! ~

Media

Video:

IMG_2987.mp4

Enclosure photos (open and closed view)

open closed

About

This project is a for Barnard's BC3930 Class: Creative Embedded Systems. It is a simple music box that incorporates the use of an LILYGO ESP32 T-display, a servo motor, and a photo resistor. When the box is open, music will play. This project also uses software tools such as Processing for audio elements within the project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published