Difference between revisions of "ECE434 Project - LED Matrix"

From eLinux.org
Jump to: navigation, search
(Work Breakdown)
m
 
(65 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:ECE497 |PL]]
 
 
[[Category:ECE497Fall2019 |PL]]
 
[[Category:ECE497Fall2019 |PL]]
  
Line 28: Line 27:
 
== Executive Summary ==
 
== Executive Summary ==
  
[[File:LED Matrix Spectrometer.jpg|frameless|LED Matrix Spectrometer]]
+
[[File:Audio Spectrometer Small.jpg|frame|center]]
  
Our project involves interfacing with an array of LED matrices, audio input, and a touch screen. The goal is to implement two separate functions on the LED matrices. This first function is an audio spectrometer display based on audio input. The second is controlling the LED matrices using a touch screen interface.
+
Our project involves interfacing with six LED matrices and audio input. The goal is to take the audio input, perform a frequency domain analysis, and then display the frequency spectrum onto the LED matrices as a spectrometer.
  
  
Give two sentences telling what works.
+
We managed to get audio input and perform frequency domain analysis on the host computer. The host is then sending pixel data to the pocket beagle that is using falcon player to control the LED matrices and create an audio spectrometer.
  
Give two sentences telling what isn't working.
 
  
End with a two sentence conclusion.
+
We had a lot of trouble getting audio input to the pocket beagle, so we kept this part on the host computer. Additionally, we were dealing with latency issues and decided the audio processing could run faster if performed on the host as it has significantly more processing and memory. We also experienced minor LED refresh delays that we weren't fully able to remove.
  
The sentence count is approximate and only to give an idea of the expected length.
+
 
 +
In the end, we were able to get our project working and it looks very nice when running.
 +
 
 +
This project is also available at: https://www.hackster.io/308270/beaglebone-led-audio-spectrometer-001868
  
 
== 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:Audio Spectrometer Small.jpg|frameless|center]]
 +
 
 +
Our six LED matrices from Dr. Yoder came neatly mounted on a frame. Power cables then connected to each matrix. Two matrices could then be spliced to the same power cable and connected to our 130W power supply. Each row on the 2x3 setup was then daisy chained together via the data in and data out ports. The pocket beagle was inserted into the PocketScroller cape and connected to the two remaining data in ports, one for each row of our larger matrix. Finally, the pocket beagle was then connected to a host computer with a USB cable.
  
 
== Installation Instructions ==
 
== Installation Instructions ==
<h3>GitHub</h3>
+
=== GitHub ===
 
The project is located on GitHub here: [https://github.com/grinstba/LEDMatrix https://github.com/grinstba/LEDMatrix]
 
The project is located on GitHub here: [https://github.com/grinstba/LEDMatrix https://github.com/grinstba/LEDMatrix]
  
<h3>Hardware</h3>
+
=== Hardware ===
 
Here are the links for the specific hardware we used for this project.
 
Here are the links for the specific hardware we used for this project.
  
 
We borrowed a six panel LED Matrix, power supply, pocket beagle, and pocket scroller cape from Dr. Yoder.
 
We borrowed a six panel LED Matrix, power supply, pocket beagle, and pocket scroller cape from Dr. Yoder.
  
 +
# LED Matrix - https://www.adafruit.com/product/2277
 +
# Pocket Beagle - https://www.amazon.com/BeagleBone-Beagleboard-PocketBeagle/dp/B07663NS35
 +
# Micro USB Cable - https://www.amazon.com/AmazonBasics-Male-Micro-Cable-Black/dp/B0711PVX6Z
 +
# 16 GB Micro SD Card - https://www.amazon.com/Micro-Center-Class-Memory-Adapter/dp/B07K835MNR
 +
# Pocket ScrollerV2 Cap - https://kulplights.com/product/pocketscroller/
 +
# Power Supply - http://www.primelec.com/delta-130w-power-supply-networking-power-supplies-p9550014#.XdNN31dKhPY
 +
# Power Supply Cables - https://www.newegg.com/p/1ET-000E-00034
 +
 +
=== Installation ===
 +
 +
Go to [https://github.com/grinstba/LEDMatrix https://github.com/grinstba/LEDMatrix] and clone the repository to your computer
 +
 +
Go to [https://falcon-player.gitbooks.io/falcon-player-manual/content/chapter_three_installation/downloading_the_falcon_player.html https://falcon-player.gitbooks.io/falcon-player-manual/content/chapter_three_installation/downloading_the_falcon_player.html] and follow the instruction to download the latest falcon player image and then flash it to one of your SD cards. Make sure to download the Beagle Bone image and not the Raspberry Pi image. Also, we were not running the falcon player off of eMMC.
 +
 +
 +
Once falcon player is installed, boot up your Beagle Bone and ssh into it with the following credentials: 
 +
* username: fpp 
 +
* password: falcon 
 +
 +
 +
By default the image we are running doesn't allow a root login. You will need a root login in order to get internet access on the Beagle Bone. In order to setup internet access, first ssh into the Beagle Bone with the default username and password listed above. The root access directions below are modified from [https://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone https://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone]
  
LED Matrix - https://www.adafruit.com/product/2277
+
Then run the following commands on the Beagle Bone
 +
bone$ '''sudo bash'''
 +
root@bone# '''nano /etc/ssh/sshd_config'''
  
 +
Search for the line
 +
#PermitRootLogin prohibit-password
 +
and change it to
 +
PermitRootLogin yes
  
Pocket Beagle - https://www.amazon.com/BeagleBone-Beagleboard-PocketBeagle/dp/B07663NS35
+
Save the file and quit the editor. Restart ssh so it will reread the file.
 +
root@bone# '''systemctl restart sshd'''
  
 +
And assign a password to root.
 +
root@bone# '''passwd'''
  
Micro USB Cable - https://www.amazon.com/AmazonBasics-Male-Micro-Cable-Black/dp/B0711PVX6Z/ref=sxin_2_pb?keywords=micro+usb+cable&pd_rd_i=B0711PVX6Z&pd_rd_r=ee00e633-9542-4c6f-aa69-20954edf8edc&pd_rd_w=vpOFg&pd_rd_wg=RBAWp&pf_rd_p=50bbfd25-5ef7-41a2-86d6-74d854b30e30&pf_rd_r=H5WCMVZ3E8MT83GPABEV&qid=1572376262&s=electronics
+
Now open another window on your host computer and enter:
 +
host$ '''ssh-copy-id root@bone'''
 +
and enter the root password.  Test it with:
 +
host$ '''ssh root@bone'''
 +
You should be connected without a password. Now go back to the Bone and turn off the root password access.
  
 +
root@bone# '''nano /etc/ssh/sshd_config'''
 +
Restore the line:
 +
#PermitRootLogin prohibit-password
 +
and restart sshd.
 +
root@bone# '''systemctl restart sshd'''
 +
root@bone# '''exit'''
 +
bone$ '''exit'''
  
16 GB Micro SD Card - https://www.amazon.com/Micro-Center-Class-Memory-Adapter/dp/B07K835MNR/ref=sr_1_3?keywords=micro+sd+card&qid=1572376346&refinements=p_n_feature_two_browse-bin%3A6518303011&rnid=6518301011&s=pc&sr=1-3
 
  
 +
Now, on your host run the following command to get network information:
 +
host# '''ip -a'''
  
Pocket ScrollerV2 Cap - https://kulplights.com/product/pocketscroller/
+
For us, on a WiFi network running the [https://github.com/grinstba/LEDMatrix/blob/master/ipMaskquerade.sh ipMaskquerade.sh] script in the following way works:
 +
and restart sshd.
 +
host# '''./ipMaskquerade.sh ens33'''
  
 +
Then run the [https://github.com/grinstba/LEDMatrix/blob/master/firstssh.sh firstssh.sh] script
 +
host# '''./firstssh.sh'''
  
Power Supply -
 
  
 +
Once connected to the the internet, go ahead and clone our GitHub project onto the pocket beagle from [https://github.com/grinstba/LEDMatrix https://github.com/grinstba/LEDMatrix].
  
Give step by step instructions on how to install your project.
+
 
 +
Once the projected has cloned, run the <code>install.sh</code> script to install the needed packages for the project to run.
  
 
== User Instructions ==
 
== User Instructions ==
  
Once everything is installed, how do you use the program? Give details here, so if you have a long user manual, link to it here.
+
Many of the following images and directions come from Mark A. Yoder's documentation found [https://markayoder.github.io/PRUCookbook/01case/case.html#case_rgb_matrix here]
 +
 
 +
 
 +
In order to light up an entire 32x64 LED panel white (Red, Green, and Blue all on), you will need at least a 5V 4A power supply. Each panel has a single power connection and a data in and data out connection. The data in connections control how the panel operates and the data out connections allow you to daisy chain the panels together to created a large display. The image below shows the connection.
 +
[[File:LED Panel Connections2.jpg|frame|center|https://markayoder.github.io/PRUCookbook/01case/case.html#case_rgb_matrix]]
 +
 
 +
 
 +
Once the falcon player image has been flashed to an SD card, insert the SD card into your Beagle Bone and connect it to a host computer via USB cable. Browser to https://192.168.7.2 and you will see the falcon player control panel shown below.
 +
[[File:FPP Control Panel.png|frame|center|https://markayoder.github.io/PRUCookbook/01case/case.html#case_rgb_matrix]]
 +
 
 +
You can use the settings in the control panel to set up the orientation of the LED Matrix. First switch the FPPD mode on the status page to bridged as shown below.
 +
[[File:StatusPageBridgeSetupResized.png|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/StatusPageBridgeSetup.PNG]]
 +
 
 +
Then, navigate to the Input/Output Setup tab and click on "Channel Inputs". Configure 96 input channels to have a universe size of 384 as shown in the picture below.
 +
[[File:UniverseSetupInputChannels.png|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/UniverseSetupInputChannels.PNG]]
 +
 
 +
In the same Input/Output Setup tab, click on "Channel Outputs". Configure 96 output channels to have a universe size of 384 as shown in the picture below.
 +
[[File:UniverseSetupOutputChannels.png|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/UniverseSetupOutputChannels.PNG]]
 +
 
 +
Next, under the Input/Output Setup tab, navigate to "LED Panels". This is where you set up the way in which the Output Universes will be represented on the physical LED Panels. Set the Panel Layout to 2X3, the Single Panel Size to 64X32 1/16 Scan, and the Panel Gamma to 2.2. You may choose the brightness that you desire. The Color Depth is 8 bit and the connection is the Hat/Cap/Cape. The color layout of the LED Panels are RGB, meaning that each little square of light on the panel has 3 channels; a red channel, green channel, and blue channel. This means that in total there are 64X32X3 = 6144 channels per panel. Since we have 6 panels, we have 6144X6 = 36864 total channels. Set the wiring pinout to PocketScroller. Looking at the LED Panel Layout section, leave "View Config from front?" checked. Since the panel layout is 2X3, we have two physical output numbers and 3 panel numbers for each physical output. The left column of the "Front View" should be set to O-1 for each row with P increasing from 1-3 as you go from top to bottom. The left column of the "Front View" should be set to O-2 with P increasing from 1-3 as you go from top to bottom. The arrows should be pointing from the right column to the left column for each row. All of these settings are shown below in the figure. After inputting all of these settings, click save, and then click on the "Restart FPPD" at the top of the screen in the red box. Look at the arrows shown on the back of the physical LED Matrix to determine which way to place it so that its configuration matches the direction that you just set it up as on the Falcon Player. In order to match this setup, you want the horizontal arrows going from right to left and the vertical arrows pointing from top to bottom.
 +
[[File:LEDPanelSetup.png|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/LEDPanelSetup.PNG]]
 +
 
 +
With the LED Matrix set up in this way, the bottom ribbon cable will connect into J1, and the top ribbon cable will connect into J2 on the PocketScroller. Power up the LED Matrix. At this point, within the Falcon Player you can navigate to Status/Control and click on the "Display Testing" tab. Set the end channel to 36864 and then select the checkbox that says "Enable Test Mode" as shown below.
 +
[[File:DisplayTesting.png|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/DisplayTesting.PNG]]
 +
 
 +
At this point, if everything is configured correctly, the LED Matrix should light up as shown below. It is possible that if you choose a testing mode that turns on every single channel on the matrix, the Power Supply will not be able to keep up with the load and the matrix could shut off.
 +
[[File:DisplayTestingPhysicalMatrix.jpg|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/DisplayTestingPhysicalMatrix.jpg]]
 +
 
 +
Click on the "Enable Test Mode" checkbox to stop testing the display. You are now ready to run the spectrogram program. Navigate to where the LEDMatrix git repository is cloned on your local drive. Then run Spectrogram.py.
  
 
== Highlights ==
 
== Highlights ==
  
Here is where you brag about what your project can do.
+
Our project includes an LED Spectrogram with 21 "dancing" bars that will change based off of the amplitudes of different frequencies. Our project also includes several different light modes that make for a variable and more enjoyable viewing experience. Check out our project in action at:
 +
https://www.youtube.com/watch?v=ckLPD1eVmR0
 +
 
 +
== Theory of Operation ==
  
Include a [http://www.youtube.com/ YouTube] demo the audio description.
+
A general overview of how our project works is shown in the figure below. A speaker outputs sound that is picked up by the microphone from our laptop. This audio signal is then processed to obtain its amplitude vs frequency. We then use this information to decide on the height of our LED bars which is communicated to the PocketBeagle from the host computer.
 +
[[File:Operation Overview.jpg|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/Operation%20Overview.jpg]]
  
== Theory of Operation ==
+
Looking more closely at our software, the following figure breaks down the logic flow. First we have to set up our connection with the Falcon Player that is running on the PocketBeagle. Then we set up the audio processing parameters and universe sizes for the LEDMatrix. Once these are set up, the program is constantly listening for audio input, performing a Fast Fourier Transformation on the audio to give us the amplitude vs frequency information, dividing these values into our specified ranges, converting these amplitude values to LED channel information for the universes, and sending the LED information to the PocketBeagle.
 +
[[File:Software Operation.jpg|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/Software%20Operation.jpg]]
  
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.
+
In order to better understand how we are utilizing the universes to control the matrix, we created the following figure. We chose the universe size so that each universe is two full vertical columns of LEDs. In total this means there are 96 universes from left to right. Our software starts on the left hand side with universe 1, and ends on the right hand side with universe 96. We specify each bar in our spectrogram to be 3 universes wide, or 6 columns of LEDs wide. As a result, we have the potential for 26 bars on the matrix. In order to make it look nicer and easier to see the separation between bars, we only utilize 21 bars and leave a universe between each bar that we don't write data to. Since the universes wrap around from top to bottom, each time an amplitude is calculated, zeros must be padded into the universe in order to make sure that both columns within the universe maintain the same height on the matrix.
 +
[[File:Panel Theory.jpg|frame|center|https://github.com/grinstba/LEDMatrix/blob/master/Setup/Panel%20Theory.jpg]]
  
 
== Work Breakdown ==
 
== Work Breakdown ==
Line 98: Line 182:
 
| 10/29/2019 || Gain root access to the Falcon Player || Brock primarily gained root access to the pocket beagle and allowed the pocket beagle to connect to the internet through a host computer
 
| 10/29/2019 || Gain root access to the Falcon Player || Brock primarily gained root access to the pocket beagle and allowed the pocket beagle to connect to the internet through a host computer
 
|-
 
|-
| 11/4/2019 || Control the LED matrix via a script running on the pocket beagle ||
+
| 11/4/2019 || Control the LED matrix via a script running on the pocket beagle || Blake and Brock worked together to figure out how to control the LED matrix with a python script. The script is found in the test folder of the project GitHub and is called [https://github.com/grinstba/LEDMatrix/blob/master/test/universeTest.py universeTest.py ]
 
|-
 
|-
| 11/9/2019 || Have the audio spectrometer fully working ||
+
| 11/9/2019 || Have audio input and frequency domain calculations working || Blake and Brock worked on different approaches on how to get audio input. In the end, we decided to capture audio on the host and have the pocket beagle control the LED matrices.
 
|-
 
|-
| 11/12/2019 || Read touch screen input ||
+
| 11/12/2019 || Have the audio spectrometer fully working || Blake worked on getting the bars of the spectrometer displaying with the given fft data.
 
|-
 
|-
| 11/16/2018 || Control LED matrix via touch screen ||
+
| 11/16/2019 || Add some flashy features to the spectrometer display || Blake worked on some addition features while Brock worked to control which feature is displaying via keyboard input
 
|-
 
|-
| 11/18/2019 || Final documentation ||
+
| 11/18/2019 || Final documentation || Blake and Brock worked on the final documentation here, on the GitHub, and on hackster.io
 
|}
 
|}
  
List the major tasks in your project and who did what.
+
== Future Work ==
  
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
+
It would be nice to have to pocket beagle capable of receiving audio, performing fft calculations, and control the LED matrices. Due to time limitation, we were not able to get everything working on the bone. In the future, it would be nice to do so.  
  
== Future Work ==
+
The LED matrices have a delay between hearing noise and updating. We managed to minimize this delay quite a bit, but using e1.31 multicast rather than unicast may allow us to further reduce this delay. The lower the delay, the better the spectrometer's appearance is as it will "react" more quickly and accurately to the sounds as they come in.
  
Suggest addition things that could be done with this project.
+
Another consideration for the future would be to reduce the noise the from the loud power supply that is needed to power the LED matrix. This could be done by creating a sound proof box for the power supply or by distancing the power supply from the microphone.
  
 
== Conclusions ==
 
== Conclusions ==
  
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
+
In the end, this project was an interesting challenge that provided us with the opportunity to test our signal processing skills and learn about how to configure, control, and reliably update the LED Matrix. Some fun potential additions could include detecting a song's BPM(beats per minute) using the audio signal and updating the bars colors or other patterns to the exact BPM of the music as opposed to it updating just amplitudes of the frequency ranges. Also, a touch screen could be interfaced to the LED Matrix to convert drawings on the Touch Screen to the LED Matrix.

Latest revision as of 08:19, 22 July 2020


Team members: Brock Grinstead and Blake Emmert

Grading Template

I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

00 Executive Summary
00 Installation Instructions 
00 User Instructions
00 Highlights
00 Theory of Operation
00 Work Breakdown
00 Future Work
00 Conclusions
00 Demo
00 Late
Comments: I'm looking forward to seeing this.

Score:  10/100

(Inline Comment)

Executive Summary

Audio Spectrometer Small.jpg

Our project involves interfacing with six LED matrices and audio input. The goal is to take the audio input, perform a frequency domain analysis, and then display the frequency spectrum onto the LED matrices as a spectrometer.


We managed to get audio input and perform frequency domain analysis on the host computer. The host is then sending pixel data to the pocket beagle that is using falcon player to control the LED matrices and create an audio spectrometer.


We had a lot of trouble getting audio input to the pocket beagle, so we kept this part on the host computer. Additionally, we were dealing with latency issues and decided the audio processing could run faster if performed on the host as it has significantly more processing and memory. We also experienced minor LED refresh delays that we weren't fully able to remove.


In the end, we were able to get our project working and it looks very nice when running.

This project is also available at: https://www.hackster.io/308270/beaglebone-led-audio-spectrometer-001868

Packaging

Audio Spectrometer Small.jpg

Our six LED matrices from Dr. Yoder came neatly mounted on a frame. Power cables then connected to each matrix. Two matrices could then be spliced to the same power cable and connected to our 130W power supply. Each row on the 2x3 setup was then daisy chained together via the data in and data out ports. The pocket beagle was inserted into the PocketScroller cape and connected to the two remaining data in ports, one for each row of our larger matrix. Finally, the pocket beagle was then connected to a host computer with a USB cable.

Installation Instructions

GitHub

The project is located on GitHub here: https://github.com/grinstba/LEDMatrix

Hardware

Here are the links for the specific hardware we used for this project.

We borrowed a six panel LED Matrix, power supply, pocket beagle, and pocket scroller cape from Dr. Yoder.

  1. LED Matrix - https://www.adafruit.com/product/2277
  2. Pocket Beagle - https://www.amazon.com/BeagleBone-Beagleboard-PocketBeagle/dp/B07663NS35
  3. Micro USB Cable - https://www.amazon.com/AmazonBasics-Male-Micro-Cable-Black/dp/B0711PVX6Z
  4. 16 GB Micro SD Card - https://www.amazon.com/Micro-Center-Class-Memory-Adapter/dp/B07K835MNR
  5. Pocket ScrollerV2 Cap - https://kulplights.com/product/pocketscroller/
  6. Power Supply - http://www.primelec.com/delta-130w-power-supply-networking-power-supplies-p9550014#.XdNN31dKhPY
  7. Power Supply Cables - https://www.newegg.com/p/1ET-000E-00034

Installation

Go to https://github.com/grinstba/LEDMatrix and clone the repository to your computer

Go to https://falcon-player.gitbooks.io/falcon-player-manual/content/chapter_three_installation/downloading_the_falcon_player.html and follow the instruction to download the latest falcon player image and then flash it to one of your SD cards. Make sure to download the Beagle Bone image and not the Raspberry Pi image. Also, we were not running the falcon player off of eMMC.


Once falcon player is installed, boot up your Beagle Bone and ssh into it with the following credentials:

  • username: fpp
  • password: falcon


By default the image we are running doesn't allow a root login. You will need a root login in order to get internet access on the Beagle Bone. In order to setup internet access, first ssh into the Beagle Bone with the default username and password listed above. The root access directions below are modified from https://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone

Then run the following commands on the Beagle Bone

bone$ sudo bash
root@bone# nano /etc/ssh/sshd_config

Search for the line

#PermitRootLogin prohibit-password

and change it to

PermitRootLogin yes

Save the file and quit the editor. Restart ssh so it will reread the file.

root@bone# systemctl restart sshd

And assign a password to root.

root@bone# passwd

Now open another window on your host computer and enter:

host$ ssh-copy-id root@bone

and enter the root password. Test it with:

host$ ssh root@bone

You should be connected without a password. Now go back to the Bone and turn off the root password access.

root@bone# nano /etc/ssh/sshd_config

Restore the line:

#PermitRootLogin prohibit-password

and restart sshd.

root@bone# systemctl restart sshd
root@bone# exit
bone$ exit


Now, on your host run the following command to get network information:

host# ip -a

For us, on a WiFi network running the ipMaskquerade.sh script in the following way works: and restart sshd.

host# ./ipMaskquerade.sh ens33

Then run the firstssh.sh script

host# ./firstssh.sh


Once connected to the the internet, go ahead and clone our GitHub project onto the pocket beagle from https://github.com/grinstba/LEDMatrix.


Once the projected has cloned, run the install.sh script to install the needed packages for the project to run.

User Instructions

Many of the following images and directions come from Mark A. Yoder's documentation found here


In order to light up an entire 32x64 LED panel white (Red, Green, and Blue all on), you will need at least a 5V 4A power supply. Each panel has a single power connection and a data in and data out connection. The data in connections control how the panel operates and the data out connections allow you to daisy chain the panels together to created a large display. The image below shows the connection.


Once the falcon player image has been flashed to an SD card, insert the SD card into your Beagle Bone and connect it to a host computer via USB cable. Browser to https://192.168.7.2 and you will see the falcon player control panel shown below.

You can use the settings in the control panel to set up the orientation of the LED Matrix. First switch the FPPD mode on the status page to bridged as shown below.

Then, navigate to the Input/Output Setup tab and click on "Channel Inputs". Configure 96 input channels to have a universe size of 384 as shown in the picture below.

In the same Input/Output Setup tab, click on "Channel Outputs". Configure 96 output channels to have a universe size of 384 as shown in the picture below.

Next, under the Input/Output Setup tab, navigate to "LED Panels". This is where you set up the way in which the Output Universes will be represented on the physical LED Panels. Set the Panel Layout to 2X3, the Single Panel Size to 64X32 1/16 Scan, and the Panel Gamma to 2.2. You may choose the brightness that you desire. The Color Depth is 8 bit and the connection is the Hat/Cap/Cape. The color layout of the LED Panels are RGB, meaning that each little square of light on the panel has 3 channels; a red channel, green channel, and blue channel. This means that in total there are 64X32X3 = 6144 channels per panel. Since we have 6 panels, we have 6144X6 = 36864 total channels. Set the wiring pinout to PocketScroller. Looking at the LED Panel Layout section, leave "View Config from front?" checked. Since the panel layout is 2X3, we have two physical output numbers and 3 panel numbers for each physical output. The left column of the "Front View" should be set to O-1 for each row with P increasing from 1-3 as you go from top to bottom. The left column of the "Front View" should be set to O-2 with P increasing from 1-3 as you go from top to bottom. The arrows should be pointing from the right column to the left column for each row. All of these settings are shown below in the figure. After inputting all of these settings, click save, and then click on the "Restart FPPD" at the top of the screen in the red box. Look at the arrows shown on the back of the physical LED Matrix to determine which way to place it so that its configuration matches the direction that you just set it up as on the Falcon Player. In order to match this setup, you want the horizontal arrows going from right to left and the vertical arrows pointing from top to bottom.

With the LED Matrix set up in this way, the bottom ribbon cable will connect into J1, and the top ribbon cable will connect into J2 on the PocketScroller. Power up the LED Matrix. At this point, within the Falcon Player you can navigate to Status/Control and click on the "Display Testing" tab. Set the end channel to 36864 and then select the checkbox that says "Enable Test Mode" as shown below.

At this point, if everything is configured correctly, the LED Matrix should light up as shown below. It is possible that if you choose a testing mode that turns on every single channel on the matrix, the Power Supply will not be able to keep up with the load and the matrix could shut off.

Click on the "Enable Test Mode" checkbox to stop testing the display. You are now ready to run the spectrogram program. Navigate to where the LEDMatrix git repository is cloned on your local drive. Then run Spectrogram.py.

Highlights

Our project includes an LED Spectrogram with 21 "dancing" bars that will change based off of the amplitudes of different frequencies. Our project also includes several different light modes that make for a variable and more enjoyable viewing experience. Check out our project in action at: https://www.youtube.com/watch?v=ckLPD1eVmR0

Theory of Operation

A general overview of how our project works is shown in the figure below. A speaker outputs sound that is picked up by the microphone from our laptop. This audio signal is then processed to obtain its amplitude vs frequency. We then use this information to decide on the height of our LED bars which is communicated to the PocketBeagle from the host computer.

Looking more closely at our software, the following figure breaks down the logic flow. First we have to set up our connection with the Falcon Player that is running on the PocketBeagle. Then we set up the audio processing parameters and universe sizes for the LEDMatrix. Once these are set up, the program is constantly listening for audio input, performing a Fast Fourier Transformation on the audio to give us the amplitude vs frequency information, dividing these values into our specified ranges, converting these amplitude values to LED channel information for the universes, and sending the LED information to the PocketBeagle.

In order to better understand how we are utilizing the universes to control the matrix, we created the following figure. We chose the universe size so that each universe is two full vertical columns of LEDs. In total this means there are 96 universes from left to right. Our software starts on the left hand side with universe 1, and ends on the right hand side with universe 96. We specify each bar in our spectrogram to be 3 universes wide, or 6 columns of LEDs wide. As a result, we have the potential for 26 bars on the matrix. In order to make it look nicer and easier to see the separation between bars, we only utilize 21 bars and leave a universe between each bar that we don't write data to. Since the universes wrap around from top to bottom, each time an amplitude is calculated, zeros must be padded into the universe in order to make sure that both columns within the universe maintain the same height on the matrix.

Work Breakdown

Date Milestone Notes
10/26/2019 Controll LED matrix with Falcon Player Brock primarily downloaded and installed Falcon Player to the pocket beagle. Blake primarily setup the LED matrix with the power supply and configured Falcon Player to control the LEDs.
10/29/2019 Gain root access to the Falcon Player Brock primarily gained root access to the pocket beagle and allowed the pocket beagle to connect to the internet through a host computer
11/4/2019 Control the LED matrix via a script running on the pocket beagle Blake and Brock worked together to figure out how to control the LED matrix with a python script. The script is found in the test folder of the project GitHub and is called universeTest.py
11/9/2019 Have audio input and frequency domain calculations working Blake and Brock worked on different approaches on how to get audio input. In the end, we decided to capture audio on the host and have the pocket beagle control the LED matrices.
11/12/2019 Have the audio spectrometer fully working Blake worked on getting the bars of the spectrometer displaying with the given fft data.
11/16/2019 Add some flashy features to the spectrometer display Blake worked on some addition features while Brock worked to control which feature is displaying via keyboard input
11/18/2019 Final documentation Blake and Brock worked on the final documentation here, on the GitHub, and on hackster.io

Future Work

It would be nice to have to pocket beagle capable of receiving audio, performing fft calculations, and control the LED matrices. Due to time limitation, we were not able to get everything working on the bone. In the future, it would be nice to do so.

The LED matrices have a delay between hearing noise and updating. We managed to minimize this delay quite a bit, but using e1.31 multicast rather than unicast may allow us to further reduce this delay. The lower the delay, the better the spectrometer's appearance is as it will "react" more quickly and accurately to the sounds as they come in.

Another consideration for the future would be to reduce the noise the from the loud power supply that is needed to power the LED matrix. This could be done by creating a sound proof box for the power supply or by distancing the power supply from the microphone.

Conclusions

In the end, this project was an interesting challenge that provided us with the opportunity to test our signal processing skills and learn about how to configure, control, and reliably update the LED Matrix. Some fun potential additions could include detecting a song's BPM(beats per minute) using the audio signal and updating the bars colors or other patterns to the exact BPM of the music as opposed to it updating just amplitudes of the frequency ranges. Also, a touch screen could be interfaced to the LED Matrix to convert drawings on the Touch Screen to the LED Matrix.