Skip to content

Latest commit

 

History

History
72 lines (55 loc) · 4.03 KB

diy.md

File metadata and controls

72 lines (55 loc) · 4.03 KB

NodeMCU

For introduction to NodeMCU and setting it up, visit here.

Project- GEOLOCATION

INDEX

  1. Introduction of project
  2. Getting the prerequisites
  3. Hardware
  4. Software

INTRODUCTION OF PROJECT

In this project we will print the latitude and longitude of the network host on an OLED Display with the help of NodeMCU. For this, we will use a NodeMCU, an OLED display as the hardware components and ipstack geolocation API, Aurdino IDE for the software components.

GETTING THE PREREQUISITES

Using these OLEDs with Arduino sketches requires two libraries to be installed: Adafruit_SSD1306, which handles the low-level communication with the hardware, and Adafruit_GFX, which builds atop this to add graphics functions like lines, circles and text.The method of the installation of these libraries can be found in the inroductory section of the project.

HARDWARE

NodeMCU:

NodeMCU is a system on a chip (SoC) design with components like the processor chip. The processor has around 16 GPIO lines, some of which are used internally to interface with other components of the SoC, like flash memory.

Since several lines are used internally within the ESP8266 SoC, we have about 11 GPIO pins remaining for GPIO purpose.

Now again 2 pins out of 11 are generally reserved for RX and TX in order to communicate with a host PC from which compiled object code is downloaded.

Hence finally, this leaves just 9 general purpose I/O pins i.e. D0 to D8.

NodeMCU

OLED Display:

The OLED we use here is a 0.96" 128x64 display. It has 4 pins-

  1. Power: It is used to power up the OLED,connected to the 3.3V pin on the NodeMCU.
  2. Ground: It is connected to the ground pin in the NodeMCU.
  3. SCL: It is a serial clock pin for OLED-NodeMCU interface.
  4. SDA: It is a serial data pin for OLED-NodeMCU interface.

OLED Display

CIRCUIT-

Circuit

SOFTWARE

Setting Up The API

  1. Open ipstack.
  2. Click on SIGN UP FREE then click on GET FREE API KEY.

sign up

free api

  1. Fill the form and click on Sign Up.

free api free api

  1. Copy the API access key.

free api

Sending Data to Spreadsheet

For instructions on how to setup the google spreadsheet-NodeMCU communication refer to this link. The code for the spreadsheet can be found in this file.

NodeMCU Code

  1. Copy the code from this file.
  2. Write your host name in place of 'SSID' and your password in place of 'PASS'.
  3. Replace 'YOUR_API_KEY' by the API key copied( see the process of setting up the api in the previous section).

Now connect your laptop with NodeMCU using a USB cable and upload the code.

CITATION