Skip to content

Commit 33f93b9

Browse files
committed
Update README.md
1 parent e24a881 commit 33f93b9

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Smart Led Strip
2+
3+
This repository contains everything linked to the Smart Led Strip that I showcase on my french Youtube channel. You can find the playlist [here](https://www.youtube.com/watch?v=J8o0olcY1OM&list=PLjJ8MpspHf32UaKSQNDGwbeBrOrvNWHvA).
4+
5+
## Project description
6+
7+
A Smart Led Strip controllable via [home assistant](https://www.home-assistant.io/) with custom PCB, box enclosure for electronics, firmware and home assistant plugin.
8+
9+
## Electronics
10+
11+
The Led Strip used is [this one](https://www.amazon.fr/gp/product/B01D1I50UW/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&th=1), it features 4 color channels: R, G, B, Warm White.
12+
We use the [Arduino 33 IoT](https://store-usa.arduino.cc/products/arduino-nano-33-iot) as our brain and some [BOJACK IRLZ34N MOSFET](https://www.amazon.fr/gp/product/B0893WBH6H/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1) for the power stage. Here is the schematics of the circuit:
13+
14+
![Schematics](Schematics.png)
15+
16+
## Firmware
17+
18+
The firmware uses [PlatformIO](https://platformio.org/) instead of the default Arduino IDE.
19+
20+
**IMPORTANT**: before trying to build copy [secret_example.h](src/secret_example.h) to `src/secret.h` and fill the missing data.
21+
22+
We expose a simple HTTP server that controls the LED. There is one allowed route: `http://<board_ip>/command` with POST method and a specific JSON querry. The querry should always have this form:
23+
24+
```jsonc
25+
{
26+
"method": "<your-method>",
27+
"param": ... // Optional param for some methods
28+
}
29+
```
30+
31+
### Supported methods
32+
33+
The LedStrip uses floats from 0 to 1 to represent color channel intensity. When you see `"r"`, `"g"`, `"b"` or `"w"` in the table, the associated value will be a number between 0 and 1.
34+
35+
#### Get Status
36+
37+
Get the current status.
38+
39+
```jsonc
40+
// Request
41+
{
42+
"method": "get_status"
43+
}
44+
45+
// Response
46+
{
47+
"power": <0/1>,
48+
"r": <val>,
49+
"g": <val>,
50+
"b": <val>,
51+
"w": <val>
52+
}
53+
```
54+
55+
#### Get Info
56+
57+
Get various informations.
58+
59+
```jsonc
60+
// Request
61+
{
62+
"method": "get_info"
63+
}
64+
65+
// Response
66+
{
67+
"mac": <mac-address>
68+
}
69+
```
70+
71+
#### Set Power
72+
73+
Turn the power on or off.
74+
75+
````jsonc
76+
// Request
77+
{
78+
"method": "set_power",
79+
"param": {
80+
"value": <0/1>
81+
}
82+
}
83+
84+
#### Set RGBW
85+
86+
Set a given color.
87+
88+
```jsonc
89+
// Request
90+
{
91+
"method": "set_rgbw",
92+
"param": {
93+
"time": <transition-time-ms>, // Optional
94+
"r": <val>,
95+
"g": <val>,
96+
"b": <val>,
97+
"w": <val>
98+
}
99+
}
100+
101+
102+
// No Response
103+
````
104+
105+
## Box
106+
107+
I desisgned a small enclosing box for the electronics using [FreeCad](https://www.freecadweb.org/) and printed it on my 3D printer. The model can be found in the [box](box) folder.
108+
109+
## Home Assistant
110+
111+
I wrote a basic [Home Assistant](https://www.home-assistant.io/) plugin to control the Led Strip from a friendly user interface. It can be found in [echow_led_strip](echow_led_strip). To enable it, place the folder in the `custom_components` folder of your Home Assistant installation.

Schematics.png

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)