Difference between revisions of "ECE434 Project Christmas Wreath"

From eLinux.org
Jump to: navigation, search
(User Instructions)
(Highlights)
(23 intermediate revisions by 2 users not shown)
Line 30: Line 30:
 
== Executive Summary ==
 
== Executive Summary ==
  
We want to create 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 will be predefined and predetermined.  
+
[[File:ChristmasWreath.jpg|thumb|Smart Christmas Wreath]]
Currently, we have the LED strip utilizing the PRU units on the BeagleBone working correctly to display colors on a small LED ring. We plan on moving to a more complete LED strip in the next few days. We have also started development on the USB connected audio jack. We are able to play .mp3 files using the mplayer command on the command line.
+
 
We believe that the most difficult part of the project will be implementing the functionality of the music player and the LED strip in parallel. To accomplish this, we plan on running separate threads for running the LEDs and playing music. We have not yet been able to successfully run these two in parallel.
+
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.
Overall, we hope to spread a little Christmas cheer before we leave campus at the end of the term. Both of us are excited to be able to control a Christmas wreath using a mobile application.
+
 
 +
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.
  
 
== Packaging ==
 
== Packaging ==
If you have hardware, consider [http://cpprojects.blogspot.com/2013/07/small-build-big-execuition.html Small Build, Big Execuition] for ideas on the final packaging.
+
 
 +
[[File:BreadBoard.jpg|200px|Close Up of the bread board with the USB audio device that play the music]]
 +
 
 +
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.
  
 
== Installation Instructions ==
 
== Installation Instructions ==
Line 43: Line 47:
  
 
* Obtain the code from Github: https://github.com/dougheea/ECE434/tree/master/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
+
* 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  
 
* Install the Blynk App on your mobile device  
[Put in paragraph explaining how to make a blynk app real quick?]
+
* 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 your own authorization code into the setup.sh file
* In the command line: source setup.sh
+
* 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.
* Finally, run playSongAndLights.py
+
* In the command line: ''source setup.sh''
 +
* Finally, run ''./playSongAndLights.py''
  
 
== User Instructions ==
 
== User Instructions ==
Line 56: Line 61:
 
== Highlights ==
 
== Highlights ==
  
Here is where you brag about what your project can do.
+
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.  
  
Include a [http://www.youtube.com/ YouTube] demo the audio description.
+
Click [https://www.youtube.com/watch?v=3PXV4XKxh_w&ab_channel=RyanTaylor/ here] to see a demo of the lights.
  
 
== Theory of Operation ==
 
== Theory of Operation ==
  
Give a high level overview of the structure of your software. Are you using GStreamer?  Show a diagram of the pipeline. Are you running multiple tasks?  Show what they do and how they interact.
+
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.
 +
 
 +
[[File:ChristmasWreathFlowChart.jpg|Left|Code Flow Chart for the Smart Christmas Wreath]]
  
 
== Work Breakdown ==
 
== Work Breakdown ==
Line 83: Line 98:
 
* Setting up Blynk App environment (Emily)
 
* Setting up Blynk App environment (Emily)
 
* Starting and stopping music using mplayer in a python program (Emily)
 
* Starting and stopping music using mplayer in a python program (Emily)
* Setting up lights and defining animations using PRU(Ryan)
+
* Setting up lights and defining animations using PRU (Ryan)
 
* Using threading to use mplayer and the light strip in parallel (Emily)
 
* Using threading to use mplayer and the light strip in parallel (Emily)
 
* Procuring external power supply for final demo (Ryan)
 
* Procuring external power supply for final demo (Ryan)
Line 90: Line 105:
 
== Future Work ==
 
== Future Work ==
  
Suggest addition things that could be done with this project.
+
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.
  
 
== Conclusions ==
 
== Conclusions ==
  
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
+
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.
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Revision as of 11:11, 16 November 2020

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Emily Dougherty Ryan Taylor

Grading Template

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

(Inline Comment)

Executive Summary

Smart Christmas Wreath

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.

Packaging

Close Up of the bread board with the USB audio device that play the music

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.

Installation Instructions

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

User Instructions

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.

Highlights

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.

Code Flow Chart for the Smart Christmas Wreath

Work Breakdown

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)

Future Work

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.

Conclusions

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.




thumb‎ Embedded Linux Class by Mark A. Yoder