1. Node MCU
LAB ACTIVITY - 1
Submitted to-
Prof. Divanshu Jain
Submitted By-
Akshat Modani
2020BTechCSE008
August 2022
2. Aim: To understand the pin diagram, architecture and Specifications of NodeMCU
3.
4. Aim: To blink the inbuilt LEDs of NodeMCU
Hardware used:
• NodeMCU
• USB Cable
Code:
Explanation:
D0 or GPIO16 is the pin which connects to inbuilt led of nodemcu. In the setup function we
initialised the pin and in loop function we firstly set HIGH to the LED and then after a delay
of 5 second the inbuild led is set to LOW.
Results:
Video Link
6. Aim: To blink the External LEDs connected to pin number D5, D6, D7 of NodeMCU
Schematic Diagram:
Hardware used:
• NodeMCU
• USB Cable
• Three LEDs
• Jumper wires
Code:
7. Explanation:
Three LEDs are connected to three pins i.e. D5, D6 and D7. The code is very simple at a time only one
led is ON. LOW means on and HIGH means that the LED connected to that pin is off.
Results:
Video Link
9. Aim: To print the data on serial monitor of NodeMCU
Hardware used:
• NodeMCU
• USB Cable
Code:
Explanation:
The baud rate is the rate at which information is transferred in a communication channel. "9600 baud"
means that the serial port is capable of transferring a maximum of 9600 bits per second. In this code
first I initialised baud rate as 9600 bits per second and I printed “Akshat Modani”. To see the output
the baud rate must be same in the serial monitor as in the code.
Results:
Learning Outcome: In this activity I learned how to display data on serial monitor.
10. Aim: To print data generated by LM35 on serial monitor of NodeMCU and blink LED
when temp gets change.
Schematic Diagram:
Hardware used:
• NodeMCU
• USB Cable
• LM35 sensor
• Jumper wires
Code:
11. Explanation:
In LM35 with an increase of 1 degree Celsius in the temperature, the output at the Vout pin will
increase by 10 millivolts. The number we read from the ADC A0 pin isn't the actual voltage value.
The ADC divides its analog input range of 0v – 3.3v into 1024 discrete output values. It gives you a
number between 0 and 1023 where 0 means 0v and 1023 means 3.3v. So, to calculate a value in
between you take the reading and multiply by 3.3v/1024.
After using the above information, we get the temperature in Celsius and then we calculate
temperature in Fahrenheit by using the standard conversion formula.
Results:
12. Learning Outcome:
In this activity I learned how to use LM35 sensor, how the temperature is measured by the
sensor (mathematical calculation).