Introduction: IOT Base Computing Using Nodemcu and Micropython

Picture of IOT Base Computing Using Nodemcu and Micropython

In this tutorial I am going to use NodeMcu, micropython and Mqtt connection to connect the server.

This tutorial is using https based mqtt connect to connect from Nodemcu to Adafruit.io Server.

In this project i am using micropython programming language which is almost simillar to python.

Step 1: Components Required

Picture of Components Required

Following Components are required to complete this project.

Components Required:

  • Nodemcu
  • IR sensor
  • LED
  • USB Cable
  • Internet Connection

Step 2: Getting Starting.

Picture of Getting Starting.

Procedure:

  • Download and install espcut software for debugging .
  • Download files from this link. which is stored as github repository. All program is available in this repository..
  • Download and install the micropython firmware from this link to the NODEMCU
  • Connect IR sensor to GPIO12 and LED to GPIO 2 of Nodemcu.
  • download this webrepl software

Step 3: Adafruit IO

Picture of Adafruit IO
  • visit to io.adafruit.com and log in to go to your dashboard.

Step 4: Create Dashboard

Picture of Create Dashboard
  • Click on action and create new dashboard

Step 5: Creating Blocks

Picture of Creating Blocks
  1. Click on the Dashboard name.
  2. again click on +(plus) button to create block
  3. Now Click on Toggle and give it a name.
  4. Now click on create button
  5. Next select your block and click on next step
  6. Give name to this block and set the names of ON state and OFF state.
  7. After that click on create block.

Repeat the process from 2nd step select text and create one more block as shown in figure.

Step 6: Final Dashboard

Picture of Final Dashboard

Your Final Dashboard will look like this.

Step 7: Get Username and Key

Picture of Get Username and Key

Click on key icon on left side of screen and Copy the username and Active key

Step 8: Enable WEBREPL

Picture of Enable WEBREPL
  • Open the espcut software
  • send this command "import webrepl_setup"
  • read the text on console and configure the webrepl.

Step 9: Connect to Webrepl

Picture of Connect to Webrepl
  • Find the wifi network who's ssid starts from micropython
  • connect to that ssid with password "micropythoN"
  • you will get the screen as shown in above figure.

Step 10: Add the Code

Picture of Add the Code
  • extract webrepl software, open webrepl.html and click on connect
  • it will ask you to provide password
  • in my case the password is "1234567"
  • wow you are connected.
  • upload the files which was downloaded from github repository.
  • upload main.py ,mqtt.py,boot.py and data.txt using webrepl.
  • now press reset on button on your nodemcu. and check output on io.adafruit.com
  • if you want check code execution then again you have to connect to micropython wifi and login.

Step 11: Working Video

The working video of this tutorial is available here.

Comments

About This Instructable

309views

7favorites

License:

Bio: This is shubham, very cool boy. passionate about electronics.
More by shubhamtrivedi95:Install Django on ASUS Tinker BoardIOT Base Computing Using Nodemcu and MicropythonLCD 16x2 Interface With Raspberry Pi
Add instructable to: