Weather Lamp

by Mukesh_Sankhla in Circuits > Raspberry Pi

10660 Views, 50 Favorites, 0 Comments

Weather Lamp

Weather Lamp #arduino #raspberrypi
DSC00202.JPG

Weather Lamp is a RGB lamp made using Wiznet Pico WizFi360 and WS2812B LED's. The lamp simulates the real-time weather using the openweathermap.org API. It read parameters like cloud intensity, temperature, time and try to mimic the cloud colors, sun/moon and change the base color as temperature range.

 

Thank You NextPCB:

This project is successfully completed because of the help and support from NextPCB. NextPCB is one of the most experienced PCB manufacturers in Global, has specialized in the PCB and assembly industry for over 15 years. Not only could NextPCB provide the most innovative printed circuit boards and assembly technologies in the highest quality standards, the fastest delivery turnaround as fast as 24 hours.

Guys if you have a PCB project, please visit their website and get exciting discounts and coupons.

Only 0$ for 5-10pcs PCB Prototypes:Nextpcb.com/pcbprototype

Register and get $100 from NextPCB: Nextpcb.com/coupon

Supplies

1 x WizFi360-EVB-Pico

1 x WS2812B LED Strip


3D Printer

White Filament

Solder Kit

Connecting Wire


To get high-quality electronic components at an extremely low cost, hqonline.com is the perfect site. They have labels from all the international brands, so you can find the best components for your device without spending a lot of money. This offers you the best value for your money.

Designing & 3D Printing

WeatherPlant1.png
WeatherPlant v5.png
IMG_20220821_213240.jpg
IMG_20220822_163338.jpg
  • I have designed the model in Fusion360.
  • Download the STL Files and 3D print them.


Circuit Connection

Wiznet Weather Lamp.png
IMG_20220828_183831.jpg
IMG_20220828_183842.jpg
IMG_20220828_190128.jpg
IMG_20220828_190133.jpg
  • Connect the WizFi 360 and WS2812B LEDs as shown in circuit diagram.

Assembly

IMG_20220828_184544.jpg
IMG_20221026_214744.jpg
  • Assemble all the parts together using quick glue.

Getting Openweathermap API Key

Screenshot (1).png
Screenshot 2022-10-26 222129.png
  • Go to openweathermap.org and create your account and verify it.
  • Now login to your account and click on you profile or right-top corner and go to My API Keys.
  • Copy the API Key that you see this will be used later in Step 6.

Arduino Libraries Setup

Screenshot 2022-10-26 213443.png
Screenshot 2022-10-26 213420.png
Screenshot 2022-10-26 220118.png
Screenshot 2022-10-26 213319.png
Screenshot 2022-10-26 213240.png
  • First go to Files->Preferences and copy paste the following URL in Additional Boards Manager URLs:
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
  • Go to Tools->Boards->Boards Manager and search for Raspberry Pi Pico/RP2040 and dinstall it.



  • Now got to Sketch->Include Library->Manage Libraries and Search for ArduinoJson, Adafruit_NeoPixel and install them.


Code Changes

Screenshot 2022-10-26 220524.png
Screenshot 2022-10-26 221015.png
Screenshot 2022-10-26 220840.png


  • At Line.No 20 you have to edit your Wifi Name(SSID) and Password.
/* Wi-Fi info */
char ssid[] = "SSID";       // your network SSID (name)
char pass[] = "PASWORD";   // your network password


  • At line 153 I have added 5 to hour and 30(Indian time zone IST 5:30) to Minutes and applied a maths to convert the APIs GMT time into ISt time zone.
  • You may have to change the number(5 and 30) according to your tiem zone.
      h = (h + 5) % 24;
      Serial.println(h);
      minute = (m + 30) % 60;


  • At line 282 you have to enter your locations Longitude, Latitude and You accounts openweathermap API key.
    // send the HTTP PUT request
    client1.println(F("GET /data/2.5/weather?lat=17.6795&lon=77.6051&appid=43f22249d3d42ec***********ca809b HTTP/1.1"));

Code Compile and Uplaod

Screenshot (2).png
Screenshot (3).png
Screenshot_20221026_102935.png
  • Connect your device usinh MicroUSB cable.
  • Select the board type and port from tools.
  • Now click on uplaod code, it will automatically compile and uplaod the code.
  • After code is succesfully uloaded the device will connect with provided wifi and show the output.


Note: I am using My PCs USB as the power source for the Weather Lamp, you can use a 5V adapter or a 3.7V Lithium Ion battery.