This chapter assumes, that you have been successfully working through the previous two chapters (IDE Setup, Adapting Code). In this step we’re going to connect the display and start the weather station for the first time.
Connect the OLED display with the NodeMCU
The WeatherStation Kit comes with an OLED display that has four connectors: VCC, GND, SCL and SDA. They have the following meaning:
VCC and GND are the power supply of the display. VCC is the positive supply voltage and GND stands for “ground”. They will be connected to 3V3 and GND on the NodeMCU board
SCL and SDA are the data lines of the I2C protocol. SCL stands for Serial Clock and SDA for Serial Data.
In the following diagram I used a bread board and male-to-male jumpers to connect the components. But you can also connect them directly with four (coloured) female-to-female jumpers. They come with the WeatherStation Kit. Just peal the first four off of the bundle and connect them according to the picture. The colors do not matter
VCC to 3V3
GND to GND
SDA to D3
SCL to D4
There is a little confusion about the pin names. The Arduino IDE uses the GPIO number given by the chip. The NodeMCU team who designed the board changed the pin naming for their LUA firmware. Because of this you have now hardware labeled with one naming scheme and software that uses a different one. Use the following table to map between the two:
The IO index is the naming on the board, whereas the “ESP8266 pin” column
is the one you use in the Arduino IDE code. E.g. D5 on the board is pin 14 in C/C++
Now we’re all set to run the WeatherStation software for the first time. Click on the “Upload” arrow and wait until the compilation and the transfer have ended. Now you should see the OLED display lighting up and displaying a WiFi icon. It is trying now to acquire access to the wireless network you have defined earlier.
This is just the beginning. In the next chapter I will show you how to extend the weather station and display other information such as Stock Market information…