be coronavirus and isolation.
Creative people do not want to sit just like that and implement projects for which they simply did not have the time or need.
The author of this DIY was an exchange student in Austria. There he also met a student from the United States. At the end of his studies, he went to Amsterdam, she to New York.
They had plans to meet after a short time, but the meeting, due to known events, was postponed indefinitely.
Finally, after 11 months, they met. The master gave his girlfriend a “Messaging Lantern” as a gift.
This lantern has a built-in messaging module (web-based), RGB lighting and a photo frame of four lithophane images. The images depict the memorable events of the young couple.
Let's watch a short video.
As you probably already realized that for messaging, both a guy and a girl should have such a device.
Tools and materials: -3D-printer;
-Soldering accessories; -Glue gun; -PLA filament two or more colors; -Neodymium magnets 2×8 mm, 8 pcs;
-NodeMCU ESP8266 board; -Printing board 6×4 cm; -Micro USB board; -TXS0108E 8-channel logic level converter; -Toggle switch; -Pin connector 40x 2.54 mm; -Ky-040 encoder; -Capacitive sensor Digital Touch TTP223B; -0.96-inch display module Oled 128X64 I2C SSD1306; -WS2812 RGB LED strip 144 LEDs/meter;
-M3 nuts – 10 pcs;
-M3 20mm bolts – 10 pcs;
-M3 screws 20 mm – 10 pcs;
-Heat shrink tube;
Step one: about the project
The lantern consists of 2 modules – a photo frame and an electronics case.
The photo frame is made in the form of a rectangular parallelepiped. On the sides of the figure, four photographs with sides of 70x100x4 mm (W, D, H) are placed. These images are printed in Lithophane format, more on that later.
The electronics housing allows all electronics to be installed inside the flashlight. The case also has holes for USB input, power switch and user interface.
Electronics is an Arduino-based ESP8266 NodeMCU platform with 3 main parts.
ESP controls all user inputs, RGB lighting and connects via Wi-Fi to a Wix web server that downloads and sends messages.
LED strip WS2812 RGB are controlled using the Adafruit Neopixel library, which allows them to be controlled from the user interface.
User interface. ESP launches a version of the Arduino menu library. This menu is displayed on the screen and can be navigated with the rotary encoder. From this menu you can send messages and change LED settings. The touch sensor is used to turn on the LEDs.
The entire device is powered by a simple micro USB connector, which can also be used for programming and updates.
Step two: body of the lantern for messaging
Details can be printed with any thread. The craftsman used PLA because it is the cheapest and the structure does not have to withstand any structural stress. Combine whatever colors you like and are available for the housing, photo frame and lid.
The following parts are required to be printed:
1x Housing for electronics.
1x Housing for electronics housing.
1x Photo frame.
1x Photo frame cover.
1x Rotary encoder button.
1x Touch sensor cover.
The master used a layer height of 0.2, but this setting may vary depending on the printer.
Please note that full filling is recommended for the photo frame holder and top cover to avoid stray light from entering the enclosure.
Picture_frame_lid.STLRotary_encoder_button.STLTouch_sensor_cover.STLElectronics_Housing.STLElectronics_housing_lid.STLPicture_frame.STL = ” usamodelkina.ru/uploads/posts/2021-03/1615643958_1-11.jpg “rel =” prettyPhoto “> Step Three: Litofan
What is Litofan? In essence, this is the transformation of images into three-dimensional objects, 3D printing of images.
A classic lithophane is a three-dimensional image on thin translucent porcelain that can only be seen when illuminated from behind by a bright light source (for example, the sun or an ordinary light bulb).
For example, the photo below shows a German lithophane from the late 19th century. Left without backlight, right with backlight.
It works like this: the thinner parts of the lithophan let in more light and look brighter, while the dense parts let in little light and create dark details in the image. Interestingly, the picture changes depending on the direction and brightness of the light source.
Previously, the technology for creating such an image was quite complicated (cutting an image from wax – a mold from plaster – casting porcelain – firing), but with the advent of 3D printing, everything has become much easier.
There are some great tools and tutorials, such as All3DP, but to summarize the concept, the wizard used an online tool called 3dp.rocks/lithophane. Here you can simply upload an image and set the parameters to your liking, and the program will take care of the rest.
So, to create a print file you need:
Free online tool 3dp.rocks/lithophane
All default settings: see photo
An image with an aspect ratio of 3: 4 and a height of 4. This is important, because this will result in a lithophane with a size of 100x75x3 mm (L, W, H). This size is suitable for the photo frame holder.
The height of the print layer is the same as that of the printer.
Step Four: Assembling
The parts are printed and you can start assembling. Wizard starts with electronics.
In any electronic project, it is always a good idea to first check if everything is working as expected by creating a prototype on a breadboard. Gathers according to the scheme.
After checking, proceeds to the assembly.
Installs the display and the rotation angle sensor and screws them on. Adheres the capacitive sensor with the leads inward to the electronics housing. Glues the micro-USB connector into place and slides the power switch in the bottom cover.
Then he cuts the LED strip into 4 equal parts of 15 LEDs each and solders the wires to the contact pads. LEDs will be needed to install in the photo frame.
Finally, connects all the components by following the supplied scheme.
Installs the ESP8266 module on the prototype PCB with TXS0108E level converter. This must be done via female connectors 2.54 mm, so that in the event of an accident (eg short circuit or incorrect supply voltage) the ESP and the level converter can be replaced without the need for a new printed circuit board. Installs the board into the case. Connects everything according to the scheme.
Sets the base and photo frame stands. Sticks the LED strip on the racks. Plugs in LEDs as shown in the diagram.
Next, you need to download the code (in the next step) and check the operation of the device. Only then can the housing be closed by screwing the photo frame holder and the bottom cover to the electronics housing. Then install the lithophans and install the top cover.
Step Five: Programming < br> The written program is quite extensive and requires the use of several
Arduino libraries. The wizard explains the main parts of the code in the text, and the details in the code itself.
First goal: Send messages over the Internet:
Step 1 : Select a message This piece of code is written in the Messaging_Lantern.ino and menuinit.ino files. And it works by creating an interactive menu using the “Arduino Menu” library from “neu-rah”. The wizard recommends experimenting with the following sketch examples: “oZOledAscii” and “clickEncoder”.
He identified several categories of messages: general, gentle, considerate, and exemplary. When you select a category, a submenu opens and you can select messages to send. The content of these messages is located in the file menuinit.ino.
Step 2 : Sending a message over the Internet
The master uses the ESP8266 WIFI function to write messages to this database, and then read the received messages from the database at a fixed time interval of 1 minute. This feature is implemented in “WifiConnectivity.ino”.
Step 3 : Display messages received from another module
Every minute the current message is called from the database and saved. Then, if the messaging light has not been touched for more than 10 seconds, it goes into “sleep mode” and then the last message received is displayed on the OLED display. This feature is implemented in the “void Loop ()” function in the “Messaging_Lantern.ino” file. To unlock the menu again, press the rotary encoder.
Second purpose: to function like a lamp.
To make the device work like a lamp, he used the Adafruit NeoPixel library to drive LED strips WS2812 . < br> LEDs will display a specific color. This color can be selected from the Color submenu by changing the RGB values from 0 to 254. In addition, there is a brightness setting from 0 to 100%. All this functionality is implemented in the “LEDControl.ino” file. In addition, the lamp can be switched on and off using a touch sensor. This function is implemented in the “TouchSensor.ino” file.
Step Six: Web Database
In this step, we'll show you how to create a Wix database.
Create an account and start building your first website. Then do the following:
In the Wix menu, create a database and name it: “DATABASE_LANTERN” (or, if you prefer, changing the code)
Set the options:
Read & # 58; Anyone Create & # 58; Admin Update & # 58; Anyone Delete & # 58; Admin
Create 2 records with headers USER1 and USER2 and add a column:
fieldname & # 58; dsiplayDATA fieldKey & # 58; displayData field type & # 58; text
Fill in the dsiplayDATA column with sample text. For example: test1, test2
Copy the IDs and save them. The keys should look something like this:
Key1 USER1 & # 58; 1a534425-5a6a-0000-b215-0cdbf3195f30 //they don & # 39; t work Key2 USER2 & # 58; 9d6937b5-7f67-0000-b563-ba0495808197 //they don & # 39; t work
Replace “KEY” in both installed functions.
get_setUser1DisplayMessage & # 58; key of user 1 get_setUser2DisplayMessage & # 58; key of user 2
Now publish your site.
Synchronize the database: DATABASE_LANTERN to live. This option is available when you open the database.
Everything should work now, and by pasting the provided urls (see the code file) into your web browser's search bar, you will be able to get the JSON with get_functions and write to the database with set_functions.
Anything that needs to be changed can be found at the beginning of “Messaging_Lantern.ino”.
To use the Messaging Lantern yourself, you need to change the following in the code:
Change your Wi-Fi name and password
Create a base Wix data and use personalized communication links.
Set users USER_1 and USER_2 to any of the messaging lights.
Change the content of messages (menuInit.ino).
Change the color and brightness of the LEDs by default to your favorite RGB color.
Everything is ready, it remains only to give one lantern to your beloved, and keep the second one for yourself and you can chat.