1. Project introduction
This project is a network weather clock based on ESP12E/12F, powered by a 3.7V lithium battery, which can display the current time and weather conditions today, tomorrow and the day after tomorrow.
The whole thing is composed of an OLED screen and two PCBs superimposed. The ESP8266 minimum system is in the middle, and the TP4056 charging module is below. The OLED screen is welded on the top, and a lithium battery is sandwiched between the two PCBs.
2. Precautions
The OLED screen I purchased from a Baoxintai Microelectronics store is available in both 0.96-inch and 1.3-inch sizes. There are two PCBs of different sizes in the project, so be careful not to get them mixed up . (I think 1.3 inches looks better...)
In the TP4056 charging schematic diagram, R8 is used to set the charging current. Since the battery capacity is small, you can increase the resistance of R8 appropriately, such as 2.4K.
Pay attention to the order when soldering. After soldering the components on the two PCBs, first solder the IN- and IN+ pin headers of the PCB on the ESP8266 minimum system. The pin headers are placed on the back, facing backward, for connection with the charging PCB; then Weld the OLED screen to the minimum system; then clamp the battery between the charging PCB and the minimum system, stack the two PCBs together, and finally solder the pin headers connecting the two boards.
It is best to fix it with copper pillars when welding. 0.96 inches: M2* 5 double-pass copper pillars are used between the OLED screen and the minimum system, and M2*10+3 copper pillars are used between the minimum system and the charging PCB. 1.3 inches: M3* 5+6 copper pillars are used between the OLED screen and the minimum system , and M3*8 double-pass copper pillars are used between the minimum system and the charging PCB. Just use screws of corresponding sizes at both ends, but the 1.3-inch screen mounting hole is too close to the screen and the screws cannot be screwed on. . .
Battery size: 401020 lithium battery is recommended for 0.96-inch, and 402025 lithium battery is recommended for 1.3-inch.
If the battery clip doesn't fit in, stick it at the end. . .
I probably tested it and found that a 100mah battery is enough to keep the light on for 20 minutes. . . . The power consumption is really high. . . You can try to modify the program to change the display from every second to every minute, which should keep the light on longer.
3. Hardware part
The preview of the empty board is as follows ( don’t complain about my photography skills... )
0.96 front and back
1.3 inches front and back
4. Software part
The software is written by me. It may not be very good and may have some bugs. You can modify it yourself. I have fully commented it.
Developed using Arduino, several libraries are used. I will attach these library files.
Program flow: Power on - initialize various gadgets - read the WIFI account and password stored in the flash memory and try to connect. If it fails, create a WIFI for network distribution (the Arduino WiFiManager library is used for network distribution); if the network is successfully connected, the time and weather are obtained and displayed. . Among them, the D3 button is written as an external interrupt, which is triggered by the falling edge. It is used to change the display content. Press it once to switch to the interface. There are four interfaces: time, today's weather, tomorrow's weather, and the day after tomorrow's weather.
The NTPClient library is used to obtain the time, and the weather is known by heart. Just apply for a free key.
(Since I wrote the program myself, if you encounter any problems when using my program, you can ask via private message or comment, and I will try my best to help solve it)
You need to take your own mold for the Chinese characters of the city. I don’t have a Chinese character library or anything. . . Then take the array in the MyFont file and change the city, and the size will be 32*20 .
Reference example of city text modeling: Take the city of Xi'an as an example, type Xi'an in Word, set the font to size 10 italic without bolding (the font can be changed), set the character spacing to 1.2 points in the font advanced options, and then Use the screenshot tool to take a screenshot and save the file with a size of 32*20; then open http://tools.clz.me/ , which is a tool library of a master in the Arduino community. We use the image to bitmap tool (of course you can use other tools). Similar tools), select the file, select the file you just saved, adjust the color threshold so that the text in the rendering is clearly legible, then copy the array content in the conversion result below to the city array in MyFont.h, compile and upload That’s it. If the display is abnormal, you can choose to switch the big and small ends when taking the mold, and then repeat the subsequent steps to try; if the colors are reversed, check the color inversion.
In the demonstration video, I created a hotspot with my mobile phone. The network has been configured, so it automatically connected. When connecting for the first time or changing WIFI, you need to configure the network, and then it will automatically connect.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet