Skip to the content
PCBKitNew board
4 layers70 × 40 mmController, the printed circuit board in 3D

A ESP32 based LED-Controller for various light scenarios

Size
70 × 40 mm
Copper layers
4
Thickness
1.6 mm
Parts
108
Nets
78
Pads
357
Tracks, vias
947, 175
Pours
5
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
25 Oct 2020
Updated
3 Jun 2021

Overview

Controller is an open-source printed circuit board by Gustice, from the Gustice/LightController repository on GitHub, published under the MIT licence. It is a 4-layer board of 70 × 40 mm with 108 parts on 78 nets, routed with 947 tracks and 175 vias.

It is built around the ESP32-WROOM-32, LMR62421XMF and 74AXP4T245BQX, with the SS24FL among its other parts. Its parts include 52 resistors, 22 capacitors, 13 connectors, 6 diodes and 5 ICs. It belongs with the ESP32 boards of this library.

Main components

4

README

README.md

LightController

A ESP32 based LED-Controller for various light scenarios.

Purpose

This project is intended to be used as base platform for various Light projects. Its based on the ESP32 WiFi SoC and utilizes the Espressif development framework (ESP-IDF).

On top of that this is a small hardware and board abstraction layer that simplifies the hardware access and provides further bases for device implementation.

The main purpose is of course to have fun an learn several new techniques and hacks. I also hoped to dig into a promising WiFi platform that enables a wide band of applications. As I happily discovered it was absolutely worth the time and I'm glad that I didn't stuck to arduino.

The intended Products that should result from this are extreme fancy night lights for bedrooms of my children and the stairwell and low key disco lights / ambient lights for the living room.

Platform

This platform is capable of driving most LEDs I encountered so far (at least the very most common LEDs I have seen so far).

Main Board

  • Ordinary RGB-Stripes (optionally with white channel)
  • Serial LED-Stripes of both both types
    • Most common WS2812 (with RTZ-protocol)
    • Less common APA102 (with easy to use SPI)
  • I2C-Expander for single or chains of LEDs

The main board integrates two switches, two analogue inputs and 1 encoder to be integrated in controlling of the station. It also can utilize a UART interface to other protocol bridges or a infrared interface which are also both prepared (the IR-Interface would come at cost of one digital function).

The board also aims to drive short LED-strips solidly with 5 V power supply. Hence it integrates also a small boost-converter.

The next picture shows a block diagram of the platform. Note that the expander board is not designed yet and the main-board will be eventually redesigned to be smaller an perhaps also provide a battery management circuitry.

Block Diagramm of Light platform

The next picture shows the first Device I build up. It is solidly for implementation purpose.

Function Demonstrator

The next picture shows a web GUI page to control the LED colors. It currently only supports to control exactly the first LED of each channel.

Web GUI

Usage

There is currently not very much useful stuff going on. But to get faster familiar with this project this could help you to read.

The device is flashed in three steps. One can use the VS-Tasks defined in the Firmware-Project for it:

  • Flash & Monitor: Builds and flashes the app to target. Note that certain config files will be remain missing until also the parameter partition and webserver partition is also flashed.
  • Flash Data-Image: Flashes the config files on the parameter partition (therefor the folder factoryCfg is packed to binary and flashed)
  • Flash Web-Image: Flashes the files for the webserver to the server partition (therefor the folder serverPages is backed to binary and flashed)

After powerup the device provides a WiFi-access point.

  • SSID cLight
  • Password FiatLux!

You can connect to the device and display the root page by typing e.g. "192.168.4.1/" (at least in my case). On this page you see some (currently) little relevant in formation and can navigate to set up your WiFi-parameter or to setup the Lights.

  • If you setup the WiFi-parameter the next time the device will try to connect to the provided station. You can Reset the parameter by pressing button 1 at start up
  • If you setup the LEDs you currently can only setup the first LED-slave.

Development

The development is done in Visual Studio Code so far. To be able to join the development you must have the IDF installed. Add also the path to the installed IDF as system path variable.

Note: This project is based on the idf version ESP-IDF v4.2-dev-1034-ge599b794b. I missed the step to stick to a certain tag or something. Sorry for that. You pretty sure will have to make minor adaptions on things like Queues or Wifi parameter.

However, to be able to compile the code you must start vs code from command line with exported environment variables

  • Open console in your project path
  • Type %IDF_PATH%\export.bat to setup the environment for used toolchain
  • Type code . to open current path in VS Code
  • No you are able to start build-process by just hitting Ctrl+Shift+B

To be able to flash your ESP you need a USB to UART bridge, that also exposes RTS and DTR pins. These are needed to reset and set the ESP32 into programming mode.

Architecture

  • The main applications instantiates the driver and starts the web server.
  • Each component is in charge of an more or less well defined part of the whole structure
    • Filesystem reads the files from data-storage and partly interprets them
    • LightEffect is in charge of conduction the soft switching of the lights and provides all color definitions
    • MyConnect is a component to establish wifi connection by either providing a network in Access-Point mode or connection to an Access-Point.
    • MyWeb provides the http-server and the Rest-API
    • MyHal is a composite of simple c++ modules to simplify the usage of the SoC hardware
    • Devices utilizes MyHal to drive different devices connected to the main board
  • The flash is divided in 3 main partitions.
    • Program flash
    • Data-storage
    • Web-storage
  • The web-server is build in a way similar to a single-page-application manner, but not that strictly. Most content is intended to be generated dynamically on page. The data is intended to be set or fetched via rest-requests.
  • Device-IDs and device configuration are read from data-storage. The http-webserver, provides the whole webpage from web-storage.

Note: Many of the components are partly ore even mostly tested by unit-tests (that are run locally on the computer not on the SoC). Currently catch2 is used as test-framework.

Note: You can also use the ServerMock.py script to emulate parts of the behavior of the http-webserver. At least display and the navigation across the websites. Also partly demo data is already generated.

Issues

This project is anything but finished. I have several open tasks and they somehow appear to increase rather than getting less.

  • Status LEDs don't display any status yet (just fancy blink codes).
  • Linear power states with configurable current flow are not designed yet.
  • Wide parts are written more in c-style rather than c++. Sorry i was a little in hurry

ToDos

  • OverTheAirUpdates would be nice
  • Design for linear Endstage (expander board)
  • Adaption of ZigBee
  • Logging should be switched to network path. Means some network placed destination must be configured as logging destination.

Parts

108
QtyValueFootprintReferences
1910kResistor_SMD:R_0603_1608MetricR3, R10, R11, R12, R13, R14, R15, R16, R28, R29, R30, R31, R37, R38, R48, R49 +3
12100nFCapacitor_SMD:C_0603_1608MetricC3, C4, C5, C6, C7, C8, C9, C12, C13, C15, C16, C18
11100RResistor_SMD:R_0603_1608MetricR18, R19, R20, R21, R26, R27, R43, R44, R45, R46, R47
70RResistor_SMD:R_0603_1608MetricR1, R5, R7, R17, R22, R23, R39
5NCResistor_SMD:R_0603_1608MetricR24, R25, R40, R41, R42
40RResistor_SMD:R_1206_3216MetricR33, R34, R35, R36
41uFCapacitor_SMD:C_0805_2012MetricC17, C19, C20, C21
4IRLML2030Package_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4
310uFCapacitor_SMD:C_1206_3216MetricC1, C2, C10
3SS24FLDiode_SMD:D_SOD-123D3, D5, D6
22x4 2mmConnector_PinSocket_2.00mm:PinSocket_2x04_P2.00mm_Vertical_SMDJ11, J12
24,7uFCapacitor_SMD:C_1206_3216MetricC14, C22
2470RResistor_SMD:R_0603_1608MetricR4, R6
2NCResistor_SMD:R_0805_2012MetricR51, R52
2PH-S3BConnector_JST:JST_PH_S3B-PH-SM4-TB_1x03-1MP_P2.00mm_HorizontalJ4, J8
2PH-S4BConnector_JST:JST_PH_S4B-PH-SM4-TB_1x04-1MP_P2.00mm_HorizontalJ3, J9
2PH-S5BConnector_JST:JST_PH_S5B-PH-SM4-TB_1x05-1MP_P2.00mm_HorizontalJ5, J6
2SW_SPSTButton_Switch_SMD:SW_Push_1P1T_NO_6x6mm_H9.5mmSW1, SW2
110 uHInductor_SMD:L_Taiyo-Yuden_MD-4040L1
12.2kResistor_SMD:R_0603_1608MetricR2
156pFCapacitor_SMD:C_0603_1608MetricC11
174AXP4T245Package_SO:TSSOP-16_4.4x5mm_P0.65mmU2
186kResistor_SMD:R_0603_1608MetricR32
1AP1117-33Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1EN12-VS11AF18_ProjectParts:RotaryEncoder_EN12-VS11AF18SW3
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U3
1LMR62421XMFPackage_TO_SOT_SMD:SOT-23-5U4
1Micro_SD_Card_DetConnector_Card:microSD_HC_Molex_104031-0811J13
1PH-S2BConnector_JST:JST_PH_S2B-PH-SM4-TB_1x02-1MP_P2.00mm_HorizontalJ2
1PH-S6BConnector_JST:JST_PH_B6B-PH-SM4-TB_1x06-1MP_P2.00mm_VerticalJ10
1SH-BM6Connector_JST:JST_SH_BM06B-SRSS-TB_1x06-1MP_P1.00mm_VerticalJ7
1TSDP341xxOptoDevice:Vishay_MOLD-3PinU5
1USB_B_MicroConnector_USB:USB_Micro-B_Molex-105017-0001J1
1blueLED_SMD:LED_0603_1608MetricD4
1greenLED_SMD:LED_0603_1608MetricD1
1redLED_SMD:LED_0603_1608MetricD2

The 106 most common of 108 parts.

Questions

How big is the Controller PCB?

It measures 70 × 40 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Controller use?

108 parts, built around the ESP32-WROOM-32, LMR62421XMF, 74AXP4T245BQX and SS24FL. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Controller KiCad files?

From the Gustice/LightController repository on GitHub, at the commit this page was made from: the board is CircuitBoard/ControllerPCB/Controller.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Controller design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 4 layers189.9 × 136.5 mmZturn36, the printed circuit board in 3D

    Zturn36

    mrieker/pdp8l

    PDP-8/L project files

    62 parts1
  • 2 layers50 × 70 mmTime2time, the printed circuit board in 3D

    Time2time

    Resaj/time2time

    Chronometer with partials measurement for the line-following competitions

    97 parts5
  • 4 layers83 × 106 mmAsynthosc, the printed circuit board in 3D

    Asynthosc

    everedero/asynth2osc

    Modular analog synth to OpenOSC bridge

    268 parts4GPL-3.0
  • 2 layers58 × 28 mmTheKNOBDaughterboard, the printed circuit board in 3D

    TheKNOBDaughterboard

    makerust/TheKNOB

    In: File > Preference > Additional Boards Manager URLS Add: https://dl.espressif.com/dl/packageesp32index.json, http://arduino.esp8266.com/stable/packageesp8266comindex.json Select: Tools > Board > Board Manager Search…

    51 parts1
  • 2 layers119 × 79 mmHome Ambient, the printed circuit board in 3D

    Home Ambient

    abrahanlp/Home-Ambient

    2-wire home thermostat with temperature, humidity, pressure and air quality measures.

    62 partsAGPL-3.0
  • 2 layers109.8 × 41.5 mmBase, the printed circuit board in 3D

    Base

    AL-255/Flora2

    Numitron Clock

    59 partsCERN-OHL-S-2.0