Inspiration

With COVID-19, the world has been forced to stay safe inside their homes and avoid social contact, a measure which has taken a noticeable toll on everyone’s mental well being. With All of the Lights, individuals can connect in new and fun ways with products that they likely already own - RGB light strips.

What it does

All of the Lights is a web-enabled LED strip control system. It allows friends to synchronize their lights and remotely participate in each other's lives.

Note: The devices made for this project use only a short LED strip as proof of concept. In real use, the device would be mounted with the user's LED strip that typically runs around the perimeter of their ceiling, controlling the lights for an entire room.

Users access our web app to choose a different light pattern depending on whether they want to study together, party, or just chill. Each All of the Lights device is updated with the new pattern, immediately changing everyone's lights.

All of the Lights has several different modes or patterns, including:

  • White Light (On or Off)
  • Slow colour fading for vibing
  • Fast colour jumping for parties
  • Custom colour patterns (such as Blue-Orange fading)
  • Pomodoro Study Mode With the Pomodoro Study Mode, users can use their LED lights as a way to boost their productivity by changing colour when they should take a break from studying, then returning to the original colour to notify the user to resume studying.

How we built it

All of the Lights is primarily a hardware hack. We began with a rough device circuit diagram to determine the necessary components and used CAD to design a enclosure to be 3D printed. While waiting for the prints, we split up to work on the two major components: creating a circuit to control high-power LEDs and interfacing between Raspberry Pi's to synchronize the devices.

The control circuit uses an ATtiny84 microcontroller to drive 3 MOSFET transistors which adjust the brightness of each 12V RGB channel. This utilizes Pulse Width Modulation (PWM) to access the entire range of colour values. To control the light patterns, the Raspberry Pi sends a 32 bit serial packet to the ATtiny. This packet contains the red, green, and blue values, as well as information about whether the colours should fade or not and the duration of the current pattern element. Using a system inspired by floating point integers, an accurate duration between 10 milliseconds and 3 hours can be specified using just 9 bits.

All of the Lights supports several nodes in the local network using Python threading and sockets combined with Flask to submit GET requests from the localhost. One Raspberry Pi is used as the server node, which retrieves a string from the Flask server containing information about desired light pattern. The server Pi supports multiple client Pi’s to join its network and updates each with the pattern data upon a new POST to the server. The clients and the server all send a serial message to the ATTiny on the LED driver board to change the light colours.

Challenges we ran into

With the tight time constraints of this Hackathon, waiting for 3D prints to finish could be the difference between complete a product and not. To avoid this, we had to design our 3D printed case before having a concrete list of parts that would be enclosed. This required making intelligent design decisions to estimate how parts would eventually fit together in the case, without being too tight or oversized.

The serial communication between the Raspberry Pi web client and ATtiny LED driver board was made difficult by the different logic levels of the two devices. A voltage step-up circuit was needed to convert the 3.3V serial output from the Pi to a 5V serial input for the ATtiny. This required several prototype circuits that tried using diodes or MOSFETs, but the finally solution uses a double bipolar transistor inverter to accomplish the step up.

With the current system, one of the All of the Lights devices acts as both a client to the web app and a server to the other devices. This means that it must simultaneously fetch data from the web app, relay this information to each client, and control its own LEDs via serial. Organizing all of these concurrent tasks required lots of integration testing to get right.

Accomplishments that we're proud of

We focused heavily on modularizing both the hardware and software components of this project to facilitate future development. This was a rewarding endeavour as we got to see all of the modules, such as the LED driver board, power circuit and LED strip being seamlessly integrated.

As a project that required many interactions between hardware and software, there were many challenges and bugs during the Hackathon. However, after finally fixing all of the issues, it was a great accomplishment to see a physical, real world device behaving exactly as we had designed, even if that meant pulling an all-nighter to see it work at 7:30am! We are especially excited about this device since we intend on further developing All of the Lights for us and friends to use.

What we learned

One of the main features of this project is the various device interactions. We learned how to use sockets to interface between Raspberry Pi's, how to collect information from a web server with Flask, and how to communicate over serial between devices with different logic levels.

We also improved our engineering soft skills, primarily teamwork and communication. Throughout the competition, our team members frequently discussed the objective of each component of the project, allowing us to work in parallel and design hardware or code that would be relatively easy to integrate later on.

What's next for All of the Lights

With all of the technical groundwork complete, All of the Lights possessed the necessary hardware and software requirements to expand out and create more intricate and useful LED patterns. The localhost server is a crucial aspect to the build, and currently allows people of the same household to connect to and control the lights from any browser. The server will eventually be deployed to the web, allowing people to connect their lights from anywhere in the world. Additionally, All of the Lights will allow users to use the Spotify API to synchronize music on a device with their LED lights. Finally, more productivity features will be implemented to allow users to structure their day. All of the Lights will launch a custom alarm setting, and let users be naturally woken with lights simulating the sunrise. Thanks to its modular design, launching custom settings on a device has never been easier!

Built With

Share this project:

Updates