Super Useful Weather Clock

by nbaddorf in Circuits > Microcontrollers

1820 Views, 27 Favorites, 0 Comments

Super Useful Weather Clock

69014933325__B0ADC40B-D925-4511-9376-2A8E94F2A92E.jpeg

As a 17 year old inventor with a neigborhood lawn care job, I like to know what the weather is at all times. Because I don't like to carry my phone with me around the house, I wanted to have a nice big weather and time display. This clock has many cool features including sun position, chance of rain, and much more, so read on to the end to see all it can do!

Supplies

To make this, I used the following items:

  • Esp32
  • 4 Servos
  • Individually addressable led strip
  • LCD screen
  • PIR sensor
  • Skateboard bearings
  • 2 Buck Converters
  • 12v Power Supply

I used these tools:

  • Laser cutter
  • 3d Printer
  • Fusion360

Check If You Have Enough Space on Your Wall to Put the Clock

IMG_3029.JPG
IMG_3028.JPG

First, measure your wall to see if this project will fit. It is quite big, measuring 24 inches. I even went as far as saving the 3d model to my iPhone and using AR to visualize it.

If you would like to try visualizing the model in AR yourself, open Fusion360, open my model, and click file -> export -> .usdz. Then transfer that file to your iPhone over airdrop or icloud. On your iPhone, open the files app, find your model, and click on it. Easy as pi!

Cut the Wood, and Print the Parts.

I sadly forgot to take a picture of the lasercutting process, but I think you can imagine. If you don't have access to a laser cutter, you could cut the wood out by hand with a hand saw or bandsaw. Use the included 3d model to customize this clock and make it your own, or just use it to get the dimensions and print files.

Assemble the Clock

68965604101__E3D8DDC5-FF91-4827-9D9B-59B000DC5E12.jpeg
IMG_3084.jpeg
68991305134__96575469-B30C-4ABC-8DB7-47798AEEC807.jpeg

Now, assemble the clock by gluing the wood together, and hot-gluing the servos in place. Once the glue has dried, mount the LED strip along the interior wall of the clock.

Finally, wire up the servos, LCD, LEDs, and PIR sensor up to the ESP32 based off the Arduino code. For power, I used 2 Buck converters, one for the servo motors, and the other for the ESP32, LED strip, display, and PIR sensor.

Now all that is left is to modify and upload the code to the ESP!

Note: I did include OTA in the Arduino program, but it wasn't working for me. Maybe it will work for you!

Modify Code

Screen Shot 2023-01-16 at 11.48.38 AM.png

The first step is to open the Arduino sketch in the Arduino IDE.

Next, scroll down untill you get to ssid and password. Replace the ******* with your Wifi's name and password.

Now, in your browser, go to https://openweathermap.org/api and create an account. This is how to get the weather data. Next click on 'API' and click subscribe for the 'Current Weather Data'. You want a free account. Finally, click on your account name, then 'my API keys'. Copy the key and paste it into the Arduino sketch where it says 'key'. Now the program will be able to get weather data, except it doesn't know where you live yet.

Now go to Google Maps, type in your address, and right click on the little red waypoint that pops up. Write down the longitude and latitude.

Back in the Arduino sketch, find the two variables "endpoint" and "endpointForcast" and replace the "lat=40.1808" with "lat=YOUR_LAT" and "lon=-76.8568" with "lon=YOUR_LON".

Finally, depending on the time zone where you live, change "gmtOffset_sec" to your timezone offset in seconds. For reference, EST is -18000.


Now upload your code!

Using the Weather Clock.

IMG_3464.jpeg

This clock has many super cool features! My favorite is the accurate sun simulation. The top section of the clock lights up like the sun, and moves across the sky in real time. It even has a sunrise and sunset! The four hands are self explanatory, showing cloud cover, temperature, wind speed, and chance of rain in the next 3 hours. The bottom left lights show the humidity is a cool way! The lights turn completely green if there is 0% humidity and completely blue if there is 100%. Anywhere in between has a super cool morphing/fading between green and blue to show the current humidity. The bottom right lights turn blue if it is currently raining, white if it is currently snowing, and a blue to red fade when the weather is normal. The LCD display also shows data like humidity, but can easily be changed to show whatever you want. Finally, the next coolest thing on this project is that the lights turn off to save energy when it doesn't detect motion. As soon as you walk into the room with this clock, the lights light up in a rotating arc that looks amazing. Additionally, when motion is detected, the servos turn off so as to not make any noise. As soon as it stops detecting motion, the servos will update to show you the most up-to-date info. With this, the clock is set to go into "bedtime" mode from 8:00 PM to 7:00 AM where all lights stay off, and the servos don't make any noise.

Extra Calibration or Modification

This project was super fun to make in Fusion360, and to build. If you want to change anything on this project, go right ahead! I would love to see pictures in the "I made this" section!

If you are running into issues, check the code. One issue you will most likely run into is the hands not lining up with the text correctly. Near the bottom of the code is a large "if statement" that maps the weather values to servo outputs. Try changing the output rotations to better match the servo with the text.


Thanks for reading! I hope you get inspired to make your own Weather Clock!