You are browsing as a guest. Sign up (or log in) to start making projects!

Smart LED strip

  • 3 Devlogs
  • 11 Total hours

A smart NeoPixel strip with 12 modes, with UI using a local WiFi server running on the same ESP32 and a ILI9341 based TFT touch display

Open comments for this post

5h 27m 20s logged


SMART LED strip (NeoPixel) Devlog#3


NeoPixel modes update:
I managed to finish the remaining 3 modes, random mode a.k.a. stars, and two soundbar modes. (Videos are included in the devlog).
I am having some problems with the noise sensor because it seems to not be reacting to normal music, only to extreme loud noises like blowing into the microphone. Also the value in quiet changes every day so I added the calibration function.


WiFi:
I also managed to finish part of the code that connect the ESP32 to the wifi network. I also added a code that synchronizes time. This was quite hard because I used a NTP server which return UTC time. And my country is UTC+1 and we have daylight saving time. But, after about an 1.5 hour I finally managed to find a public API that returns the UTC offset based on the location that it figured out using your IP adress. And it works!
(It took me such a long time because the APIs a have tried before requied HTTPS and my ESP32 didn’t have enougth RAM to manage it)


More detailed project description:
I have written 2 devlogs so far but I think I haven’t described my system enough. So, basically I am building a led strip for my room that will be controled by a display witch touscreen and a simple local web server. (if I don’t run out of RAM on my ESP32). It will have 12 modes and the parameters will be changable via the touchscreen and the web server. I am also planning to integrate a PIR sensor so that it can turn off the strip when I am not in the room (some parameters will be also changable here) and i will add a buzzer because I want it to serve as an alarm clock too. (I hope that light combined with sound will wake me up more easily :) ).


System achitecture:
I will run the neopixel mode functions on the core #2, because I want to make sure that the neopixel animations will run smoothly.
I have written functions to display the color picker UI, numeric keyboard and mode picker, as well as the functions that process thouch during these modes. I am planning to write on big function in which I will process the mode setting UI touch events, and a function that will display the mode setting UI.
Each time someone touches the diplay it triggers an IRQ which sets a flag, after that the touch is assigned to a touch handling function in the main loop.
I will probably use another IRQ for the On/Off button and one for the PIR sensor.
I will also write a function to start and stop running modes on core #2. Also an alarms function.
The web server will run in the main loop and the requests will be handled by a function that the mainloop will call.
Basically the main loop will can funtions and the functions will do something or call other functions. And IRQs will set flags to the main loop.

0
0
4
Open comments for this post

5h 32m 23s logged


Smart LED (NeoPixel) strip Devlog#2



Work done:

Today I have been working on the mode functions. I have managed to write 9 of them today, which means there are 3 left for tommorow. I think I will be dreaming about for loops tonight after this.
I have also fixed my HSV to RGB function because I found out that the fictional HSV color wheel was mirrored.



Future plans:

Tommorow I am planning to finish the mode functions, hook up an PIR sensor to the ESP32, so that the NeoPixel strip can turn off automatically when there is nobody in the room, and also write code that will process the noise level sensor raw values, so that they can be used in the soundbar mode.
I also want to start designing the display UI that will allow me to change the mode parameters, because I have only finished the numeric input, color input and mode picker so far.

0
0
5
Open comments for this post

15m 43s logged

Brief description:Creating display UI and planning the system architecture.


I am currently designing elements of UI that will be used to modify parameters such as modes, colors, speed and brightness.
Desining the color wheel was the hardest thing so far because I faced some problems with the framebuf library. (different way of storing information than my display library used) I used chatGPT to help me with this fix.


I have also written down all the modes that I want to create and also defined what parameters I want to change on them using the UI. I have also thought of a way how to store those parameters and how to run the modes. I am planning to create functions for each mode and then run them as threads.


I have also been solving some problems with HackaTime. (I have worked for at least 5 hrs not 15 mins) Because it does not support Thonny, so I decided to write the code in VS code and then run it on my ESP32 using Thonny.

0
1
89

Followers

Loading…