Introduction: CoronaLamps: Simple Friendship Lamps Anyone Can Make

About: Inventor, Creative Designer, Electronics Hobbyist, Ham Radio Operator, and Musician. As a 17-year-old passionate and creative engineer with a knack for hardware/software integration and technical projects, I w…

As I sit here, trying to come up with gift ideas for my friend who I haven't seen in months due to the virus, I keep on seeing the ultimate gift on Amazon: Friendship Lamps. Lamps that are connected to the internet, so when one touches their lamp, the other person's lamp lights up. One problem, the cheapest set of these on Amazon is $170!

Are you stuck separated from a loved one or significant other because of the Covid-19 pandemic? The simple act of having something that lights up whenever the other person touches theirs and thinks about you is an amazing feeling, and especially useful during the lockdown. In this Instructable, we will build a simple, inexpensive, internet-connected Friendship lamp that anyone with basic electronic experience can make, while learning how it works on the way.

When a lamp is touched, the other lamp will activate for 10 minutes, and that person can respond by touching their lamp at any point.

Originally, I did not intend to make this project into an Instructable, but after seeing how well it worked, I hoped that I could inspire other people to make similar projects!

If you enjoy this project, make sure to vote for it in the First Time Author competition! With that out of the way, let's get into the supplies.

Supplies

(To Make Two Lamps)

*The amount given is the number of individual items that are needed. Some of the links given are links to multiple of those items, so more orders are not needed.

Step 1: 3D Printing the Lamp

The Lamp is printed in two parts in two different colors. Although everything could be printed white, the black and white looks much more aesthetically pleasing. All of these parts will have to be printed twice to make two lamps.

Print 1 (Black):

  • Base.stl
  • Top.stl

Print 2 (White):

  • Shell.stl
  • Button.stl

Print Settings (Ender 3 Pro):

  • 0.28mm layer height
  • 10% Infill*
  • Supports

*I chose to print the shell with a 10% infilll. It creates a hex pattern on the outside when the lights are on that looks interesting. If you don't want this, you can print with a 100% infill.

Step 2: Wiring the Neopixels

This is by far the most challenging step. The Neopixels that I had on hand came as individual LEDs that needed to be wired together. If you wish to further simplify the project, I suggest using a strip like this. I can't assure that it would fit properly, but it would require less soldering, and I'm sure that you could get it to work.

What are Neopixels?

Neopixels are a type of RGB LEDs that are controlled through a digital signal, rather then 3 analog RGB values. This means that they can be wired in series, and each LED's state and color can be controlled individually, separate from the other Neopixels. Not only are these useful for creating simple LED strips that can have more complicated animations, but it also simplifies the design by removing the need for a driver circuit.

Soldering Them Together

For this step, set aside 12 of the Neopixel LEDs and a handful of resistors of any value. Set down a piece of cardboard or use a surface that you don't mind hot gluing to. Glue the LEDs face down in a U shape as shown in the picture above. Make sure that the arrows are all pointing in the same direction, going from left to right. This shows the direction the data will flow.

Heat up your soldering iron (I usually set mine to 400C), and one by one tin each contact. Take the resistors, and solder the end to the bottom left, inner corner contact. This contact should be labeled ground (GND). Use the photos and video above as a reference. Solder the resistor to the next ground contact. A single resistor leg should be able to bridge 3 contacts. After the resistor leg can’t bridge more contacts, snip off the remainder of the resistor, and repeat this process using another resistor leg. When you reach a corner, bend the resistor leg, and continue soldering the ground contacts together. Once you solder every ground contact together, we can move on to the data line.

The data line is wired up in a similar fashion, but requires a bit more work because each data pin must ONLY be connected to the next one, and no others. To do this, we start by soldering a resistor to the first DOUT pin on the bottom left. Then, solder this resistor down to the DIN pin on the next LED. Snip the rest of this resistor off. Continue by soldering the DOUT pin on the LED you just soldered to, to the following DIN pin on the next LED. Make sure that no DIN and DOUT pins are connected on the same LED, and that only the following DIN pin is connected to the current DOUT pin. I know it sounds complicated, but reference the video below and the photos above if you're confused. Continue this for all of the data pins, going all the way around the U from left to right, make sure that when you go around the corner that the data line does not touch the ground line.

Finally, the 5v line is wired up exactly the same as the ground line. Starting from the bottom left, use the resistor legs to bridge every 5v line together, being careful to not touch the data line when going around the two curves.

Perfect! The hardest part is done. Lastly, take 3 jumper wires and cut them down to about 2 inches, strip and tin each end. Solder each one to the GND, DIN, and 5V pins on the bottom left on the U. Cover all of your soldering jobs with hot glue, and put extra around the corners to keep the lines from moving and shorting.*

Finally, do it all again for the second lamp

*If you wish to test the Neopixels before installing them (which I would recommend), get the ESP8266 microcontroller from the supplies. Solder the 5v jumper to 5v, the GND jumper to GND, and the Data jumper to D1 on the microcontroller. Upload the program below. If you don't know how to upload the program, skip ahead to "Programming the ESP8266.” A series of animations should play through your strip. If only a portion of the strip is lighting up, go to the last LED that is lit, and check your soldering connections.

Step 3: Finishing the Base

To finish up the base, the Neopixel strip we just created must be wired up to the ESP8266 Wemos D1 Mini Microcontroller.

What is an ESP8266 Microcontroller:

The ESP8266 is a "generic" Arduino-compatible microcontroller that has a few useful features that we utilize in this project. Most importantly, the ESP8266 has WiFi built-in, which will allow our Friendship Lamps to connect to the internet for communication.

Preparing the ESP8266:

To prepare the microcontroller, use the soldering iron to tin D1, D6, 5V, and GND. Make sure that your ESP8266 doesn't have headers soldered on it.

Connecting the Neopixels:

With the wires that we already soldered to the neopixel strip, solder the wires to the ESP8266 as follows.

5V - 5V

GND - GND

DIN - D1

Putting Everything Together:

Start by gluing down the ESP8266 to the 3D printed base as shown in the photo above. After it is secure, glue the Neopixel "U" that we made around the mount for the ESP8266. Again, use the photo for exact positioning.

At this point, upload the strandtest.ino program that was in the last step, and make sure everything is functioning correctly.

Step 4: Adding the Touch Sensor

At this point, we have a perfectly functional Neopixel lamp base, but we need to add the touch sensor functionality so that the ESP8266 knows when you tap the top of the lamp.

Preparing the Touch Sensor:

Start by using the soldering iron to remove the 3 headers located on the touch sensor, otherwise they will cause the sensor to not fit on the top properly. Cut 3 wires to about 3 inches, and strip and tin both ends with the soldering iron. It is important that the wires are a little bit longer then needed to make the next step easier. Solder each wire to one of the 3 pins on the touch sensor labeled VCC, GND, and SIG.

Attaching the Touch Sensor to the ESP8266:

On the other end of the 3 wires, solder the SIG wire to pin D6 on the ESP8266, the GND wire to the GND pin, and the VCC wire to the 5V pin. Secure all of the connections with hot glue. Plug in the ESP8266 and make sure the light on the touch sensor module lights up.

Congratulations! You have completed all of the wiring!

Step 5: Final Lamp Assembly

This is the FINAL assembly step!!

Attaching the Shell and Base:

Start off by laying down a thin line of hot glue around the Neopixels on the base, be conservative, as too much will cause a gap to form between the base and shell.

Pass the touch sensor and wire through the shell, then push the shell firmly down against the base, making sure that none of the Neopixels were caught between the shell and base. Press down firmly until the glue is completely dry.

Attaching the Touch Sensor to the Top:

With the touch sensor hanging out of the top of the shell, get the top piece and put the touch sensor into the cut out, making sure that the metal circle lines up with the hole on the top. Glue the sides of the touch sensor to the top. Reference the photos above for more details.

Attaching the Top to the Shell:

Similarly to the base, run a thin line of hot glue along the top of the shell. Take the top and press it firmly against the shell, and hold it until the glue dries.

Adding The White "Button":

Take the little white circle that we printed out, and insert it into the hole on the top, if it is too large, use sanding paper until it fits snugly. This shouldn't move, but it does show you where the touch sensor is.

Good Job! Your lamp is completely assembled.

Step 6: Setting Up an Adafruit IO Account

From here on out it's smooth sailing.

To simplify this project, complicated port forwarding and networking isn’t used. Instead, these lamps use a free service run by the Hobby Tech company called Adafruit IO to communicate with each other.

What is Adafruit IO:

Adafruit IO is a free program run by Adafruit that allows hobbyists to create projects that communicate with each other over the internet without complicated setup. Using the Adafruit IO library, we can connect each of our ESP8266s to the Adafruit servers with MQTT, and use this to allow them to communicate with each other.

Creating An Account:

Because Adafruit, unlike many other companies, is there to support the values of electronic hobbyists like us, they created a free version of Adafruit IO that satisfies every requirement we need for this project.

Navigate to io.adafruit.com, and click Get Started for Free. Create an account with the required information, and then click Feeds, New Feed. Name the feed lamp.

That's the entire Adafruit IO setup, keep the page open because we will need information from this page during the next step.

Step 7: Programming the ESP8266

**NEW SUGGESTED CODE FOR LIGHTS, READ AT BOTTOM OF THIS STEP

Now for the exciting part! And a fair warning, I am by no means experienced when it comes to programming, and surely my coding could have likely been more efficient. I do plan to create a version 2 code that allows you to send specific colors to the other lamp and fix some of the bugs that I haven't ironed out yet.

Prerequisites:

Make sure that you have the latest version of the Arduino IDE installed, you can find out how to install this through a quick google search.

If you don't have the ESP8266 boards manager installed, you can learn how to here

Go to Sketch- Include Library- Manage Libraries- and search up Adafruit IO. Scroll down until you find Adafruit IO Arduino. Click Install, and then Install All.

Finally, in the same Library Manager, search up Adafruit Neopixel. Scroll down until you find Adafruit NeoPixel, and install that as well.

Setting Up The Code:

Download the config.h, and the CoronaLamp.ino files. Move them both into a folder named “CoronaLamp”. Placing them into a folder is a VITAL step.

Double click the CoronaLamp.ino file to open it. We only have to do a few things to the code.

Click over to the config.h tab, and enter your WiFi username and password into the quotations shown here.

#define WIFI_SSID ""
#define WIFI_PASS ""

Then, go back to the Adafruit IO website, and click My Key. Copy and paste your username and key into the corresponding quotation marks in the code shown below, being careful not to add any extra characters or spaces.

#define IO_USERNAME  ""
#define IO_KEY       ""


Go back to the main CoronaLamp.ino tab, and find this line.

//set one of the lamps to 1, the other to 2
int lampVal = 2;<br>

This is the one thing that needs to be changed between the lamps. On one lamp, set the value to 1 before uploading the code, on the other lamp, make sure you set the value to 2 or else the lamps won't function.

That's it for the code, now to upload it.

Uploading the Code:

Connect one of the two CoronaLamps to your computer via a micro USB cable.

In the Arduino IDE software, click Tools, Boards, ESP8266 Boards, LOLIN(WEMOS) D1 R2 Mini (See photo above for more details)

When you connect the ESP8266 to your computer, it gets assigned a port for communication. It is usually going to be the only port being used. Go to Tools, Port, and select the port of your ESP8266. If you don't know what this is, disconnect the module, and see which port disappeared.

Finally, click the arrow on the top left of the Arduino IDE to upload your program.

Repeat this process for the second lamp, making sure to change the LampVal between the two. Also, change the WiFi username and password to where the other lamp will be located.

NEW VERSION 2 CODE:

Although I wasn't able to come back and create a new version of the code, DevJav reached out to me with a modified version of the friendship lamp code that is absolutely wonderful. It implements WifiManager, which allows the lights to have the WiFi network credentials set up after the code is uploaded, as well as more options for the lighting. Check out the code and instructions here:

Step 8: Wrapping Up

I started this project because I loved the idea of a device that my friends and I could use to let the other person know that we are thinking about them, and I was disappointed in the lack of an affordable commercial option. From start to finish, this project has been an incredibly valuable project to myself, and I hope that it will inspire someone else to create something even cooler!

I entered this project into the First Time Author Instructables Contest, as I have never shared my projects on this platform before. Please make sure to check out the other projects that have entered, and vote for however many projects you enjoyed! There is no limit to how many people you can vote for, so I encourage you to show your support to as many aspiring creators as possible.

A Few Notes About The Lamps:

This is just the first version! I am planning to create a V2 in the near future, so stay tuned!

I plan to revise the code. Currently if you hold down the touch sensor for too long the code fails, as interrupts don't like to be activated for such a long time, in this case the lamp resets. Not a huge issue, but definitely something that needs to be fixed.

Lastly I plan to add functionality such as based on the number of times you tap your lamp, the other person's lamp will be of a certain color. This could allow secret "messages" to be transmitted.

As this is my first Instructable, I would greatly appreciate comments and feedback, as I hope to be sharing more of my projects in the future.

Till Next Time

First Time Author Contest

Participated in the
First Time Author Contest