Author Topic: NodeMCU Step By Step  (Read 17862 times)

0 Members and 1 Guest are viewing this topic.

Offline stillwater

  • Posts: 149
  • Take the crap out and give it to me straight.
Re: NodeMCU Step By Step
« Reply #20 on: March 04, 2017, 02:47:01 AM »
A quote from YHB re: The "Standard" Parrot
Quote
easy enough for even an Arduino novice to build

I must be a kind of lazy sod . . . .  :(
Hunting down the bits 'n' pieces - sweating on getting the correct part number - waiting on mail from disparate suppliers  . . .  it all takes a toll on my time, concentration (what there is of it) and enthusiasm.

I'd be happy to pay wages and handling fees to some kid (literally) in Shenzhen to air-mail out a "starter-kit" to me in one hit.
No robbing parts from other projects ~ having a separate box for 'each project' full of itty bitty bits would make it much easier to 'follow along'.

But I do enjoy reading the contributions made by everyone actively involved and I hope it never stops!


Offline Eucyblues

  • Posts: 774
Re: NodeMCU Step By Step
« Reply #21 on: March 04, 2017, 03:44:53 AM »
A starter kit seems an obvious step when all else is sorted

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #22 on: March 15, 2017, 10:06:13 AM »
OK folks, looks like most of this is sorted now.
So lets begin again... 

Download the libraries attached to this post.
Empty out your libraries folder and install these 5 libraries using the Arduino IDE > Sketch > Include Library > Add .Zip Library > navigate to the zip and click to highlight the library and click Open. Repeat until all 5 have been installed.

It is important to use these libraries and ONLY these libraries for the NodeMCU to work so don't assume that a library with the same name is a library that will work.

Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #23 on: March 15, 2017, 10:13:34 AM »
Close the Arduino IDE and open your libraries folder to see that each of the libraries are installed.

Throughout this tutorial we will be referring to this drawing.

NodeMCU_plus_Arduino_Sketch - sensors_bb.pngNodeMCU Step By Step
* NodeMCU_plus_Arduino_Sketch - sensors_bb.png (325.63 kB. 350x133 - viewed 1004 times.)

As always, just click on the picture to enlarge it.
Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #24 on: March 15, 2017, 10:29:18 AM »
This is a 12 step program to get you a very functional eParrot.
Some of the steps are not used in the final eParrot and are included so you can add extra functionality to your personal eParrot.

The first Step is to get the NodeMCU and 20 character x 4 line LCD display to work together.

We'll call this STEP 1, because we like really clever names, right?

We'll be using the serial (I2C) backpack.
My older backpacks have an internal I2C address of 0x27 and my newer ones have the address of 0x3F. 
So you may need to change the code to your backpack address.

Breadboard your NodeMCU (hereafter referred to a Node) and wire your LCD to it as shown in the above drawing.

Download the sketch that is attached to this post, unzip it and run it.

You should get the following...

step_1.pngNodeMCU Step By Step
* step_1.png (228.02 kB. 350x262 - viewed 885 times.)
Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #25 on: March 15, 2017, 10:43:48 AM »
STEP 2

Let's add a sensor to the Node's digital pin 5.
The Dallas Sensor DS18B20 (hereafter referred to as Dallas) needs a pullup resistor from VCC (that the + voltage) to the digital (sensor) wire. It is usually colored yellow or blue.

Use the attached sketch to get the following...

step_2.pngNodeMCU Step By Step
* step_2.png (165.76 kB. 350x262 - viewed 995 times.)

Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #26 on: March 15, 2017, 10:57:07 AM »
STEP 3

Two Dallas sensors.

*********************
At this point I'd like to mention that the Nodes come in two different versions.
V1 and V3. V1 is smaller and has a white background on the bottom side.
I am using V1.
If you have V3 Nodes then your pin assignments may be different from mine.
If you have a V3, please chime in if there is in fact a different pin assignment.
*********************

If one sensor is good then two sensors is, well, twice as good!

Step_3.pngNodeMCU Step By Step
* Step_3.png (157.73 kB. 350x262 - viewed 912 times.)

Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #27 on: March 15, 2017, 11:02:14 AM »
STEP 4

No picture for this one so imagine a very irritating sound.
This is our buzzer or small speaker for the alarm.

Unlike the layout picture I did not use a transistor. Just wired the negative lead to the pin and the (+) goes to VCC.

You can use a low ohm resistor to make the buzzer a little less loud if you like.

"Stick with me baby, you'll be wearing diamonds big as ice cubes."
Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #28 on: March 15, 2017, 11:16:53 AM »
STEP 5

Our Dallas and Alarm working together.

It may be necessary to cycle the power to the Node after uploading a sketch.

Yes, that sound does get irritating quickly.

It's a little warm here today so I adjusted my sketch from 24 to 25C. 

Step_5.pngNodeMCU Step By Step
* Step_5.png (229.44 kB. 350x262 - viewed 951 times.)
Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #29 on: March 15, 2017, 11:31:09 AM »
STEP 6

The BMP 280 Pressure Sensor (hereafter referred to as the 280).

The Nodes pins are 3.3 V so a level shifter is not needed.

The 280 is an I2C device and will share the same Node pins, data and clock, with the LCD.
The LCD is fed power by VIN (voltage in, 5V from the USB) while everything else that needs power will connect to the 3V3 pin.

The LCD will now display the 280's pressure and temperature readings.

Step_6.pngNodeMCU Step By Step
* Step_6.png (181.22 kB. 350x262 - viewed 798 times.)

Yeah, baby, we're on a roll now.
Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #30 on: March 15, 2017, 11:40:01 AM »
STEP 7

Let's add some push buttons.

Refer to this drawing and remove other wires from previous Steps if necessary.
At least temporarily.

NodeMCU_plus_Arduino_Sketch - Buttons_bb.pngNodeMCU Step By Step
* NodeMCU_plus_Arduino_Sketch - Buttons_bb.png (313.89 kB. 350x118 - viewed 747 times.)

Step_7.pngNodeMCU Step By Step
* Step_7.png (152.24 kB. 350x262 - viewed 789 times.)
Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #31 on: March 15, 2017, 11:47:20 AM »
STEP 8

Let's take a Dallas reading and convert that to %ABV.
To use just the heat of your hand we'll adjust the code a bit to make the Dallas reading much higher than actual.

Step_8.pngNodeMCU Step By Step
* Step_8.png (168.08 kB. 350x262 - viewed 767 times.)

Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #32 on: March 15, 2017, 11:52:49 AM »
STEP 9

And now let's compensate for barometric pressure.

Step_9.pngNodeMCU Step By Step
* Step_9.png (171.57 kB. 350x262 - viewed 766 times.)

Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #33 on: March 15, 2017, 11:59:59 AM »
STEP 10

Let's compare the %ABV with and without the 280.

Guess I'd need to ride up and down the elevator again to get a different pressure reading, the current pressure is very close to the default.

Step_10.pngNodeMCU Step By Step
* Step_10.png (175.67 kB. 350x262 - viewed 790 times.)
Stay calm and follow the screaming people.

Offline YHB

  • VS Moderator
  • Posts: 905
Re: NodeMCU Step By Step
« Reply #34 on: March 15, 2017, 12:12:25 PM »
 /thumbsUp /thumbsUp /thumbsUp

AWESOME

 /thumbsUp /thumbsUp /thumbsUp
Where Thrift Becomes An Art-Form

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #35 on: March 15, 2017, 12:15:17 PM »
STEP 11

Column and Boiler %ABV using hand temperature.

We're closing in on it now boys!

Step_11.pngNodeMCU Step By Step
* Step_11.png (161.02 kB. 350x262 - viewed 808 times.)

Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #36 on: March 15, 2017, 12:24:17 PM »
STEP 12

The final step in this series. We'll adjust the "hand" temperatures back out so the Dallas sensors can read true.

Step_12.pngNodeMCU Step By Step
* Step_12.png (156.61 kB. 350x262 - viewed 738 times.)

Stay calm and follow the screaming people.

Offline ShiFu

  • eParrot.org
  • Admin
  • Posts: 1984
Re: NodeMCU Step By Step
« Reply #37 on: March 15, 2017, 12:29:39 PM »
It ain't over, the fat lady hasn't sung yet.

The basic eParrot has now been ported to the NodeMCU and we still have the awesome WiFi capabilities of the Node to explore and add to our little bird.

And that's for another day. It's time for me to go outside and play. 


Just remember that the LCD is powered by the VIN pin. The Node cannot survive if much over 6V is applied to it.
A good 5 volt source to this pin is recommended. If push more than ~5.5V to VIN you should move the LCD off of that power pin. 

Edit: The onboard AMS1117-3.3V power regulator says it can handle 4.5 to 7 volts.
Stay calm and follow the screaming people.

Offline Eucyblues

  • Posts: 774
Re: NodeMCU Step By Step
« Reply #38 on: March 15, 2017, 05:29:36 PM »
Good work ShiFu  :) :)

« Last Edit: March 15, 2017, 06:08:17 PM by Eucyblues »

Offline ketel3

  • Admin
  • Posts: 1377
  • Eparrot.org
Re: NodeMCU Step By Step
« Reply #39 on: March 16, 2017, 12:16:23 AM »
You did it again ..... amazing for me you are a wizzard  ;)
Better bad weather than no weather