2016-12-25 08:52:54 +01:00
# audio-reactive-led-strip
2016-12-27 09:35:56 +01:00
Real-time LED strip music visualization using the ESP8266 and Python
2016-12-28 01:29:10 +01:00
![block diagram ](images/block-diagram.png )
2016-12-27 09:35:56 +01:00
2016-12-28 01:29:10 +01:00
![overview ](images/description-cropped.gif )
2016-12-27 09:35:56 +01:00
# Demo (click gif for video)
2016-12-28 01:29:10 +01:00
[![visualizer demo ](images/scroll-effect-demo.gif )](https://www.youtube.com/watch?v=HNtM7jH5GXgD)
2016-12-27 09:35:56 +01:00
# Overview
The repository includes everything needed to build an LED strip music visualizer (excluding hardware):
2016-12-27 10:27:07 +01:00
- Python real-time visualization code, which includes code for:
2016-12-27 09:35:56 +01:00
- Recording audio with a microphone ([microphone.py](python/microphone.py))
- Digital signal processing ([dsp.py](python/dsp.py))
- Constructing 1D visualizations ([visualization.py](python/visualization.py))
- Sending pixel information to the ESP8266 over WiFi ([led.py](python/led.py))
- Arduino firmware for the ESP8266 ([ws2812_controller.ino](arduino/ws2812_controller/ws2812_controller.ino))
2016-12-27 10:27:07 +01:00
# What do I need to make one?
The following hardware is needed to build an LED strip music visualizer:
- Computer with Python 2.7 or 3.5 ([Anaconda](https://www.continuum.io/downloads) is recommended on Windows)
- Any ESP8266 module with RX1 pin exposed. These modules are known to be compatible (but many others work too):
- NodeMCU v3
- Adafruit HUZZAH
- Adafruit Feather HUZZAH
2016-12-27 10:27:40 +01:00
- Any ws2812b LED strip (such as Adafruit Neopixels)
2016-12-27 10:27:07 +01:00
2016-12-28 02:18:01 +01:00
# Installation
## Python Dependencies
Visualization code is compatible with Python 2.7 or 3.5. A few Python dependencies must also be installed:
2016-12-27 10:27:07 +01:00
- Numpy
- Scipy (for digital signal processing)
- PyQtGraph (for GUI visualization)
- PyAudio (for recording audio with microphone)
On Windows machines, the use of [Anaconda ](https://www.continuum.io/downloads ) is **highly recommended** . Anaconda simplifies the installation of Python dependencies, which is sometimes difficult on Windows.
2016-12-28 02:18:01 +01:00
### Installing dependencies with Anaconda
Create a [conda virtual environment ](http://conda.pydata.org/docs/using/envs.html ) (this step is optional but recommended)
```
conda create --name visualization-env python=3.5
activate visualization-env
```
Install dependencies using pip and the conda package manager
```
conda install numpy scipy pyqtgraph
pip install pyaudio
```
### Installing dependencies without Anaconda
The pip package manager can also be used to install the python dependencies.
```
pip install numpy
pip install scipy
pip install pyqtgraph
pip install pyaudio
```
If `pip` is not found try using `python -m pip install` instead.
2016-12-27 10:29:27 +01:00
## Arduino dependencies
2016-12-28 02:28:03 +01:00
ESP8266 firmare is uploaded using the Arduino IDE. See [this tutorial ](https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon ) to setup the Arduino IDE for ESP8266.
cThis [ws2812b i2s library ](https://github.com/JoDaNl/esp8266_ws2812_i2s ) must be downloaded and installed in the Arduino libraries folder.
2016-12-25 08:52:54 +01:00
2016-12-27 10:29:27 +01:00
# Setup / Getting Started
Information coming soon. README is currently under active development.