New Year is coming. I still love Micropython and Telegram. Again I decided to combine them on esp8266. This time I made a matrix of address LEDs, which controlled by Telegram bot.
Telegram bot, which works on esp8266, receives messages and depending on them switch modes. I made only three modes: ping pong, fire and heart. You can also print the text as a running line, but only in Russian.
To repeat the project, it is important to have experience with Micropython on esp8266. Otherwise, it will be very difficult for you to understand how it works. What will be needed to repeat the project:
Microcontroller esp8266. I am using a Wemos D1 mini board.
Address LED strip. In my matrix, I used 72 address LEDs. It turned out a matrix with a width of 12 and a height of 6 LEDs. Not a very good size, but this is due to the fact that I did not find more successful frame for attaching strip.
Powerful power supply. The matrix consumes a lot of electricity, so the usual charging from the phone is not suitable. I use a 5 volt 3 amp power supply.
How to make the matrix you can seen in pictures. My code is written for the matrix, the first led of which is in the lower left corner and then it goes as letter "S". If you do it differently, you will have to make changes in the code to correctly determine coordinates. The matrix power is connected to the Wemos D1 mini (5v - 5v, gnd - gnd). Power supply is connected there too. The middle wire from strip is connected to pin 2 (D4). You can connect to another and make changes in the code. I also connected a voltmeter to observe the voltage drop, but this is not necessary.
As I wrote, all the code is written in Micropython. First you need to flash Micropython firmware. Use command
esptool.py --port COM3 --baud 460800 write_flash --flash_size = detect 0 esp8266.bin
with the correct port and firmware name. It is important that the firmware from the site will not work, because for the bot, it was necessary to increase the parameter RT_EXTRA = 5120 otherwise it will not work. I have assembled the firmware with the desired parameter and it can be downloaded from git (1.11 Micropython). After that upload all files boot.py, api.py, nmp.py, main.py, the modes folder with the files basic.py, ticker.py. You will also need the requests library. It can be downloaded at https://github.com/micropython/micropython-lib/blob/master/urequests/urequests.py and also uploaded to the board. By the way, I use Thonny (https://thonny.org/) as IDE for Micropython. Next, you need to configure all the necessary parameters.
In the boot.py file, you need to enter your ssid and password from your wi-fi.
In the main.py file, you need to specify the pin to which strip is connected and its dimensions (width and height) and the token for the Telegram bot. How to register bot and get token look on the Internet. There is a lot of information.
I don't want to write too many details. If you read the code, everything will become clear.
You can modify the code to fit your needs, add new modes, add commands to control. You can write your comments or additions on github. Good luck