Filia - the Homemade Friendship Lamp

Introduction: Filia - the Homemade Friendship Lamp

Filia means Friendship in ancient greek. The idea is to have two lamps in different parts of the world, and when you touch one lamp, both randomly change their colors. So if you want to show someone on the other side of the world you are thinking about them, you could tap the lamp and the colors would change, then they can do the same (if they're awake).

How does it work?

Both lamp are equiped with a touch sensor, a RGB LED, and a WEMOS D1 Mini (WiFi connection chip), and are connected to the power via a USB cable. In the middle there is a Amazon IoT (Interner of Things) server, which is a Publish-Subscribe server (upon every message that is sent to it, it broadcasts it to all the connected devices).

Each lamp:

  1. Attempts to connect to WiFi
  2. If it fails, it opens its own network (as an access point) and allows you to input the credentials for the desired network.
  3. If it succeeds, it connected to the server and waits for input or message from the server.
  4. Upon touching the sensor, it randomizes a color and sends it to the server, which will send it to all lamps.
  5. Upon every message from the server, it set the color to the color in the message.

Step 1: Step 1 - What You'll Need

Tools

  • Solder Iron (& Solder of course. You may also use a solder vacum, a third hand and a Solder Iron holder if you wish, this is your call. I recommand all of them.)
  • Plyer Or Wire Stripping tool (if you plan on stripping the wires on your own, which you'll probably need to do).
  • Multimeter, to make sure our circut doesn't have any shortages in it.
  • Scissors
  • Screwdrivers. Make sure you get strong ones, because you'll need to create the screw thread on your own.
  • Hot Glue gun, and some glue.
  • 3D printer or access to one. It needs to be able to print in white, and create a very thin wall (2 mm). I sent mine to a professional printing place, it cost me about 20$ and was very much worth it, because they did it perfectly.
  • An AWS IoT server. The creation of such server is behond the scope of this instructable, but here is a link to a video that explains it. The UI may have changed a bit, but the overall idea is the same. Register a device there and save the code that is used there, you'll need to insert it into the code later.

Materials and parts

  • Iso
  • Wires. I use color coded jumper wires to make the guide more understandble, but you don't have to do this. It is common safety to mark the positive in red and the negative in black or blue. In total we use about 20 cm of wires per lamp.
  • USB cable (one per lamp)
  • Screws. The screws we use must fit the holes of the print, so we'll use 3 x 3M x 10mm and 4 x 2M x 3mm bolts per lamp.
  • One D1 mini chip per lamp.
  • One TTP223B touch sensor per lamp.
  • One 10mm common-cathode RGB LED (like this one) per lamp.
  • Some tin foil
  • Some duct tape

Step 2: Step 2: the Frame

The frame is easy enough to print. I used white ABS. Since it's very thin, it seems semi transparent, which is perfect for this lamp.

After we print the parts, we need to glue the two parts of the dome to create a single dome. They are called the upper dome and the lower dome, and we glue them using hot glue across the line, and then cleaning it with a knife or scissors.

Step 3: Step 3: the RGB LED

The RGB LED has four connection, three anodes (positive ends) in each of the three colors: red, green and blue, and a cathode (negative end). This is what "common cathode" means. We're going to connect to each of the wires on the LED the matching wire (I used color coding so it will be easier to spot later, you can mark you wires in any way that can completely distinguish them from one another). We'll connect the wires as close to the LED body as we can and then cut the reming of the LED legs, so they won't take any space.

Then we'll squeeze the wires through the hole in the middle of the base, from the center out. The hole is just bearly the size that can fit all of the wires, so we'll have to squeeze them together. Braiding them together can make it easier to get them throught the hole. Then we'll test using the multimeter that there are no shortages.

After getting the wires through, and testing using the multimeter they are not touching eachother, we'll glue the led to its palce using hot glue.

Step 4: Step 4: the Button

This is not actually a "button". The touch sensor is too big to fit at the top of the dome, so we must extend its conductive surface to the surface of the dome so our hand can reach it. We take the printed cylinder that we printed with the dome, and wrap it vertically with tin foil, and then horizontally with ductape, making sure that both ends of the cylinder have exposed tin foil so that it can connect our hand to the surface of the touch sensor.

Then, we glue the buton into place and remove the glue using a knife or scissors.

Step 5: Step 5: Electronics

It's electronics time! Follow the scheme and make sure there are no shortages. It's better to stregthen the power conenctions with a single heat shrink, because those are the ones that are connected to an external cable.

A few things to notice:

  • The USB cable exposure is difficult, but in the end there should be a black and red wires in it, braided together. If you plug in the USB cable, they should have a voltage of 5V.
  • Use long wires for the Touch sensor, at least 6 cm.
  • It will be easier later if you don't solder the touch sensor and just leave on each of its wires a female jumper wire end, so you could easily connect/disconnect it later.

Step 6: Step 6: Code

So after setting up the AWS server, we can start coding. You can download the code from here, and upload it to the D1 mini using Arduino IDE. Please notice a few things:

  • If this is your first time using the Arduino IDE, please go to this short video which explains how to install and run it.
  • If this is your first time using the Arduino IDE with the WEMOS D1 mini, please go to this instructable which explaing how to do it.
  • You'll need to include a few libraries in order for the code to run. Go to Tools/Manage Libraries or press ctrl+shift+i, then select and install the following libraries:
    • ArduinoJson
    • AWS-SDK-ESP8266
    • PubSubClient
    • WebSockets
    • WiFiManager
  • Finally repalce all the moitted constants in the AWS Client area of the code to your constants that match your AWS account.
  • You can also add as many colors as you wish to the colors list at the LED section of the code.

Step 7: Step 7: Integration & Operation

Finally we can connect the touch sensor into place, put the bolts in to connect the base to the dome and plug it in!

The first time we plug it in, Filia will not find a WiFi network, unless there is one without protection in the area, in which case it will connect to it. If it doesn't find, it will start its own access point, and we can connect to its network.

After connecting to the network, a webpage will be opened and we can enter the credentials for our desired network. After that we can restart (by unpluging and repluging the lamp) and it shold connect. We can see that it has connected after it blinks green three times and then becomes blue. After that we can touch the top and the signal will be sent to the server, setting the state of the IoT. It will then update the state on all Filia's connected to your Device, and they will all change color accordingly.

Thank you for reading!

Colors of the Rainbow Contest

Participated in the
Colors of the Rainbow Contest

1 Person Made This Project!

Recommendations

  • Water Speed Challenge

    Water Speed Challenge
  • Pets Challenge

    Pets Challenge
  • DIY Summer Camp Contest

    DIY Summer Camp Contest

21 Comments

1
ryanmouzas
ryanmouzas

Question 9 months ago

im working on the code part is there a possibility you could upload a current working version of the code? as of right now the AwsIotClient.h is no where to be found and some of the other parts are out of date

0
finn_mccool
finn_mccool

Answer 9 months ago

Ryan,

I have fixed the code to work with the new libraries. Please message me if you want my attempt.

0
ssimondorman
ssimondorman

Reply 3 months ago

Please send it to me too! thanks!

0
finn_mccool
finn_mccool

Reply 3 months ago

I have posted an Instructable - please see my profile

0
ssimondorman
ssimondorman

Reply 3 months ago

I tried to view it, but it gives me a 404 error and says I'm unable to open the page. im not sure whats wrong.

0
ssimondorman
ssimondorman

Reply 3 months ago

Hello! really sorry to bug, but the webpage is still unavailable and I really need the code for a gift. would you mind sending it to me? please?

0
giu_silva
giu_silva

Reply 5 months ago

I just NEED it so hard!! Could you please send me too?

0
JustinGMEC
JustinGMEC

Reply 7 months ago

Finn,
Could you share it with me please?

1
finn_mccool
finn_mccool

9 months ago

I agree with Ryan. This is the most in-depth code I've ever worked with on Arduino and to edit it to comply with existing libraries is outside my skillset.

0
finn_mccool
finn_mccool

9 months ago

Thank you I see this now.

0
finn_mccool
finn_mccool

Question 10 months ago

Have I missed a step, or is the setup of the AWS server overlooked?

0
aamarioman
aamarioman

1 year ago

Alright,
Thank you very much for your valuable support. I'll take a look to see if I can change de code. To be honest i'm not a very advanced programmer but i'll give it a try.
Greetings.

0
aamarioman
aamarioman

1 year ago

Thank you very much for your time.
Would you be so kind to upload the libreries you used in order to get the program up? I think several of the libreries habe changed.

0
idanstark42
idanstark42

Reply 1 year ago

Hi,
I'm sorry, they're on my old computer, so I don't have them anymore.
Anyways there's probably a reason they were taken out, perhaps Amazon doesn't sorry them anymore. I'll try to find time to recreate the code with the new libraries.

1
aamarioman
aamarioman

Question 1 year ago on Step 6

Hi idanstark43,
First of all, thank you very much for your contrubution.
I was trying to compile the program in the arduino IDE, but I can´t manage to find the AwsIotClient.h librery. I found one similar in the AWS-SDK-ESP8266 named AmazonIOTClient but I'm not sure it's the same.

0
K-baker
K-baker

Question 1 year ago on Step 7

Is there a way that I can pay the have these made? I love them but they are way out of my ability..

0
idanstark42
idanstark42

Answer 1 year ago

Do you mean the print or the entire thing? I outsourced the print, and made the rest at home. These are based on a product that I don't remember the name of, but was very expensive.

0
quequecamillejane
quequecamillejane

Question 1 year ago on Step 6

how many D1 mini do I need to make the two lamps?

0
idanstark42
idanstark42

Answer 1 year ago

One for each lamp