Introduction: IoT Desktop Clock and Thermometer
This instruction will show you how I built a desktop clock and thermometer, without any special tools. This desktop clock shows the current time, the temperature and the humidity. The clock is very precise because it is synchronized to a time server using the WiFi connection of an esp8266 NodeMCU IoT module. The humidity and temperature are measured with a local sensor. The unit is powered by a standard phone charger (5VDC). There are two displays installed. The first two digits of the upper display show the temperature in Celsius, the second two-digit show the humidity. The lower display shows the time. The complete electronics are built into a paper box, which was the packaging of a USB memory stick.
Step 1: BOM List
DHT22 digital temperature and humidity sensor module 1pc https://www.aliexpress.com/store/product/DHT22-si...
TM1637 7 Segment 4 digit Digital LED Display Module For arduino 1pc https://www.aliexpress.com/store/product/4-digita...
Arduino nano MCU board 1pc https://www.aliexpress.com/store/product/Freeship...
NodeMcu v3 Lua WIFI Internet of Things development MCU board ESP8266 1pc https://www.aliexpress.com/store/product/New-Wire...
Phone charger 1pc https://www.aliexpress.com/store/product/EU-Plug-...
Proto PCB 1pc https://www.aliexpress.com/item/20pcs-5x7-4x6-3x7...
housing 1pc gift box
solder tin 1pc https://www.aliexpress.com/store/product/Sale-Hig...
Total material cost of the project: 10,29 $/total project
Step 2: Assembly
Every step of the assembly process can be seen in the following video.
Some additional information to the video:
This is the second desktop clock I built. The instruction link of my first attempt: https://www.instructables.com/id/Desktop-watch-wi...
I made this instruction, because I did now I recorded the whole building process, and I made some modification. I had some issues with the 1.0 version. The biggest problem was that the RTC was inaccurate. The clock delayed significantly. This problem can be solved by IoT technology and periodic time server synchronization. In this project, I used NodeMCU, which will handle time synchronization.
Next step was to find the right housing. I chose a small paper box in which all parts fit in. I received this box as a present. Actually, a USB memory stick was the gift, this was the packaging of the USB memory stick. This paper packaging box was ideal for this project. I think any box (wood, plastic) with the right size can be used for this purpose.
It is a good idea to place all the components on and into the box before drilling any holes.
In the previous version, I did not fix the Arduino board to the box, but it caused a messy cabling. So now I decided to use a proto PCB. This solution needs more soldering but in the end it worth to do it, because the cables can be managed much easier.
Step 3: The Circuit
First I tried to use only the NodeMCU module, but it was not able to manage the DHT 22 sensor. I think the problem is that the DHT 22 is working on 5 V and the NodeMCU is on 3.3. I tried with level shifter module (3.3/5), without any success. In the end, I applied an independent Arduino nano for the sensor. It is 2 $ extra and it needs some space, but a level shifter module cost and need space as well. I cabled all the components according to the schematic.
I applied screws to fix all modules to the box, so there are no moving parts inside. Can be used in a car (if there is WiFi in the car, I tested with my mobile as a hotspot).
Step 4: Upload the Attached Software
For uploading the source code to the MCU-s use Arduino IDE Software and USB cables: https://www.arduino.cc/en/main/software.
There is a lot of instruction about how to program a NodeMCU ie.:
and how to program Arduino nano:
There is two code. One for the Arduino nano and one for the NodeMCU. Before uploading the NodeMCU code, change your Wifi credentials, and set your time zone. I left some note in the source code about, how to use remote weather data from https://openweathermap.org/. I wanted to show the outside temperature as well, but the accuracy from this service was not ok for me, maybe the sensor is too far from my location.
Step 5: Final Words
I have used this clock for 2 months without any problem. During that time, I also upgraded my older unit, see attached. Now I'm happy with both units. I plan to create a more advanced version of this clock.
Have a nice day!
This is an entry in the
Creative Misuse Contest