Difference between revisions of "ECE434 Project Christmas Wreath"
|Line 1:||Line 1:|
Latest revision as of 12:48, 8 April 2021
Embedded Linux Class by Mark A. Yoder
I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!
09 Executive Summary 09 Packaging 09 Installation Instructions 09 User Instructions 09 Highlights 09 Theory of Operation 09 Work Breakdown 09 Future Work/Conclusions 09 Hackster.io 09 Demo/Poster 00 Late Comments: Have a good day. Score: 90/100
Our project is a "smart" Christmas wreath that allows the user to display a pattern of LEDs and play Christmas music from a mobile app (blynk). Animations and songs are predefined.
The user can follow the "Installation Instructions" and create their own Blynk application to interface with the Wreath. When a button is pressed on the Blynk app, the wreath will start a predetermined light show and play the corresponding song. Users can connect any audio device through an AUX connection to the USB audio dongle connected to the BeagleBone ad the music will be played through it.
In the above image you can see all the hardware pieces used to complete this project. There is a strip of 240 nano LEDs wrapped around a Christmas wreath that can perform specific animations. The strip of LEDs are run by the PRU0 on the BeagleBoard. The BeagleBoard itself (bottom left) is the brains of the system and runs the code that controls the wreath. Plugged into the BeagleBoard is an USB audio device that we use to play downloaded Christmas songs.
Give step by step instructions on how to install your project.
- Obtain the code from Github: https://github.com/dougheea/ECE434/tree/master/Project
- Make sure that mplayer is installed on the device that will be running the code. To install, run sudo apt install mplayer on the beaglebone.
- Install the Blynk App on your mobile device
- In the blynk app, select "New Project" and enter a name like "Christmas Wreath" and choose hardware option Generic Board. Make sure the connection type is "WiFi" and click "Create Project". An authorization code has been sent to the email associated with your blynk account.
- Add your own authorization code into the setup.sh file
- Add 5 button widgets to the project workspace and tie them to Virtual pins V0-V4. These buttons will be tied to the predetermined songs and the stop button.
- In the command line: source setup.sh
- Finally, run ./playSongAndLights.py
Once the installation instructions are completed, all that is left to do is start playing Christmas music! The user can choose 1 of 4 different songs: Mariah Carey's "All I Want For Christmas Is You," NSYNC's "Merry Christmas, Happy Holidays," The Ronette's "Sleigh Ride," and the Trans-Siberian Orchestra's version of "Carol of the Bells." Each song corresponds to a specific button on the Blynk app. The user can press the desired song's button to begin the music and turn on the LED animations wrapped around the wreath. The user can stop a song at any time by pressing the stop button. Once the song and LEDs are stopped, the user can chose the next song to play.
Our project has 4 separate songs:
- All I want for Christmas is You, Mariah Carey
- Merry Christmas, Happy Holidays, NSYNC
- Sleigh Ride, The Ronettes
- Carol of the Bells, Trans-Siberian Orchestra
All of the songs include their own personalized light show to accompany the music.
The music is being played using mplayer, a python package. Additionally, the PRU is used in lighting the LED strip.
Click here to see a demo of the lights.
Theory of Operation
Here is a flowchart that describes the structure of our code. By using the sub-processes and threading, the Blynk app can monitor when the 'Stop' button is pressed and quit the light animations/ music player.
Timeline and Milestones
- Brainstorm various light patterns to implement (11/5)
- Find more songs to use (11/5)
- Get the music to stop playing on a button press (11/6)
- Thread the music and lights so that they occur at the same time (11/8)
- Finalize the Blynk app (11/11)
- Assemble final project (11/13)
Who Did What
List the major tasks in your project and who did what. Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
Major Completed tasks:
- Setting up Blynk App environment (Emily)
- Starting and stopping music using mplayer in a python program (Emily)
- Setting up lights and defining animations using PRU (Ryan)
- Using threading to use mplayer and the light strip in parallel (Emily)
- Procuring external power supply for final demo (Ryan)
- Documentation (Emily and Ryan)
With more time, we would like to add functionality of a webpage to change the settings on the wreath. This webpage would be accessible from smartphones, tablets, or regular browsers. It would have the same functionality as the blynk application, but would be more accessible--the blynk app only works for smartphones who have a specific page created.
Additionally, we would like to change the type of lights we use to a more traditional style of Christmas light instead of the LED strip. These single LEDs could be multicolor or just white, but would have the same functionality as our LED strip with more of the look of traditional Christmas lights.
We would also like to put in a way for users to upload their own music to the Wreath. Currently, there are only 4 songs that are pre-loaded and have pre-defined lighting. It would be nice to expand this capability to allow users to customize the music they can play.
While developing the Smart Christmas Wreath we learned a lot about sub-processes and threading. The biggest complication was getting the Blynk app to be responsive while the lights and music run indecently from each other. The details of this process can be seen in the Theory of Operation section. Once We got the structure of the system working we were able to develop different animations for the lights and download several Christmas songs to choose from. All that was left was to finalize the Blynk app and then watch it run!
Another element that could be added to the project is having the lights react to the music. For example, if the songs volume increases, the brightness of the lights could increase. This would be a neat element to add in future implementations of this project.
Embedded Linux Class by Mark A. Yoder