Introduction: ESPWatch With Weather Forecasting

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

Step 1: Hardware Assembly

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.

Step 2: Setup Arduino IDE

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.

Step 3: Add the ESP8266 Core Into Arduino IDE

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:

Step 4: Install Related Library

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

Step 5: MQTT Register for Time

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:

Step 6: Weather Forecasting

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

Step 7: Hardware Connection

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:

Step 8: Programming

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:

Step 9: *Premuim* ESPWatch Remote Control

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.