Showing posts with label LED. Show all posts
Showing posts with label LED. Show all posts

Friday, 19 January 2018

Software and electronics for driving 5725 LEDs

Following on from my previous post about the touch controller I will now talk about the software and electronics we are using to drive the 5725 LEDs.

All software is written using Python, mostly utilizing OpenCV and Numpy for their great image manipulation cpabilities. The LEDs we will be using are designated SK9822, these are going to be spaced at 15 LEDs per meter, these are not usually made in this size so we incurred a higher than expected cost when ordering them. The triangular panels will consist of several strips of the LEDs spaced at 15 strips per meter, this gives us an LED density of 225 LEDs per square meter. This density was selected for manageability of the overall LED array and for power reasons. The image below shows a render of the LED layout, this render will be used for generating our pixel map.



We had originally thought we would go with the WS2812B LEDs as these are cheaper than the SK9822 but the latter has a global brightness control which allows for much better low brightness colour depth which is an area I have found the WS2812s to be lacking in. I have built a few LED projects using the WS2812B LEDs and have noticed serious flicker noticeable when videoing the LEDs, this is another area the SK9822s excel in as they have a PWM frequency of 4.7kHz versus the 430Hz of the WS2812. More detail on these LEDs can be found at Tim's Blog.

WS2812B left SK9822 right

Driving the panels of LEDs will be 5 Teensy micro controllers, handling 4 panels each, a single Teensy could theoretically drive all of the LEDs but this was decided against due to wiring complexity. The main computer running the majority of the software will send the RGB pixel data over USB to the micro controllers. The Teensy will be running a library called FastLED to control the LEDs, this means it is just acting as a buffer between the main computer and the LEDs.

Apart from the touch input software discussed last post there are a number of different pieces of software we have written. One is a tool to define the LED layout, you upload an image or render of the array and that is displayed on screen, using mouse clicks on either end of a string of LEDs and entering the number of LEDs between, it allows you to quickly define the layout of any shaped array. We now have our LED array defined and the coordinates from our touch input device so we needed to combine these to generate our output to be sent to the LED controllers.

The first control program is relatively simple, we take the touch coordinates from our touch dome, look for the closest corresponding pixel in our LED array and set the colour of that pixel to white (or any colour of our choosing). This pixels information gets stored in an array which will then be sent on to the LED controllers. This is just the beginning and only a basic feature set is implemented, in the future brush size and colour will be changeable on the fly using designated spots on the touch input dome as the input.

In order to see what is happening on the LED array without having to assemble the physical array we wrote a bit of software which renders an approximation of the array on the computer screen. This allows us to quickly test the software stack without the hassle of dealing with hardware.

For powering everything we will have a 240V to 48V DC 30A supply consisting of 4 server power supplies in series, these will be located on the ground in a safe, electrically insulated cabinet. The 48V from this will run to each of the LED panels and then on each panel a 48V to 5V DC 15A power supply will be used to regulate the voltage to the LED and micro controllers. The total power consumption at full white will be approximately 1700W which is slightly over what the power supplies are rated at, it will be very rare for us to display full white on all the LEDs so I have deemed this to be safe, even so there will be fuses at each power supplies output. In the photo below I am load testing a single 48V to 5V supply, in the background you can see the four 12V server power supplies.


The wiring of the dome will be quite a task by itself, I have chosen the Deutsch DTM series of connectors as they are waterproof, reliable and reasonably cheap. They will allow the wiring loom to be disconnected from each part of the system and packed up by itself, this should aid in transport and storage.

Next post I will discuss the mechanical construction of the geodesic dome. For all software information please see our github here.

Friday, 29 December 2017

Camera based spherical touch surface for an interactive light show


For several years I have been fascinated with geodesic domes and LED lighting. To bring together these two passions of mine I, along with a few friends, plan to fit 5725 LEDs inside of a 6 meter diameter geodesic dome. To make it interactive there will be a touch based controller in the middle of the 6 meter dome to allow people interact in real time with the lights around them.


The display will be made up of 20 triangles with around 300 LEDs in each, this makes it necessary for quite an interesting layout and control scheme which is what we have spent the last few months working out. This project will be split up into a few different posts. We will start with the touch input device and related software. Next I will discuss the software and hardware for controlling the LED array. Later comes the labor intensive tasks of building the steel dome, assembling the LED panels and all the wiring to go between everything.

A spherical touch input device is not a novel idea and has been implemented many times before. I found inspiration in a Microsoft research paper found here (pdf), I decided to try a similar approach using cheap commercially available hardware and open source software. I commissioned a local plastics forming company to make a ~500mm diameter dome from translucent polycarbonate plastic using a pressure forming tool. This was chosen because it was the cheapest option available, this has a downside in that the opacity is not consistent. At the peak of the dome the plastic has been stretched the most is significantly thinner than around the lower edges. I was able to work around this in software which I will explain later.


A wide angle monochrome USB camera from ebay is used for sensing, I specifically asked the vendor to supply the camera without an infra red cut filter. In front of the camera is an infra red longpass filter to get rid of all the visible light coming into the camera. Inside the lower edge of the dome I placed infra red LED strips (made by de-soldering a white LED strip and adding my own digi-key bought IR LEDs), these flood the inside of the dome with infra red light. When a finger comes into contact with the outside of the dome it reflects the infra red light, this is picked up by the camera. I used this method because there will be a lot of coloured lights around and want to give my camera the best chance of picking up touches. The image below is what the camera sees.


The software for the touch input uses openCV and python to manipulate and extract information captured by the camera. The image processing involves the following process:
  1. A calibration image is taken with no finger touches and is stored. This gives us our baseline to compare against. 
  2. Subsequent images taken by the camera have the calibration image subtracted from them. This results in only the bright reflections caused by finger touches to show up. 
  3. A blob detection function in openCV is used to find the coordinates of the bright spots. This gives us our touch coordinates which can be used for anything. 
The video below shows the dome working as a mouse input for my computer. At this point I had not switched over to using IR LEDs and was relying on visible light.


Next post I will talk about the software and hardware required for driving the 5725 LEDs. If you are interested in the software all our source files are available on github here.

Wednesday, 29 March 2017

Making signs for Blazing Swan

Over the past couple of months myself and a couple of friends have been making signs for our theme camp, Moon Base, for Blazing Swan 2017. The main signage will be going on our entrance way (pictured below).

Making the sign body and wiring up the electronics took the vast amount of time in this project. There was several hours of milling to make the various parts of the sign. The lettering inlays are made of lightly spray painted poly-carbonate sheets I cut out in my mill.
The sign below is for our (water) bar.  All of the signs were cut on my CNC mill and are made of veneered plywood marketed as Formply. I used this after trying MDF and the Formply cuts much cleaner as it chips a lot more than the MDF which turns into more dust sized particles.


The signs will be mounted above our entrance way to our camp on a sheet of plywood so I have epoxied some nuts on the inside of the signs so I can bolt them onto the entrance without any visible fasteners.
 

The signage will be out in the elements for several days so I built the electronics into a sealed ABS box. All the connectors are reasonably waterproof, if the weather gets ridiculously wet I can easily detach the box and bring it under cover. We are using a Teensy 3.2 micro controller to drive the main logo and MOON BASE signs and an Arduino Pro Mini micro controller driving another smaller sign.

I attached all of the LEDs to the milled out pieces of plywood and painted all the necessary areas white to reflect the light as much as possible. The logo has 5 individual strip driven through an Ethernet cable with a two core power cable. The MOON BASE signs use microphone cable and connectors which are cheap and readily available.



I used silicone to attach the poly-carbonate lettering to the main body of the signs. Double sided tape and short wood screws hold the backing onto the main body. After assembling I then went and painted a couple of layer around the edges and sealed the gap between the backing and main body. This should all ensure the signs are weatherproof.

My friend Jon wrote the Arduino sketch to run the signage so all points for the animations go to him. The source code can be found at github.com/vanbujm/Moonbase. We used the FastLED library to drive the LEDs at the low level.