IOT Base Computing Using Nodemcu and Micropython

by shubhamtrivedi95 in Circuits > Electronics

2239 Views, 8 Favorites, 0 Comments

IOT Base Computing Using Nodemcu and Micropython

logo.bmp

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.

Components Required

ir.jpg
led.jpg
usb.jpg
nodemuc.jpg

Following Components are required to complete this project.

Components Required:

Getting Starting.

nodemcu_pins.png
SCH.bmp

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

Adafruit IO

step3-1.jpg
  • visit to io.adafruit.com and log in to go to your dashboard.

Create Dashboard

step3-2.jpg
  • Click on action and create new dashboard

Creating Blocks

step3-3.jpg
step3-4.jpg
step3-5.jpg
step3-6.jpg
step3-7.jpg
  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.

Final Dashboard

step3-8.jpg

Your Final Dashboard will look like this.

Get Username and Key

step3-9.jpg

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

Enable WEBREPL

step 8.jpg
  • Open the espcut software
  • send this command "import webrepl_setup"
  • read the text on console and configure the webrepl.

Connect to Webrepl

step 10.png
step9.jpg
  • 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.

Add the Code

step 12.png
  • 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.

Working Video

IOT Base computing using Nodemcu and Micropython

The working video of this tutorial is available here.