Like every self-respecting magpie I adore all bright and shiny stuff.
And definately, electric LED garlands comes into this category.
Unfortunatly, these lights come to my attention when New Year has just passed.
But Hey! I hope this is not our last New Year and we have enough time to get better prepared to a new one!
Step 1: What Is This About?
Not long time ago an ultimate electric lights garland has appeared on the market.
It is a LED garland, where the color and the brightness of each RGB LED may be controlled individually with WS2811 chip. This chip may be implanted directly into the LED. Such LEDs may be found under APA106 name on www.aliexpress.com. They looks like ordinary 4-pins RGB leds with common anode\catode, but they are not! Each APA106 LED conatins an integrated WS2811 chip, which should be programmed to turn LED on. If you buy APA106 LEDs on Aliexpress, I advise you to check them immediately - it is not rare occasion when customer got usual RGB led instead APA106!
Also these WS2811 chips may be packeted as external board with ordinary RGB led attached to it. All these lights comes in various forms and numbers.
The only common thing for them - they would not lit up without controller.
Some modification of WS281x chip exists - they play random colors without controller, but it is not interesting for us because they can not be programmed.
Step 2: Necessary Parts
So parts for the project were ordered and arrived eventually:
1) 2 x 50-LEDs water-proof WS2811 strip. These strips may be connected one to another to extend LEDs number. They would not lit up all by themselves, so some controller needed.
2) An ESP8266 chip in very convinient form-factor: WeMos D1
I like this board - it is very compact and easy to deal with.
3) It is not necessary, but these parts also may come handy:
- an IR receiver TL1838
- small extension boards for WeMos
- small shield with button for WeMos
4) It would be a good idea to get some powerful 5v PSU, because the LED strips are power-hungry - especially if you set it all to bright-white.
This PSU may do well: Power supply 5v 8A. I developed this project with PSU from mobile phone with 1A output current. It works well enough until you raise brightness. At least ESP8266, LED strip and 5v 1A PSU survived all my effort.
Step 3: Bla Bla Bla
All parts are on hands at last, but what to do with them?
Program one or several effect into controller and that is all? Too simple.
What is the difference from all existing garlands?
As you may see from my previous public project: PasswordKeeper - KISS for girls, we are not looking for easy ways!
So the idea of garlands must be complicated somehow. I hope not till point of unusability ;)
It would be good to allow to control our lights behavior somehow.
Almost everyone now had some kind of smartfone, which can connects to internet.
ESP8266 is a WiFi enabled module. So the idea of controlling garlands with WEB interface comes quite naturally from here.
But not everyone is a computer geeks and would be able to deal with programming and WEB interface. What a pity, Eh ;) So an ordinary IR remote may be attached to switch pre-programmed effect. And if you want to be a dead simple - a button would do. In two last cases you would need a geek anyway to program these effect into your contraption first ;)
To simplfy lights effect programming further I added BMP play mode.
Just throw some colored lines on a picture in any graphic editor, save picture as BMP, load them to controller and select BMP play mode. Controller will load BMP to garland line-by-line with delay, which may be programmed.
On this page you see BMP picture with 3 color lines and a video, which show how this picture looks like when played by controller. It shows how you may create your own pattern.
And when you create something nice to eye - please be so kind - share them with rest of community!
Step 4: The Idea
Quick search had not produced any similar projects on the net.
Obviously, peoples had more important thingh to do than invent another useless chindogu.
Well, let's correct this flaw.
The idea is to create a device that may play text script to produce various effects on LEDS.
This script may be easily edited with web interface on-line and new effect is in the place immediately.
Of course, this may be achieved with ordinary programming language. But you would need at least a compiler to change effect. And what if you just don't want to fire up your big PC but became bored with current effect? Problem!
But this complication may be solved if controller has text interpreter and its input may be changed on-line.
So I created come kind of virtual machine and developed bird language which this machine understands. This software, being loaded into ESP8266, allows to create rather complicated LED switching algorithms.
This project was inspired by my internal magpie, so the language should be the bird one to please it!
Step 5: Wiring
I would not come into details how to install and config Arduino IDE for working with ESP8266.
There are a lot resources on the net where all process explained in every detail.
All nececcary libraries are mentioned in document WebLights_En.rtf. And provided with source.
The wiring is simple.
The button and IR receiver are not necessary, but handy.
Long press (6 sec) on button resets device to default state and loads default script.
Ordinary cliks switch between effects (if they are programmed into script) or BMP files.
If you attach IR receiver, you may assign effects to remote buttons. Just press button on IR and then refresh WebLights page. There is a 4-symbol variable on web page, named IR code. Get that code and replace xxxx in (LLxxxxc:c) command with it. Then every time when this code is found on IR subroutine LL will be called.
This connection is a little barbaristic - it would be good to put 3v->5v level shifter between ESP8266 and lights. But it's work with direct connection too - if line between controller and garland is not too long.
There is one more hack that may increase stability - insert any diode into +5v line that powers first LED. It will shift logical level of One of first LED a bit down.
Step 6: A Couple of Words About Software
Just put WebLights directory into your Arduino projects folder, open it and select Weblights.ino.
Copy content of WebLights\libraries\ folder to your Arduino projects folder.
Build and load it into ESP8266.
By default device started in AccessPoint mode.
It creates WiFi network WebLights with password weblights. Just enter any WEB url and you will be redirected to controller page. For example: wl.com.
Also simple script of dot running back and fors is loaded to device. I provided several simple scripts, which you may load to contraption to see how they looks. You may use them as a starting point to develop other effects.
Step 7: Quality Testing
Device was ruthlessly tested on poor helpless creatures and proved to be safe.
No animals were harmed during this test ;)
Step 8: Conclusion
I would be delighted if some magpie will take effort (or pains) to develop some scripts or pictures, which produce interesting visual effects and share them with community in this thread.
Drawing pictures may looks easy, but create picture which produse smooth and interesting effect may be not so simple.
Magpies are not flock birds, but why not to have some place where they can share and exchange some shiny stuff (or scripts\pictures)? I think, this thread may do perfectly.
Here is an interesting site with patterns