DIY Long Distance Best Friend Lights

by tmckay1.jackson in Circuits > Raspberry Pi

16425 Views, 84 Favorites, 0 Comments

DIY Long Distance Best Friend Lights

HOW TO MAKE BEST FRIEND LIGHTS: DIY Best Friend Light | Raspberry Pi Projects
p1.jpg
p2.jpg
p3.jpg

I made long distance synchronized lights known as "Best Friend" lamps. That just means that they are kept in sync to the current color of the other lamp. So if you were to change one lamp green, shortly after the other lamp would turn green. This is a very easy raspberry pi project that anyone can jump into and uses a lot of really basic concepts that are great to build upon.

This would be a great project to run during quarantine since you can't be close together all the time, and it can be used within the same home to signify if you are in a meeting or other important event.

Supplies

  1. ws2811 LED Bulbs - https://amzn.to/370NCK75V
  2. Raspberry pi zero I used (can use any pi, remember to get an sd card) - https://amzn.to/38bqEki
  3. Acrylic Sheet - https://amzn.to/3leLMtv
  4. Push Button
  5. Cherry wood, Red Oak wood - Local wood distributor

Build the Base

p21.jpg
p5.jpg
p6.jpg
p8.jpg
p7.jpg
p9.jpg
p10.jpg
p11.jpg
p17.jpg
p18.jpg
p19.jpg

To get started you'll need a box to put the electronic components in and feed the light through. I had some left over cherry wood and red oak wood that I used to make the box. I used a single square piece of cherry for the top, which ended up being about 4.5 inches x 4.5 inches and 1.25 inches thick. Then I used mitered pieces of red oak wood to add a section the electronic components will be in. Those pieces were about 4.5 inches long, 1 inch thick, and 2 inches wide. If I were to do this again, I would certainly make the red oak thinner so that the electronic components had more space to fit. After cutting the pieces I sanded them down and drilled a hole for the ws2811 led using a 1/2 inch drill bit. Then I finished them with Mahoney's walnut oil.

Make the Diffusion Block

p14.jpg
acrylic.jpg
p15.jpg
p16.jpg

After the base was made I started to make the diffusion block which will be used to spread out the light from the ws2811 led. To do this I cut rectangular pieces out of acrylic and then sanded the acrylic to make it really blurry. This will allow the light from the led to spread out and illuminate more. I then used hot glue to secure the structure

Solder Up the Circuit and Run the Code

best_friend_light_bb.png
p22.jpg
p23.jpg
p25.jpg
p30.jpg

This is the time to solder up the circuit. Each light has a raspberry pi zero, a ws2811 led, a push button, and a resistor. One circuit is used to control the ws2811 led, while the other is used to check for user input. The ws2811 led circuit is a simple one that uses the ground, 5v, and pwm pins of the raspberry pi to control the led. The user input circuit has a current limiting resistor and a push button that is used to switch the voltage on and off from a raspberry pi input pin.

Each pi is running the same program. This program checks when the push button is pressed, and if so, changes the color. It then sends a message to a web server that tracks the current color. Every 5 seconds this program also checks the current color from the web server and if that color is different than the current color of the lamp, it changes to that color. This is how they are kept in sync. So if you change the color to red on one lamp, that lamp will tell the web server that the current color is red, the other lamp will check the web server in 5 seconds and see that the current color is red and subsequently change to that color. The web server I used was hosted on one of the pis since I was using it within the same network, but you could easily run this server on any public server and the lamps would work across continents.

Given this design you could easily scale this to many more than 2 lamps.

Below are the two repos you'll need to run the project. If you have issues installing BiblioPixel you can take a look at my video on making a message board. It goes into installing BiblioPixel in detail.

Best Friend Light Program running on each pi:

https://github.com/tmckay1/best_friend_light

Web Server that keeps track of the current color:

https://github.com/tmckay1/raspberrypi_gateway

Run the Program on Each Pi, Run the Server, and See It in Action!

p27.jpg
p4.jpg
p26.jpg
p31.jpg

Now you can run the program on the command line by checking the readme in the previous repos, run the server following the readme, and see it in action!