Skip to content

lvaroqui/smart-led-strip

Repository files navigation

Smart Led Strip

This repository contains everything linked to the Smart Led Strip that I showcase on my french Youtube channel. You can find the playlist here.

Project description

A Smart Led Strip controllable via home assistant with custom PCB, box enclosure for electronics, firmware and home assistant plugin.

Electronics

The Led Strip used is this one, it features 4 color channels: R, G, B, Warm White. We use the Arduino 33 IoT as our brain and some BOJACK IRLZ34N MOSFET for the power stage. Here is the schematics of the circuit:

Schematics

Firmware

The firmware uses PlatformIO instead of the default Arduino IDE.

IMPORTANT: before trying to build copy secret_example.h to src/secret.h and fill the missing data.

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:

{
    "method": "<your-method>",
    "param": ... // Optional param for some methods
}

Supported methods

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.

Get Status

Get the current status.

// Request
{
    "method": "get_status"
}

// Response
{
    "power": <0/1>,
    "r": <val>,
    "g": <val>,
    "b": <val>,
    "w": <val>
}

Get Info

Get various informations.

// Request
{
    "method": "get_info"
}

// Response
{
    "mac": <mac-address>
}

Set Power

Turn the power on or off.

// Request
{
    "method": "set_power",
    "param": {
        "value": <0/1>
    }
}

#### Set RGBW

Set a given color.

```jsonc
// Request
{
    "method": "set_rgbw",
    "param": {
        "time": <transition-time-ms>, // Optional
        "r": <val>,
        "g": <val>,
        "b": <val>,
        "w": <val>
    }
}


// No Response

Box

I desisgned a small enclosing box for the electronics using FreeCad and printed it on my 3D printer. The model can be found in the box folder.

Home Assistant

I wrote a basic Home Assistant plugin to control the Led Strip from a friendly user interface. It can be found in echow_led_strip. To enable it, place the folder in the custom_components folder of your Home Assistant installation. You can also add this repository as a HACS custom repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published