mohan-bee/light-controller

This code defines the hardware sections and symbols for a PCB involving USB power, voltage regulation, ESP12F module, RGB outputs, I2C sensors, and debug points, along with rendering labels for test points.

Version
1.0.30
License
unset
Stars
2

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone mohan-bee/light-controller  # download the package files into ./light-controller
tsci add mohan-bee/light-controller    # add it to your project as @tsci/mohan-bee.light-controller

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

docs/ADDRESSABLE_STRIPS.md

# Optional Addressable LED Strips

The board's normal J2 output is made for a four-wire analog RGB strip. Every LED on that type of strip shows the same color.

For a moving tail, chase, rainbow, or a different color on every LED, use a three-wire addressable strip such as **WS2812B**, **WS2812B ECO**, or **SK6812**.

## Important limitation

An addressable strip does **not** connect directly to J2. J2 contains three MOSFET-switched analog color outputs, not a digital LED-data output.

The easiest connection on the fabricated board uses the `SDA` hole as the LED data signal:

```text
Addressable strip    Light-controller board
5V                -> +5V
GND               -> GND
DIN               -> SDA (GPIO4) through 330–470 Ω
```

Connect to the strip's **DIN** end, not DOUT. The arrows printed on the strip should point away from the controller.

Using GPIO4 for LED data means the three I²C sensor headers cannot be used normally at the same time. Their SDA holes are all connected together. Choose either:

- I²C sensors with the normal analog RGB output, or
- An addressable strip using GPIO4 for individual LED control.

## Power

A short strip with only a few LEDs at limited brightness can be tested from the board's 5 V supply. Addressable LEDs can draw a lot of current when many pixels show bright white.

For a longer strip, use a separate regulated 5 V supply:

```text
External supply +5V -> strip 5V
External supply GND -> strip GND and board GND
Board GPIO4         -> 330–470 Ω resistor -> strip DIN
```

The grounds must be joined or the data signal will not have a common reference. Do not feed the external 5 V supply backward into USB-C.

## Firmware

Install either **FastLED** or **Adafruit NeoPixel** from Arduino IDE's Library Manager. Set the data pin to GPIO4:

```cpp
constexpr uint8_t LED_DATA_PIN = 4;
constexpr uint16_t LED_COUNT = 30;
```

Change `LED_COUNT` to the actual number of pixels in your strip. The existing `WIFI_LIGHT_CONTROLLER` firmware controls the board's analog RGB outputs. Individual-pixel animations require an addressable-strip firmware version using one of these libraries.

## Safe first test

1. Disconnect power while wiring.
2. Connect GND first, then 5 V and DATA.
3. Set a low brightness in the program.
4. Test with five or ten LEDs before connecting a long strip.
5. Confirm that the ESP8266 remains stable and no connector, wire, fuse, or regulator becomes hot.