RGB LED strip controller + mini Weather station, built using the Arduino platform.
cli/
: Python scripts for building and uploading the projectsrc/
src.ino
: Entry pointconfig.h
: Pin mappings, refresh rates, device versionenv.h
: WiFi configcomponents/
: Hardware componentsdomain/
: System logic
curl -X POST '<controller_ip>/light/toggleAnimated'
curl -X POST '<controller_ip>/light/hexColor/<hex_color>'
curl -X POST '<controller_ip>/light/brightnessAnimated/<brightness>'
The project is configured to be used with the VSCode editor for editing comfort, but can definitely be
built with just the arduino-cli
and python 3
.
-
Create a copy of the
.vscode/c_cpp_properties.example.json
file and rename it to.vscode/c_cpp_properties.json
-
Install the Arduino extension
-
Install the required libraries using the "Arduino: Library Manager" command from the command palette.
- DHT sensor library by Adafruit
- AsyncTimer by Aasim-A
- ArduinoJson by Benoit Blanchon
-
Run the "Arduino: Rebuild IntelliSense Configuration" command from the command palette.
-
Create a copy of the
src/env.example.h
file and rename it tosrc/env.h
.- Fill in the required values for the WiFi SSID and password.
-
Install the
arduino-cli
tool from here -
Run the
compile.py
script.
python3 cli/compile.py <version_number>
The script will create a build/bin
directory and place the binary in it.
The binary will be named <version_number.bin
and can be uploaded to the micro controller using the arduino-cli
tool.
There are two ways to upload the binary to the micro controller:
-
arduino-cli
tool: required for first time upload. -
OTA update (Over The Air): can be used for subsequent updates.
Requires the board to already have the sketch on running and connected to your local network.
Run
- Build the project using the
compile.py
script. - Run the following command to upload the binary to the micro controller
TODO: Add explanation for the cli arguments
arduino-cli upload -i ./build/bin/<latest_version>.bin -b esp8266:esp8266:d1_mini_clone -p /dev/cu.usbserial-130
-
- Build the project using the
compile.py
script.
- Build the project using the
-
- Start the update server (skip if already running)
python3 cli/server.py
-
- Send a
POST
request to thesettings/version/update/
endpoint of the micro controller
curl -X POST '<controller_ip>/settings/version/update/<update_server_ip>/<update_server_port>/update'
- Send a
- WeMos D1 mini (micro controller)
- DHT22 (temperature & humidity sensor)
- LM2596S Step-down voltage regulator
- IRLZ44N (N-channel, logic-level MOSFET Transistor) x 3
- 10kΩ Resistor x 4
- 5.5X2.1mm DC Power jack
- SMD 5050 RGB Strip