Create a LEDs-powered Cloud! ☁️⚡️✨ by@remy
599 reads

Create a LEDs-powered Cloud! ☁️⚡️✨

Read on Terminal Reader

Too Long; Didn't Read


Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Create a LEDs-powered Cloud! ☁️⚡️✨
Remy Virin HackerNoon profile picture

@remy

Remy Virin

iOS dude

About @remy
LEARN MORE ABOUT @REMY'S EXPERTISE AND PLACE ON THE INTERNET.
react to story with heart

At Prynt, we have creativity days, we work on everything we want for few days. I believe this is really important to have some time you can work on something else for your company. A colleague did some art paint in our office, another create slack emoji of everyone in the company, I decided to create this cloud with the help of some colleagues (by the way, we name it Claudie).

As you can see in the video, you can plug the cloud to any trigger that will light his LEDs. For instance if someone likes your Facebook page, a transaction made in your shop etc…

image

How to build Claudie? ✨

First we started with this video from instructables, it’s a great start, but it wasn’t easy to build something solid that won’t break, acrylic roads are quite expensive and the glue doesn’t really stick to. The goal here is to have a structure that is really light.

So after trying to build something with acrylic roads, we decided to take a cardboard and put bubble paper wrap around it to give to more a cloud form. After we tapped the LEDs on the bubble paper. Finally, we followed the procedure with the vinyl fabric and the polyester fiberfill shown on the video.

What you will need technically 🛒

Disclaimer: We made this cloud with all the followings components, there is many ways to do it, you can use an Arduino instead of a Raspberry Pi, use different types of LEDs.

Wiring The Pi & the LEDs 🛠

This is how you wire the Pi and the LEDs, the diode is really important, it will reduce the input DC voltage from 5V to 3.3V, so the Pi which is delivering a voltage from 0 to 3.3V on the PWM will be able to control the LEDs. If you don’t put the diode, your Pi might be destroyed. This article is a great source if you want to understand why.

image

Image courtesy of Adafruit

Deploying the code on the Raspberry Pi 👩‍💻

If you are not familiar with the Raspberry Pi environment, the setup is really easy. You just have to download Raspbian and install it on a SD Card. The installation documentation is really helpful.

The rpi_ws281x is the lib that manages the LEDs, you might want to fork it to set the amount of LEDs you have and to customize the light animation (see all the examples in the python folder).

The Claudie repository is handling a web server, every time we send a POST on http://IP_ADDRESS:PORT/prynt it lights the cloud in a storm effect.

Getting the Raspberry Pi ready

Once you have the OS running and can ssh on the Raspberry Pi you can clone this project and install everything you will need:

image

Now you have your app ready by doing POST on http://IP_ADDRESS:PORT/prynt should light the cloud.

Customize with your own needs 🛠

As said before, you can put any trigger you want, a like on your Facebook page, one on Instagram to light your cloud, the possibilities are endless :)

This is the code that is doing the animation on Claudie side:

image

Each time a POST is made on /prynt we create a subprocess with the sudo authorisation. That was the main difficulty of this project, sudo is required to use the rpi_ws281x lib. This subprocess executes the storm animation on the cloud one time. The user ( pi by default) executing the command need to have the sudo authorisation.

If there is a power outage, it can be great if your program restart by itself, on the startup of the Pi. To do so, one of the several ways to do it, is editing the crontab script:

sudo crontab -e

Start Claudie program:

@reboot python /home/pi/Desktop/Claudie/app.py &

Customize your Claudie 🌈 🌈

If the double rainbow is your kind of thing, you can customize it like this.

image

If you have any questions or comments, I’d love to read them in the comments!

Disclaimer: Setting sudo by default on the pi user is not recommended in terms of security. Further more if your Raspberry Pi is accessible from outside your network.

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa