红水杯

【Training Camp】Fancy atmosphere small table lamp 567883A

 
Overview
I. Introduction
In fact, I didn’t want to participate in this event. I just heard that joining the group would get coupons, so I was fooled into it...I was very desperate when I learned about the content of this event. Internet of Things? How troublesome is this? How long does it take to code using esp8266? But what I didn't expect was that Lichuang actually cooperated with Tuya. Tuya's advantage is that it is simple and easy to use, so... let's give it a try?
 
 
2. Design inspiration
But what to do? I had no clue at first, but suddenly I saw @irongu ’s USB powered touch dimming lamp project. I originally wanted to make one, but then I thought, why not use this filament to make a desk lamp? ? Let’s get started, the first thing is to design the appearance. The shape design is inspired by the benzene ring - the outer ring of filaments and the three hollow filaments in the middle are the Kekulé style of the benzene ring, and the middle ring of WS2812 lamp beads just constitutes another benzene ring commonly known as the "toilet seat". Structural formula (that is, Pauling formula). Although we now know that the real structure of the benzene ring is not the alternating single and double bonds like Kekulé's formula, but is like a "toilet seat". The circle emphasizes the delocalization of the six π electrons and the uniformity of the electron cloud. distributed. Of course, I personally prefer the Kekule style because of its better appearance (appearance is the primary productivity!
8c1001e93901213fdb6977415ae736d12e2e95d0.png
 
The left side is Pauling's type and the right side is Kekulé's type. Picture source is Baidu Encyclopedia.
  • So here comes the question. Kekulé-style wires can use ceramic filaments or other COB filaments, but what about the ring in the middle of Pauling-style wires? After struggling for a long time, I chose WS2812 lamp beads for a circle.

 

3. Characteristics

  1. Use ceramic filament as the lighting source, with moderate length and sufficient brightness (it can illuminate the entire bedroom when fully opened). And the price is relatively low.
  2. The overall power consumption is not high. The ceramic filament I chose is 20 Ω. The seller claims that the current is only 180-200mA at 3V. The total of 9 filaments is only 1.8A, and the power consumption of ws2812 is also small, so the single The battery lasts quite a while.
  3. Using Tuya's module for IoT development, you can remotely control the light switch, and then you can also connect to Xiaoai classmates.
  4. Using Atmega328P as the slave computer and using Arduino IDE for development, the code is simple and the development time is greatly shortened.
  5. Use the RH6616 as a local dimmer switch so that the lighting function can be used even when the Internet is not available.
  6. WS2812 lamp beads are used to realize the ambient light function. It is good to have an ambient light next to the table at night.
  7. The SHT30 temperature and humidity sensor is added, and the Atmega328P reads and transmits it to the Tuya module through the serial port, and then transmits it to the Tuya server. The current indoor temperature and humidity can be seen on the mobile phone, and the accuracy is also very high.
  8. The IP5306 chip is used as the battery charging chip and is also the source of the overall 5V power supply. The maximum output current is up to 2.4A, so there is no need to worry about insufficient output power.
  9. The switching control of each filament is controlled by an independent mos tube, and a triode is used as the pre-driver, which is safer.
  10. The program burning interface of Atmega328P is reserved.
  11. Dual USB design, wider compatibility.
  12. CH340C is used as the serial port chip, which makes it more convenient to debug the program of the lower computer.
  13. The filament power supply uses DCDC instead of a simple LDO step-down, and it is no problem to face the larger current required by the filament.
  14. Welding points for the filament are reserved on both sides of the lamp board. You can freely choose the welding direction, but it is best not to weld the filament at the same time.
  15. Dual-switch design allows you to freely switch between cloud control and local dimming.
  16. The silk screen printed next to the component is the component model (such as resistor value, capacitor value, etc.). The advantage is that hand soldering is very convenient, but the disadvantage is...it is difficult to find the serial number if there is a problem. Everyone has different opinions. If you feel inconvenient, you can modify it yourself. .

 

 

4. Design details (or notes?
  • After I finished drawing the outline, I discovered a very embarrassing thing: the space was too small to accommodate other structures, so I settled for the next best thing and used two PCBs, with the upper layer being the light board and the lower layer being the control board. The two are connected through copper pillars, and the copper pillars also serve as conductors, so there won't be a bunch of messy flying wires. But then I discovered a very embarrassing problem: the Tuya module I chose was WBR3D, but Tuya's 0-code development function did not include the control of WS2812 lamp beads, but fortunately it left a serial port, which can be used with communicate with other microcontrollers. But what microcontroller to use?
  • Because the development cycle is short, and I am pretty good at it, I chose the ATmega328P chip as the slave computer. I flashed the Arduino Bootloader and used the Arduino IDE for development, which was convenient and fast.
  • But here comes the problem. The module level of Tuya is 3.3V, but the level of 328P is 5V. The levels of the two are different. Although there should be no big problem if they are connected directly, we still add another level for the sake of conservatism. conversion functionpicture.png
  • It is safer to use a transistor here. Although using a resistor to limit the current is not a big problem, just choose either one.
 
  • As for the debugging of 328P, the serial port chip chosen is ch340c because it is cheap; and in order to download and debug the program without conflict with Tuya module communication, soft serial port communication is used to communicate with Tuya's chip.
  • Since I chose to use Arduino IDE for development, the purchased Atmega328P generally does not come with an Arduino bootloader and needs to be burned by myself, so I added a standard burning interface to burn the firmware by myself.qc5zz9fQDqZBf5zFFNenKlzazV20Lq2CKDKm0kBk.png

 

  • As a desk lamp, how can it be used only by plugging in the power supply? Naturally, it needs to add a battery. As for what charging chip to use, I thought about it for a long time on Lichuang Mall and decided to use Yingjixin’s IP5306 chip. , the reasons are as follows
  1. First of all, it does not have any fast charging protocol, but it can run up to the maximum USB current of 2.1A, so there is no need to worry about the power. At the same time, it can be safely connected directly to the serial port chip without worrying about burning the chip;
  2. Then there is the built-in 5V synchronous boost, which supports charging and discharging simultaneously, eliminating the need for isolation of input and output;
  3. The power of the boost circuit is large enough, and the maximum output current is as high as 2.4A, which is enough to feed the filament;
  4. The peripheral circuit is simple and easy to design;
  5. Comes with 4 LED lights for power display.
QQ screenshot 20201127141802.png
  • Now that there is such a high-power charging chip, and for maximum compatibility, a dual USB port design is adopted, which is suitable for more people (in fact, I also want to add a Lightning interface)
QQ screenshot 20201127000948.pngQQ screenshot 20201127001010.png
The above is the schematic diagram and PCB diagram of the dual USB ports.
 
Now that you have connected to Tuya’s cloud platform, you naturally have to make the most of it. So I added a sht30 temperature and humidity sensor, which is usually placed at the bottom of the board and cannot be seen normally, but it can quietly collect the current room temperature and upload it to the Tuya Cloud platform, which can be easily viewed on the mobile phone.
aIrTEMkFHHfSLUkmsjXSCs90RNb2KOIP191J6fwf.png
  • So back to the question that everyone is most concerned about, what is ceramic filament?
  • I borrowed a picture from a Taobao seller (the actual picture is not out yet)
O1CN01GFmaYv27JupFutAlQ_!!151647777.jpg
We can see that the essence of this filament is a high-brightness LED. Its interior is actually composed of multiple filaments connected in parallel, so the power and brightness are much greater than ordinary LEDs. Generally speaking, there are three models of 14-parallel, 15-parallel and 20-parallel, and their voltage drops are all about 3V. Most of the models sold on Taobao are 14-pin models with a rated current of about 80-100mA. However, my purpose is a table lamp, so I chose the 20-pin model, but the current naturally increases, and the rated current is 180-200mA. It seems that directly using a resistor to limit the current will not only cause a large power loss, but also cause serious heating. As for using an LDO to reduce the voltage, it seems that the power is not enough, so a SY8088 DCDC chip is used to reduce the voltage. This chip The maximum output current can reach 2A, which is enough to feed the filament. At the same time, the voltage dropped to 3.3V can make up for the voltage drop of the wiring and copper pillars.
QQ screenshot 20201127141618.png
SY8088 circuit
As for the power supply of the Tuya WBR3D module, I chose to separate it from the power supply of the filament to prevent the filament from pulling down the voltage and causing the module to not work properly. Therefore, I used a separate HX6211 LDO to power the module. And this chip still has an enable pin, in case there is a need for low power consumption in the future (the power of the filament is so high, what else is needed for low power consumption?
Then the rated current of each filament is 200mA, and when it encounters a "double bond", it can be as high as 400mA. In theory, it can be controlled using an S8050 transistor. However, the maximum output current of the S8050 is only 500mA. In order to avoid extreme situations, I used the S8050 transistor as the pre-driver and the SI2305 as the real "switch". In this way, the theoretical current that can pass through is as high as 4.1A (although it is useless). But six sets of filaments still look spectacular like this.kQnzkJozSp43Y9jwAD35600LWvGHXAjFQHMTwIZZ.png
As for the power supply of the filament, I used copper pillars to connect the upper and lower plates, so that there are no exposed wires. It looks very simple and has a cyberpunk aesthetic after lighting it up.GxFBEEvDbeoCVAbsTSlIH5rBkFGN4tKfvwpHl11T.png
 
 
It is also a desk lamp, so how can it only be controlled from the cloud? Of course, it can also be controlled when the local network is disconnected, so I added an RH6616 chip for local dimming. The circuit here is based on Mo Gong's. And a six-digit DIP switch is used to control each lamp, but the disadvantage is that it can only control the brightness of the filament, not the WS2812. Without RGB support, the performance drops by 100% , so the next step is to write a local UI using 328P , but, if nothing unexpected happens, it will be gurgling for a long, long, long time .
What needs to be noted here is that there are four 0Ω resistor pads next to the RH6616, which are used to select the working mode of the RH6616. I showed the stepless dimming mode in the demonstration video. Please refer to the datasheet for the specific mode. But please remember not to solder them all! Once they are all soldered, they will be short-circuited. As for which resistor is connected to ground or power supply, there will be a mark on the silk screen on the side.
5. Empty board pictures
As a project of Lichuang, the PCB board was drawn using Lichuang EDA. The components were bought at Lichuang Mall, and the PCB board and SMT were ordered at Jialichuang. So how could there be no pictures of Lichuang on the board, so Lichuang was added. Create a family bucket (some silk screen pictures are provided by Zhou Gong).
 
ps: The following are all pictures, nothing useful. If you don’t want to see them, you can just scroll to the end to read the notes and documents.
Control panel front Back of light panel family portrait
 
 
 
6. Display of soldered PCB
AKJIYdpzgLUZ2oDqbxAxRJVnzytlb1TDhqH3dHYI.png
The front of the welded light panel an angle another angle another angle
 
Maybe some students are going to complain about me, eh, why are all your photos taken at an angle? Because...this damn camera level is crooked, so everyone just bear with it and live to see it.
 
7. Power-on test
Because I am lazy and the code for communication with Tuya is not perfect, there are only two demonstration videos, a ws2812 breathing light and a local dimming video (complain about the camera of this phone, it automatically adjusts the brightness when shooting videos, which can be seen with the naked eye) It’s pretty obvious, but I can’t tell anything about it in the video)
Only open the "single button" filament Only open the "double-bonded" filament Purple ambient light with lighting function Blue ambient light with lighting function
 
 
 
 
8. Precautions
  1. Although there are soldering pads reserved on the upper and lower sides of the lamp board, try not to solder all the filaments, because to be honest, the power of this lamp is quite high and there are many filaments. It is probably too much for DCDC to solder all the lamps, even if you change to a DCDC. , the maximum output current of ip5306 is only 2.4A. Even if you change the charging chip, it doesn't make much sense, the battery capacity is only that big. And now that the light is turned on to maximum power, it is very bright, and the entire dormitory is illuminated as if it were daytime. Therefore, the reserved pad positions are only for the upper and lower parts. If you feel unsightly, you can delete them.
  2. The light board and the control board are connected using M3 copper pillars. Note that they cannot be replaced with plastic pillars because the copper pillars also serve as conductors. The six surrounding copper pillars are the positive electrode of the filament, and the middle one is GND. The power supply and data transmission lines of WS2812 use a single pin header and Dupont wire to connect the upper and lower boards.
  3. The code is not open source for the time being, because there are always small bugs in the communication with Tuya. It is speculated that it may be because Atmega328P does not have serial port interruption. And there are too few customization functions in Tuya (maybe I’m just too good at it). And the panel SDK of Tuya is too difficult to use. The panel I use is the ugly debugging panel, which I can’t even stand.
  4. Ceramic filaments are really really easy to break. This is not an alarmist, so please handle it with care. When picking it up and putting it down, try to hold the copper pillar instead of the filament, otherwise it will break easily (mine has been broken four times). Five of them)
  5. When welding, the negative electrode of the lamp can easily touch the copper pillar of another lamp, so please be careful when welding. Remember to use a multimeter to check whether there is a short circuit after soldering. The consequence of a short circuit is to blow up the control mos tube.
  6. Please try your best to buy all chips in Lichuang Mall (this is not an advertisement), otherwise the chips bought on Taobao may have some weird problems. For example, the ip5306 I bought this time will fall off when the load power consumption is high. , the mcu was pulled and shut down.
  7. Please don't plug in two USBs at the same time, don't ask why.
  8. If you want to use the local dimming function, please turn off the cloud control switch and turn the DIP switch of the light you want to turn on to "ON". Please note that the power of the MCU and Tuya module must be turned off, otherwise it may not work. In severe cases, the RH6616 chip may be burned out.
  9. Because I was lazy and didn't have a suitable location, I didn't add a battery holder. Only two battery pads were left. You need to manually solder the wires. It is recommended that you use 18650 batteries. There is just enough room for one 18650 battery on the back.
  10. Please note that there are components on the back, including a 22μ battery-side filter capacitor, two 10kΩ pull-up resistors, and an SHT30 temperature and humidity sensor. If you don’t want to use a temperature and humidity sensor, you can choose not to solder the resistor and SHT30. As for the filter capacitor...just be happy (doge).
  11. According to the datasheet of RH6616, it is paved with grid copper because of the need for touch. It looks pretty good. And there must be a certain distance between the copper paving and the touch point, so it is recommended to manually frame the area without copper paving. I covered the touch points with oil for good looks. If you don't want to cover them, just change the solder mask expansion of this pad to a normal positive number.
  12. It's still a problem with the RH6616. The 20nF capacitor and 5k resistor above are not commonly used capacitors and resistors. The capacitor can be replaced with 22nF or two 10nF capacitors connected in parallel; the resistor can be directly replaced with a 5.1kΩ resistor.
  13. The filament, SY8089, IP5306 and other components may become hot after long-term use, so please try not to touch them.
  14. The ceramic filament can still light up if it is broken, but it is very fragile, and there is a chance that only one side will light up. If the filament is broken during use, replace it with a new filament.
  15. Please do not solder the transistors or resistors used for level conversion at the same time. Only one of them is required. It is unknown what problems will occur if they are all soldered.
  16. Since the CH340C chip uses a 5V power supply, please connect a 10nF or 100nF capacitor in parallel with GND for V3 (the fourth pin). Please note that this is very important. Generally speaking, this is the reason why the serial port cannot be recognized.
  17. Each power supply pin of WS2812 on the lamp board is connected in parallel with GND with a 100nF filter capacitor. However, some lamp beads do not need it, so you can solder it as needed.
  18. There will be the next version of esp8266, which will be open source at that time, so stay tuned.
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-14 06:00:47

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号