Showing posts with label ws2812. Show all posts
Showing posts with label ws2812. Show all posts

Sunday, 26 July 2026

WS2812 LED Project Idea

Introduction 
This short blog offers a simple solution for creating an LED light using WS2812 modules. The idea is meant as an example for students wanting to design their own LED light as a low-powered lamp replacement, entertainment device, outdoor garden light or any similar LED light devices.

Inspiration
It can be interesting for students to frequently mix up the electronic devices they are asked to conceptualise, design and build. From a post by the author Wech Holger on Hackster.io, a WS2812 LED software solution was sourced and updated for a different PSoC device. The post provided an idea for the LED light and a subsequent separate microcontroller project for students with varying technical capabilities.

WS2812 Connection Diagram
WS2812 Connection Diagram

Hardware
Focusing on the LED portion of the design, off-the-shelf WS2812 modules were selected. For this example design, four Adafruit #1426 modules with 8 x WS2812 LEDs were connected in series.

Generic WS2812 LED Strips with Headers
Generic WS2812 LED Strips with Headers

Two interconnecting boards were used at the electrical ends of the LED modules to make the series circuit.

For the hardware layout, the LED modules are arranged on a circular circuit board as shown below.

Example WS2812 Interconnecting Circuit Boards
Example WS2812 Interconnecting Circuit Board

The role of the interconnecting boards was to provide power and to gang the series IN-OUT communication connections. Several modules could be connected in this fashion.

Extract of WS2812 Light Schematic

Extract of WS2812 Light Schematic

To connect the LED modules, pin headers and sockets were fitted. The design could be simplified in several ways. One solution could be to remove the sockets and then solder pin headers directly to the interconnecting circuit boards.

Testing
To test the LED design, the example project Outlook-LED.cywrk from Hackster.io was rebuilt for an Infineon CY8CKIT-059 development board. The communications wire bus was moved to a new pin - P1.7.

PSoC Creator Updated Pin Mapping for Outlook-LED.cywrk
PSoC Creator Updated Pin Mapping for Outlook-LED.cywrk

The image below shows the LED board fitted into a garden LED bollard.

LED Bollard used for WS2812 Testing
LED Bollard used for WS2812 Testing

In the clip below, three LED colours were tested. The colour selection was activated using the terminal interface provided in the example PSoC project.

Wednesday, 13 August 2025

Republishing a WS2812 PSoC Creator Project

Introduction 
This short blog republishes a PSoC Creator project that uses a WS2812 component. The WS2812 is an addressable RGB LED, as seen in common devices such as LED strips. The original post with the PSoC Creator Project, ‘WS2812 and 5LP @ 48 MHz’ was posted in the Infineon Developer Community with the project named ws2812_test.cywrk_.Archive01.zip.

Reason to Republish
Four development boards, the micro:bit, Arduino, PSoC, and STM, were chosen for comparison. Most of those boards have been or are currently used in education, and they have a broad sample of projects with code spread across community forums and sites.

Project Example to Compare Development Boards
The addressable RGB LED (WS2812B) was chosen as the example project since LED strips are engaging with students. Example projects were found for all but the PSoC4 part 
CY8C4245AXI-473. The Modus Toolbox PSoC development environment from Infineon supports NeoPixels, but an example did not seem to be available for the PSoC4. The target audience for this project was at the education level, so off-the-shelf and ‘working’ examples were preferred.

Using Modus Toolbox, the CY8C4245AXI-473 PSoC microcontroller was not listed under the ‘Select device part numbers'.

Modus Toolbox BSP Assistant - Device Part Numbers
Modus Toolbox BSP Assistant - Device Part Numbers

A related development kit, CY8CKIT-042, associated with the same PSoC4, was not listed under the Modus Toolbox ‘Select BSP template’.

Modus Toolbox BSP Assistant - Template
Modus Toolbox BSP Assistant - Template

Understandably, the target PSoC is an older device, so some limitations were anticipated. Of course, a PSoC6 development kit could be used with the NeoPixel LEDs, but that was hardly a fair comparison against the slightly slower micro:bit or Arduino.

Finding a WS2812 PSoC4 Example Project
A WS2812 library was available for PSoC5, 
CY8C5888-LP097, by the author, Mark Hastings (Cypress Semiconductor). The example project for the WS2812 was taken from the Infineon community forum, but the project is several years old and contains broken component dependencies.

Later, I was to find another PSoC WS2812 project from the same author called FunWithLEDs. This project contains comprehensive examples of the WS2812.

Rebuilding the WS2812 Example Project
Opening the Top Design in the WS2812 PSoC5 project, some missing components were shown.

Missing Components in PSoC Top Design
Missing Components in PSoC Top Design

The missing library was not included with the WS2812 project, so this was found on another site and copied into the project's root folder.

Added WS281xlib to Project Folder
Added WS281xlib to Project Folder

To correct the missing library component in the PSoC project Top Design, the Dependencies menu in PSoC Creator was used to perform an update.

PSoC Creator Dependencies - StripLightLib Error
PSoC Creator Dependencies - StripLightLib Error

The existing dependency for the WS2812, called StripLightLib, was removed.

Lastly, the dependency for WS281xLib was added to the project dependencies, now pointing to the copy in the project’s root folder. 

PSoC Creator Dependencies - WS281xLib
PSoC Creator Dependencies - WS281xLib

The downloaded WS281xLib contains the StripLightLib library and several others worth exploring.

Contents of WS281xLib Folder
Contents of WS281xLib Folder

The missing component issue was resolved in the projects Top Design, as pictured below.

Updated Components in PSoC Top Design
Updated Components in PSoC Top Design

Compiling the project resulted in no further issues.

Complied QS2812 PSoC Creator Project
Complied WS2812 PSoC Creator Project

The PSoC target was changed to the CY8C4245AXI-473. Finally, the development board was programmed and subsequently used for the development kit evaluation.


Downloads
The dependency WS281xLib and the updated project for PSoC5, built for PSoC Creator 4.4, are available below for download. All intellectual property rights and licenses for the libraries and PSoC Projects, including those belonging to Mark Hastings, Cypress Semiconductor, and related parties, are retained and owned by those entities.

WS281xLib
WS281xLib

ws2812_test
ws2812_test