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).
- Attempts to connect to WiFi
- If it fails, it opens its own network (as an access point) and allows you to input the credentials for the desired network.
- If it succeeds, it connected to the server and waits for input or message from the server.
- Upon touching the sensor, it randomizes a color and sends it to the server, which will send it to all lamps.
- Upon every message from the server, it set the color to the color in the message.
Step 1: Step 1 - What You'll Need
- 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.
- 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
- 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:
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!
Participated in the
Colors of the Rainbow Contest