myRIO Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

myLightShow: Smart LED Display

 

myLightShow: Smart RGB String Lights

 

Imagine getting a string of LEDs, laying them on the floor in a random order and then them displaying a perfect rainbow.

 

myLightShow is an LED controller that can find the position of individual LEDs in a random arrangement in order to use them to display patterns. Its modular design allows for any number of LEDs to be used, and it can be controlled from any Wifi-enabled device such as a smartphone, a tablet or a laptop.

 

 

The Hardware

  • National Instruments myRIO 1900
  • 5 Volt Power Supply
  • WS2801 Individually Addressable RGB LEDs
  • USB Webcam

All the functionality of the myLightShow is made possible by the myRIO. The default FPGA personality of the myRIO is used to send commands to the LEDs using SPI communication. The myRIO's on-board WiFi is used to host the web-service which devices can connect to and control lighting modes and other functions.

 

We used a Mean Well RQ-125B power supply to power both the myRIO (12V) and up to 150 WS2812 LEDs (5 volts and up to 9 amps). This supply has a minimum current draw requirement on each of its 4 channels, so power resistors have been added to ensure that we don't drop below these currents.

diagram.jpg

 

The WS2801 LED driver was used for this project because it makes the LEDs individually addressable and easy to daisy-chain. RGB values for each LED pixel are sent to the drivers using SPI, where a shift register will pull values out of the communication and pass the rest of the commands through to the next driver/LED. We have mounted a table-tennis ball on each LED to improve light diffusion; Making it look much better and also larger, which makes it easier to acquire images of the light. With a more powerful power supply (and more table-tennis balls!), one could light up an entire room with a single myRIO!

 

We used a Logitech C270 webcam to allow the myRIO to capture images of the LEDs. It is possible to use any USB webcam, but some changes may need to be made to the Vision Acquisition part of the code, where the camera attributes are changed. It was important to change the exposure among other attributes and then process the images further in code in order to allow the myLightShow to calibrate in different lighting environments.

 

The Software

  • LabVIEW 2017
  • Vision Development Module
  • LabVIEW Real-Time Module
  • myRIO Toolkit

The LabVIEW Real-Time code is written with a queued message handler architecture to keep it readable, maintainable and upgrade-able. Tag messages are generated by a web service which is being run on the myRIO and handled by a real-time process in the main program.

 

The Vision Development Module is used to enable the myRIO to find the positions of each LED. When the "Calibrate" button is pressed, an LED is lit up red, and an image is then taken by the webcam. The myRIO then processes the image to find the x and y position of the lit up LED, and this process is repeated until every LED has been calibrated. LEDs that are not found by the myRIO are not lit up in the display as we do not know where they are, so would not be synchronised with the patterns.

 

The x and y co-ordinates of each LED are stored in a file on the myRIO, and automatically loaded whenever myLightShow powers on. This means that you do not need to calibrate them every time you turn them on; just whenever you've moved them!

 

Steps to Set Up

  1. Connect your LED strips and webcam.
  2. Plug the power cable into myLightShow.
  3. Connect a device to the myLightShow Wifi Network.
  4. Go to <IPaddress>:<port>/webservice (For example, ours is 172.16.0.1:8001/webservice).
  5. Enter the number of LEDs and press ‘Calibrate’ on your device.
  6. Once your LEDs are calibrated, you can switch between patterns using the 'Next Pattern' and 'Previous Pattern' buttons.

What next?

Due to the modular approach we took, and the architecture used when programming the device, it’s really easy for anyone to expand this project. Personally, we’re really keen to add the following functionality:

 

  1. Display information with the LEDs; imagine if the LEDs changed colour with the weather outside or showed a specific pattern when you received an email?
    • You could display a notification icon with enough LEDs!
  2. Add functionality to display photos with the LEDs, or even videos! We currently don’t have enough LEDs to provide a clear enough image, but it seems very possible!
    • Perhaps this could enable you to use the an LED strip as a screen!?
  3. Adding new and interesting patterns; for example, something similar to the old Windows screensaver.
  4. Add games to the strip where players can use their phones as a controller.

 

How can this LED string be useful? 

myLightShow is a cosmetic device, however a lot of the key technologies and algorithms which we use here could be used in more industrial applications: 

  1. You could use the LED detection algorithm to identify where dead pixels on a TV or monitor are as part of a production line.
  2. Large temporary displays where carrying big flat panels would be inconvenient and slow; perhaps at a festival? This is especially useful on uneven surfaces!
  3. Communicating with aliens in a time of need.

The Developers

My name is Kevin, and I worked on the vision acquisition and analysis functionality that made calibration of LED positions a possibility. I am doing a masters in Automotive Engineering at Loughborough University. I particularly enjoyed this project because it showcases the power of machine vision, which can be used extensively in autonomous vehicle navigation systems - an application that I am excited to explore!

 

Hey, I’m Jack. I focused on the real-time application's architecture, pattern algorithms and the SPI interface for the LEDs. I’m about half way through a Masters in Electrical and Electronic Engineering, also at Loughborough. I’m very interested in gadgets and the way devices are all starting to connect with each other to form the Internet-of-Things, so am excited that you can control the myLightShow with a phone!

 

If you have any questions or feedback, then feel free to reply below, or reach out to us on LinkedIn.

 

Acknowledgements

 Finally, there are some people which were very important for the success of this project and we’d like to share that here.

 

  1. Radim Stefan - Radim was the first to locate and control programmable LEDs with a myRIO and served as the inspiration for this project. You can see Radims video here.
  2. Sam Sharp - Sam made a fantastic project where you can play Tetris from your phone using a myRIO, and I’m sure you can see how this inspired us. We do, however, have our own implementation of the websockets from the myRIO. Importantly, he also used the same LEDs as we use and therefore we didn’t have to spend time finding the SPI settings for our LEDs as Sam had done the hard work for us! You can see Sam's project here.
  3. Amy Duke - Amy let us wrap her in lights for the video!
Comments
Member rastef
Member

Great job!
I am proud to inspire such a smart group of students and wish you many interesting and successful projects in the future.
Radim

Contributors