ESPWatch With Weather Forecasting

by makerfabs in Workshop > Science

3134 Views, 33 Favorites, 0 Comments

ESPWatch With Weather Forecasting

Makerfabs_ESPWatch_1.jpg
Makerfabs_ESPWatch_3.jpg
Makerfabs_ESPWatch_4.jpg
Makerfabs_ESPWatch_5.jpg

The ESPWatch is based on ESP12 WIFI module, it gets the date/ time and the weather forecasting in few days from Internet server, and can also remote control the local instruments, such as Relay/LED/Fan. With this learning, you will learn the basic skill of components soldering/Arduino Programming/WIFI usage/Basic http protocol, the first& easy step to get into the electronic/programming world.

There we also prepared simple case/watchband, so that you can get it works on your wrist within few minutes.

Supplies

Makerfabs

Hardware Assembly

How to make a DIY Smartwatch? ESP12 IoT Kit!

The ESPWatch is a kit for customer assembling, users should firstly solder all the components. A soldering iron and some Tin wires are needed.There the detailed soldering guide at youtube.

Setup Arduino IDE

Makerfabs_ESPWatch_6.jpg
Makerfabs_ESPWatch_7.jpg
Makerfabs_ESPWatch_8.jpg

The ESPWatch is based on the Arduino IDE, if there no Arduino IDE in your Computer, please download the latest Arduino IDE at:

https://www.arduino.cc/en/Main/Software

Install the IDE and all the related drivers and Start the IDE, there would be a simple sketch by default.

Add the ESP8266 Core Into Arduino IDE

Makerfabs_ESPWatch_9.jpg
Makerfabs_ESPWatch_10.jpg
Makerfabs_ESPWatch_11.jpg

Start Arduino and open Preferences window, and enter https://arduino.esp8266.com/stable/package_esp826... into Additional Board Manager URLs , and clink OK.


And then you should find the ESP8266 in the Arduino IDE: Tools->board-> boards manager, let’s install it by click the “install”:


After the installing, you can find the NodeMCU 1.0(ESP12E module) platform at Tools-> Board Menu:

Install Related Library

Makerfabs_ESPWatch_12.jpg
Makerfabs_ESPWatch_13.jpg
Makerfabs_ESPWatch_14.jpg
Makerfabs_ESPWatch_15.jpg
Makerfabs_ESPWatch_16.jpg
Makerfabs_ESPWatch_17.jpg
Makerfabs_ESPWatch_18.jpg

There at least these libraries need to be installed:

We can seach "ntpclient","lwmqtt", " ESP8266 OLED Driver for SSD1306 display","timekeeping",“ESP8266 Weather Station”, ”JSON Streaming Parser” to find these libraries in library manager, and install them.


Open the sketch->include library->manage libraries

MQTT Register for Time

Makerfabs_ESPWatch_19.jpg
Makerfabs_ESPWatch_20.jpg
Makerfabs_ESPWatch_21.jpg
Makerfabs_ESPWatch_22.jpg

1. Log-in the cloudMQTT(if no, you need to register an Account)

2. And Create a new instance

3. And then here you can get the instance info:

Weather Forecasting

Makerfabs_ESPWatch_23.jpg
Makerfabs_ESPWatch_24.jpg
Makerfabs_ESPWatch_25.jpg

We use the thingpulse(https://docs.thingpulse.com/how-tos/openweathermap-key/) to get the weather forcasting data, the final data from openweathermap (https://openweathermap.org/price).

Let’s use the free data.

After regestering, you will get your API key , And you can also check your city ID at the website https

Hardware Connection

Makerfabs_ESPWatch_26.jpg
Makerfabs_ESPWatch_27.jpg

Connect the ESPwatch to PC with PL2303 UART wire, the drivers at: http://www.prolific.com.tw/US/ShowProduct.aspx?p_... After driver installed , it will act as a COMM port.

Connect the PL2303 wire to ESPwatch programming port:

Programming

Makerfabs_ESPWatch_29.jpg
Makerfabs_ESPWatch_30.jpg
Makerfabs_ESPWatch_31.jpg
Makerfabs_ESPWatch_32.jpg

Open the watch.ino sketches:

1. Change SSID and passowrd of the Wi-Fi, 2. Modify hostname, port, user and user_password for MQTT, 3. and the weather_map_ID and Location_ID;

2. We can now update the codes to ESPWatch now. Select the right COM prt and board in Arduino IDE.

3. Hold the FLASH button; Power on the ESP8266 by the SW1, while the FLASH button holding on, to put ESP8226 into bootloader mode ,and click the upload to start the programming:

*Premuim* ESPWatch Remote Control

Makerfabs_ESPWatch_33.jpg
Makerfabs_ESPWatch_34.jpg
Makerfabs_ESPWatch_35.jpg
Makerfabs_ESPWatch_36.jpg
Makerfabs_ESPWatch_37.jpg

The ESPwatch can be also use to control other modules, such as the ESP relay: https://www.makerfabs.com/index.php?route=product/product&product_id=534&search=ESP+relay, and thus to create remote control application, such as AC lamp/Fans.
1. Create a new MQTT instance,Log-in the cloudMQTT(if no, you need to register an Account), and create a new instance。

2. Sketch Modification. Open the sketches relay.ino, change SSID and passowrd of the Wi-Fi, and modify hostname, port, user and user_password for MQTT.

Noted: port must same as the watch.

3. Programming. Plug the ESP-01 on the ESP8266 debugger, and programming the ESP module, Select the right board to begin the programming


And now you can connect the Relay to your AC lamp/Fan,etc, to make it remote controlled by the ESPWatch.