ERU: LED Lighting Installation — Conclusion

Jesse, Micheal, and Mack

We met some difficulties once the LED strip finally arrived. The LED strip is ordered in units of one meter lengths, but when we ordered three of these units we were shipped with a single three meter long LED strip. This isn’t too much of a problem moving forward, as there are detailed instructions for cutting up the strip into distinct sections. Actually, since the three of us all live together, we might decide to keep the strip intact and write API functions for less personal features. Perhaps instead of email notifications, it provides an colour meter for the outside whether in the morning. So we’ll think about where we do want three disjoint meters, or a communal lightstrip to program. The next shipping frustration was that the leads to connect the strip to the Arduino was actually soldered onto the wrong end of the strip. Initially we thought that the entire strip was dysfunct, but since we were aware that the strip could only function unidirectionally (there was an input and output side) we checked to see if the leads were soldered in the right orientation. They were not! Once we decide whether we want to keep the strip together, we must then solder on new leads.
Once we sorted out some of the initial hardware setbacks, we got into playing with the Arduino software and programming the actual strip. This is where the strip really shines (ha). There is an open source library available online that makes operating the strip easy with very simple and intuitive functions. For instance, there is a function which allows us to easily light up a certain LED, i, on the strip a colour, c.
strip.setPixelColor(i, c);.
Changing the function, we could light up all LEDs before a certain LED with one colour. colorChase(strip.Color(c), 100);.
Making use of these two functions we can modify our proof of concept single RGB LED code to light up the strip. The Python code uses functions we’ve defined to call subloops within the Arduino. So when we receive an email, python uses a function to call the Arduino subloop to turn our single LED to our desired colour. Instead, now that we have the strip, we can simply modify the Arduino code to turn our entire LED strip that colour or perform a different behaviour. Further, because we modularized the code into functions and subloops, we are ready to implement new features as we think of them. We can easily add a new API into python, interact with a new function in the python script which will call a new subloop triggering new light behaviour. The project is easy to expand, and the LED strip is a great piece of hardware to tinker with.

Posted in Blog, Electronics for the Rest of Us! Tagged with: ,

Leave a Reply

Your email address will not be published. Required fields are marked *