Even though the ESP8266 WiFi chipsets are really cheap (and can be somewhat challenging to work with), they still pack a lot of processing power. For instance, [Mr.jb.swe] took one of these modules and made a stand-alone live VU meter with WS2812B LED strip. The VU runs entirely on the ESP chip, without any additional microcontroller. It’s an example we think a lot of projects could follow to do away with unused horsepower (extra microcontrollers) sometimes used to avoid programming directly on the ESP. The stuff you can do with these modules is wild… did you see this WiFi signal strength mapping project?
The ESP chipset acts as a UDP client which receives packets from a WinAmp plugin that [Mr.jb.swe] wrote. The plugin continuously calculates the dB of whatever track is playing and streams it over WiFi to his ESP8266. He also mentions that the ADC of the ESP chipset could be used to sample audio as well, although that pretty much eliminates the need for WiFi.
The whole setup is very responsive even though the processor is parsing UDP messages, driving the WS2812 strip, and driving a small OLED display for debug—and it doesn’t even use a separate microcontroller. [Mr.jb.swe] also posted snippets of his code to get you started on your own project. Check out the videos after the break to see it in action.
I think calling this a “Stand-alone Live VU meter” is to take it a bit too far. It’s actually just a remote display unit for winamp, it doesn’t do any metering itself. Would a microcontroller, connected by USB to the PC, driving a LED strip also be at “stand-alone” unit?
Still, a cool hack…. But connecting a microphone and doing the fourier analysis on the ESP would be even cooler – and then streaming that data to the PC instead :-)
true, it’s just a proof of concept .. this project is standing on shoulders of others like CNLohr and Boris Ribov
>But connecting a microphone and doing the fourier analysis on the ESP would be even cooler
I think there is more then enough horsepower…fix_fft 8-bit shouldn’t be a problem….but is the ADC up to the task thats the big ?? ( It might be necessary with an spi controlled ADC…but I hope not )
I hope/believe this is within reach for the Esp8266
https://www.youtube.com/watch?v=tCmaOb-VAEo
Do you even need a “fourier analysis”? I’m not familiar with what, if any, frequency-domain weighting is used in a VU-meter, but surely that weighting can be realized in the time domain with an FIR or IIR filter, then take a rolling RMS average?
What sort of processing power does this chip have? Like what are it’s specs?
http://bit.ly/1AkbS1N
;)
I kid.
https://nurdspace.nl/images/e/e0/ESP8266_Specifications_English.pdf
You get a 80mhz 32bit risc processor, 128k RAM, a full b/g/n wifi stack and 512k – 4m spi flash for around $2.5 . If you want you can install nodeMCU, which is essentially a lua interpreter on the uC you can code directly on.
This is the full pack of features: https://github.com/esp8266/esp8266-wiki/wiki
A great aggregation of information comes from nurdspace: https://nurdspace.nl/ESP8266
Dont forget http://www.esp8266.com ! :-)
80MHz that can be bumped up to 160MHz
Im beginning to suspect it might be enough to decode mp3 onboard ESP
The data traffic does take some CPU tough, I’ve seen things stutter quite badly. There are of course solutions.
What is the maximum latency you’re seeing? I’m thinking about using this to transmit ~2kB data packages with about 20+ Hz, but need a low latency (~20ms)… Is this realistic with WiFi and/or the ESP8266?
Take a look at the delay at the end of Cnlohr’s demo program top.c
https://github.com/cnlohr/ws2812esp8266/blob/master/top/top.c
I think I’ve gone as low as 800us ( 160MHz mode)….then the Esp8266 will “choke” and restart, maybe a watchdog related problem…
Thanks for the answer. So you could send a message every ~2ms. Did you measure (or have an idea of) the delay between sending a message and the data actually arriving and being displayed at the ESP8266? For audio applications this latency should ideally be max. 20ms, otherwise it may become noticable…
if it’s perfect you can do it, in reality you’ll get noticeable lag. even with a dedicated AP in a relatively wifi free location i’d see lag.
Cnlohr’s demo program top.c generates a pattern any irregularity’s will be noticeable by the eye …but I guess the ear might be more sensitive to short differences. Note that I have only received with Esp8266 ( guess sending will be easier )
“and driving a small OLED display for debug”
I believe this is just the power-meter in between the battery and the esp8266.
So this is not at all ‘driven’ by the device, nor does it do any ‘debugging’.
Partly true.
In my current setup I’m also driving an OLED and showing VU meter data while controlling the WS2812.
The Esp8266 has plenty of horsepower…..
But your ‘current setup’ is not what we see in the article or project-description ;)
Is there anything I should be aware of when ordering ESP8266’s on ebay? Thanks
Wi07-12 is a good choice ( if you don’t need an external antenna )
Be aware of which modules use 2.54mm pitch headers and which use 2mm.
Non-intuitive but the on-pcb zigzag antennas are better than the ceramic bars.
Community site here.
http://www.esp8266.com/
Loads of info on the different boards