Close
0%
0%

Magic Hercules - driver for digital LEDs

MH is a beginner-friendly SPI driver for digital LED strips such as WS2812, etc. Lighting projects have never been so easy!

Similar projects worth following
162 views
The Magic Hercules module is a converter between the well-known and simple SPI to the NZR protocol. The module inputs have a tolerance of +3.3 V, so you can safely connect any microcontrollers operating at voltage of +3.3 V.

The use of the SPI protocol to control digital LEDs is an innovative approach among current solutions, such as ready-made libraries for Arduino. However, it allows switching to any platform regardless of the microcontroller family (such as ARM: STM / Cypress PSoC, Raspberry Pi, AVR, PIC, Arduino) and regardless of the programming language (e.g. C, Arduino C ++, Python or another that supports SPI protocol). This approach to programming digital LEDs is extremely beginner-friendly as all you need is knowledge of the SPI protocol.

MH module also allows several modes of testing digital LED strips, including testing the color order in the diode (RGB, BGR, RGBW, etc.), testing the entire strips or displays (up to 1024 LEDs).

I have been working with digital LEDs such as WS2812, WS2815 or SK6812 for a long time, which I usually call Magic LED.

I tested many strips, rings and displays (even my own) based on Magic LED (even with RGBW type). I used Arduino, Nucleo (with STM), Raspberry Pi and my own boards with AVR microcontrollers.

Regardless of the platform, writing a program to control magic LEDs is difficult (due to the need for NZR protocol software), unless you are using ready-made libraries that make it easy, but still not fully optimal in terms of code usage, interrupt responses, or memory utilization, and only work on specific platforms (porting them to e.g. from Raspberry to AVR microcontrollers is impossible).

Due to the fact that I often use various platforms, I had the need for the program code to be as compatible as possible with Arduino, Raspberry Pi, ARM / STM (Nucleo) or AVR - especially when it comes to lighting effects.

I have been working on the youtube channel for a long time and I have prepared more than one guide on programming digital diodes in C language for AVR microcontrollers (but so far only in Polish for now). I often have contact with beginners who struggle with programming magic LEDs. Of course, some, depending on the platform, choose ready libraries for their one-time projects. However, many people look for other solutions or try to learn the secrets of programming and I am one of them.

I decided to prepare a module that will do the dirty work for the user using the NZR protocol. The module that will act as SPI to NZR converter and just like SPI, can be used on any platform with ease. The screenshot below shows the conversion of SPI signals to NZR protocol in the Magic Hercules module.

When connecting digital LEDs to different systems, one should remember about the appropriate voltage tolerance for different microcontrollers. Most of the I / O pins of ARM microcontrollers work in the +3.3 V standard, while the AVR microcontrollers work in the TTL standard. Due to this, the input pins of the Magic Hercules module have a tolerance of +3.3 V, so they can be safely connected to eg a Raspberry P or any ARM based microcontroller powered +3.3 V.

As I mentioned before, I often work with different types of digital LEDs. Depending on the manufacturer, individual colors in the LEDs can be in different positions, e.g. RGB, BGR, GRB, RGBW, GRBW, etc. It's not uncommon for the manufacturer's documentation to mention the RGB sequence, but it actually looks different. I have equipped the Hercules module with a color sequence test so that there is no problem with quickly figuring out how to write a program for the correct color order. Several additional functions of the tester allow you to quickly check whether the digital LED strip works at all, whether all the colors in each LED across the strip (up to 1024 LEDs!) Are working correctly (no dead pixels). And all this without connecting a microcontroller and writing any program.

I don't think there was such a thing yet, to control digital LEDs using a simple and common SPI protocol, which can be operated on any platform or family of microcontrollers.

Of course, there are many ways to control digital LEDs, some are more optimal and others are less optimal. The Magic Hercules module is another option and very practical for me.

I think that someone may like this unusual solution. I recently took off on the crowdfunding platform - kickstarter, where I prepared a broader description of the Magic Hercules module in several videos, including how easy it is to work with it on Arduino, Nucleo (STM), Raspberry Pi and on AVR and PIC microcontrollers. If you would like to support the Magic Hercules project, check this out:

My Magic Hercules module project on kickstarter

I prepared a program in C language - a simple stargate effect, which is based on table operations and sequential sending of the buffer in the main loop. Thanks to the Magic Hercules module, I was able to easily...

Read more »

  • 1 × Arduino 2560 One of the platforms on which the Hercules magic module was tested - Arduino C ++
  • 1 × ATB Andromeda 1.05a Atnel Development Board 1.05a - One of the platforms with which the Magic Hercules module was tested - C for AVR
  • 1 × STMicroelectronics STM32 Nucleo-64 Board One of the platforms on which the Hercules magic module was tested - C for ARM/STM
  • 1 × Raspberry Pi 4 Model B One of the platforms on which the Magic Hercules module was tested - Python for Raspberry Pi

  • 1
    Magic Hercules module with Atmega32 and C

    Video containing a simplified diagram, connection presentation on ATB 1.05a (AVR Atmega32), source code (in Eclipse C/C++ IDE) and the final effect in the form of a stargate light effect.

  • 2
    Magic Hercules module with Arduino and Arduino C++

    Video containing a simplified diagram, connection presentation on Arduino 2560 board, source code in Arduino IDE and the final effect in the form of a stargate light effect.

  • 3
    Magic Hercules module with PIC and C

    Video containing a simplified diagram, connection presentation on ATB 1.05a with PIC shield (PIC24FJ64GA004 on board), source code in MPLAB and the final effect in the form of a stargate light effect.

View all 5 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates