Industrial Training Report (Iot)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

INDUSTRIAL TRAINING REPORT

ON
IOT AND PYTHON

Name of the course: Iot (Internet of things) and Python programing


language.

Company: (Static.Int Educare)


From : 1/08/2021 To: 15/09/2021
Name of the student: Nadar Livin Renish
Enrollment no:2004230048
Branch of engineering: Electronics and Telecommunication
engineering.(EJ5I)

Name of Polytechnic: Agnel Polytechnic, Vashi


CERTIFICATION
Abstract

One of the most popular era of computer world is from the generation
5'. Here new trends like AI, Internet of things (IoT) etc are came into
force. Internet of Technology or simply IoT is considered as an Internet
technology which connects devices, nodes and other tools to the
internet by means of wireless technologies. By using the IoT one can
easily does a lot of things through internet without human interaction.
In this paper it is mainly focus on the relationship between IoT and one
of the important programming language used today, that is Python.This
report is fully based on the 6 -week of industrial training internship
completed on STATIC.INT EDUCARE
Contents :
Python:

1. Introduction of python.
2. How to install python.
3. Basic Building Blocks and of Python .
4. Control Flow Statements in python .
5. Data Structures in Python
6. Functions in Python.
7. File Handling and Exception Handling in programming.
8. Object oriented programming in Python
9. Raise and User Defined Exceptions in Python.
10.Benefits of learning python.

IOT (Internet of Things):

1. Introduction of iot.
2. Software used
3. Hardware used

Projects:
i. Blinking LED on Node MCU.
ii. Alternative blinking on Node MCU.
iii. Alarm using IR sensor.
PYTHON

1.INTRODUCTION :

What is Python?
Python is a popular programming language. It was created by Guido van
Rossum, and released in 1991. It was designed with an emphasis on
code readability, and its syntax allows programmers to express their
concepts in fewer lines of code.
Python is a programming language that lets you work quickly and
integrate systems more efficiently.

It is used for:

• web development (server-side),


• software development,
• mathematics,
• system scripting.

What can Python do?

• Python can be used on a server to create web applications.


• Python can be used alongside software to create workflows.
• Python can connect to database systems. It can also read and
modify files.
• Python can be used to handle big data and perform complex
mathematics.
• Python can be used for rapid prototyping, or for production-ready
software development.
Why Python?
• Python works on different platforms (Windows, Mac, Linux,
Raspberry Pi, etc).
• Python has a simple syntax similar to the English language.
• Python has syntax that allows developers to write programs with
fewer lines than some other programming languages.
• Python runs on an interpreter system, meaning that code can be
executed as soon as it is written. This means that prototyping can
be very quick.
• Python can be treated in a procedural way, an object-oriented way
or a functional way.

Installing python :
Many working frameworks, for instance, macOS and Linux, accompany
Python pre-introduced. The rendition of Python that accompanies your
operation framework is called your framework Python.

There are two significant forms of accessible Python: Python 2,


otherwise called inheritance Python, and Python 3. Python 2 was
discharged in the year 2000 and ought to arrive at its finish of-life on
January 1, 2020. This course 3 centers on Python.

Installing and running in Windows :

Go to https://www.python.org/downloads/ python official site and


click Download Python.
1. When the download is finished, double-click the file and follow
the guidance to install it. At the time of installing Python, a
program called IDLE will be installed also. It gives a graphical
user interface to work with Python.
2. Now open that IDLE program, then copy the following code
and paste it in text area.
Print ("Hello, World!")
3. Now press ‘F5’ to run the code.
4. An interface will appear whether you want to save this file or
not. Click on yes and if your Python is correctly installed idle
will open one more window also known as terminal and your
text Hello, World! Will be printed over there which means
you’ve completed making your first program and also your
python Is correctly installed.
5. While Saving the file always remember to write (.py ) after
your file name
For example- filename.py.

Basic Building Blocks of Python


Python building blocks:
Language basic building blocks like identifiers keywords variables their
types and commenting section. This basic contains are used and applied
in almost every program. In this section we will see and discuss this
Python building blocks.
Python identifiers:
Any name is called as identifier. This names include variables name,
functions name, class name, object name, package name and module
name , etc.

Like other programming knowledge, python also has same rules of


giving identifier to an entity:such as,

• They start with letter A-Z or a-z or underscore [ _ ]. Internally, they can
have digits but not to start with.
• Their length is not Limited. But referred to be meaningful.
• They should not contain whitespaces.
• They are case sensitive. That is 'num' and 'NUM' are different.
• They should not be keywords.(it will show error, saying "Syntax error:
Invalid syntax") .
Some example of valid and invalid identifiers :
• num #valid
• wordCount #valid
• account_number #valid
• x_co-ordinate #valid
• _4 #valid, but meaningless
• ErrorNumber4 #valid
• Plot#3 #invalid because of special symbol #
• account number #invalid because of space
• 255 #invalid because starts with digit
• empno. #invalid because of special symbol .
• and #invalid because and is a keyboard

And one more important thing, while using underscore [ _ ] ine


identifiers for class members, be careful.
Because the count and appearance of underscore[ _ ] identifiers for class
members make it behave like access specifier.
• _name means, not allowed to import[ like friendly/ default member in
Java]
• __ name means, system name
• __ name means,private member

Python keywords
Keywords are the words whose meaning are alread known to the
compiler and also called as reserved words.

Python has total 35 keywords.

break continue False class await

elif else del def None

from for finally True except

and global if in import

lambda nonlocal is not as

raise return or assert pass

while with yield try async

Python Variables:
Variables are the reserved memory locations to store a runtime value
that has an identifier (name). It means when we create a variable, it
reserves a memory location. In previous programming languages, we
also said that variable is the type of memory block that allows changing
its value during runtime.
Based on the data type of a variable, the interpreter allocates memory
and decides what can be stored in variable's memory. Therefore, by
assigning different data types to variables, we can store integers,
decimals or characters in variable's memory.

The best part of Python variable is, It do not need explicit declaration of
variables. The declaration and creation happens automatically when we
assign a value to variable. i.e. the identifier that appears on left side of
assignment operator (=) creates memory location.

For example:
num = 45 # will make "integer" assignment to "num"

This will automatically create a memory location named "num" and


assigns 45 to it. Remember, Python don't have any explicit declaration
of variable. But based on the value we assign to variable, it
automatically assigns that datatype. In above statement, Python will
automatically make assign "integer" datatype to "num".

• avg= 50.25 # makes "float" assignment to "avg"


• website = "chromecoder" # makes "string type" assignment[=] to
"website"
• con=True # makes "boolean" assignment to "con

Python Comments:
Comments are very important while writing a program. It describes the
purpose and application of written code. So that anyone else, who is
updating or understanding the written code, does not have hard time to
figure it out. In Python we have two types of comments.
We know that comment is the section in Python code that will neither be
compiled nor executed. It is only for understanding and testing purpose.

Python provides two types of comments

1. Single-line comment
2. Multi-line comment

1. Single-line comment is the comment that comments a single line of


code and extends up to the newline character.We have hash (#) symbol
as single-line comment. Refer following examples.

Example 1:

# this is single line comment


print("Hello all")
Example 2:

# this is single line comment


# this will display hello all
print("Hello all")
Example 3:

print("Hello all") #this will display Hello all


Example 4:

if n %2 ==0:
# means, if number is divisible by 2
print("This number is even")

2. Multi-line comments are the comments that extend up to multiple


lines. Obviously we can keep using # for multiple continue lines. Refer
following examples.

Example 1:

# this can also be done


# to make a multiline
# comment section
print("Hello all")
But Python typically offers multiple line commenting facilities using
triple quotes using single (''') or double (""").For example, above multi-
line comment section can be written as :

Example 2:

'''this can also be done


to make a multiline
comment section'''
print("Hello all")
OR

Python Indentation:
Most of the previous programming languages uses pair of curly braces {
} to define a logical block. But Python uses indentation.
A logical block of code (such as, body of a function, loop, class, etc.)
starts with indentation and ends with the first unindented line.

For ease of programming most of the programmers prefers single space


or tab. (PyCharm IDE uses a single Tab, by default). See following
example.

def test function():


f=1
for i in range(1,11):
if i % 3== 0:
continue
print(i)
print("out of for loop")
Python also allows writing the code in same line, instead of indenting.
See the following code.

if True:
print("Hello")
#can also be written as:
if True: print("Hello"); a=5
But the indenting style is more preferred and convenient. We
found many C++ and Java programmers giving additional spaces at the
beginning of any statement. But if you try do the same as java ,c++ in
Python, it will give you an error "Indetation-Error".

COTROL FLOW STATEMETS IN PYTHON

A program’s control flow is the order in which the program’s code


executes. The control flow of a python program is regulated by
Conditional statements, loops, and function calls. This section covers the
if statement and for and while loops; functions and covered later in this
chapter. Raising and handling exceptions also affects control flow.

Following are the types of Control Flow Statements.

1. If statement
2. If … else statement
3. If … elif …else statement
4. Nested if statement
5. Loop – For Loop, While Loop
If condition statement :

Syntax of if

if test_expression:

statement(s)

6. It to a statement in code-line to represent ( if ) condition in


the program

If … else statement :

Syntax of if … else

if test_expression:

Body of if

else:

Body of else

7. The if … else statement evaluates test expression and will


execute the body of if only when the test condition is True.
8. If the condition is False, the body of else is executed.
Indentation is used to separate the blocks.
If … elif … else statement :

Syntax of if … elif … else

if test_expression:

Body of if

elif test_expression:

Body of elif

else:

Body of else

9. The elif is short for else if. It allows us to check for multiple
expressions.
10. If the condition for if is False, it checks
the condition of the next elif block and so on.
11. If all the conditions are False, the body of
else is executed.
12. Only one block among the several
if...elif...else blocks is executed according to the condition.
13. The if block can have only one else block.
But it can have multiple elif blocks.

Nested if statement :
14. We can have a if...elif...else statement
inside another if...elif...else statement. This is called nesting in
computer programming.

15. Any number of these statements can be


nested inside one another. Indentation is the only way to
figure out the level of nesting. They can get confusing, so they
must be avoided unless necessary.

Nested if Example:

num = 5

if num >= 0:

if num == 0:

print("Zero")

else:

print("Positive number")

else:

print("Negative number")

Output:

Positive Number
LOOP :

Normally, statements are executed consecutively − The first statement in


a function is executed first, followed by the second, and so on. There
may be a circumstance when it is needed to execute a block of code
numerous numbers of times.

Programming languages produce different control structures that permit


more complex execution paths.

A loop statement permits us to execute a statement or group of


statements several times. The given diagram shows a loop statement –

There are two types of Loops that are-

1. For Loop
2. While Loop

For Loop :

The for loop in Python is used to iterate over a sequence (list, tuple,
string) or other

iterable objects. Iterating over a sequence is called traversal.

Syntax of for Loop


for var_name in iterable_object:

Body of for

Here, var is the variable that takes the value of the item inside the
sequence on each iteration.

Loop continues until we reach the last item in the sequence. The body
of for loop is

separated from the rest of the code using indentation

While Loop :

When a given condition is TRUE, it repeats a statement or group of


statements. It checks the condition before executing the loop body.

Syntax of while Loop


While test_expression:

Body of while

In python, the body of the while loop is determined through indentation.

DATA STRUCTURES IN PYTHON

Python has been used worldwide for different fields such as


making websites, artificial intelligence and much more. But to make all of this
possible, data plays a very important role which means that this data should be
stored efficiently and the access to it must be timely. So how do you achieve this?
We use something called Data Structures. With that being said, let us go through
the topics we will cover in Data Structures in Python.

Lists:
Lists are used to store data of different data types in a sequential manner. There are
addresses assigned to every element of the list, which is called as Index. The index
value starts from 0 and goes on until the last element called the positive index. There
is also negative indexing which starts from -1 enabling you to access elements from
the last to first. Let us now understand lists better with the help of an example
program.

Creating a list
To create a list, you use the square brackets and add elements into it accordingly. If
you do not pass any elements inside the square brackets, you get an empty list as the
output.
1 my_list = [] #create empty list

2 print(my_list)

3 my_list = [1, 2, 3, 'example', 3.132] #creating list with data

4 print(my_list)

Output:
[]
[1, 2, 3, ‘example’, 3.132]

Dictionary:

Dictionaries are used to store key-value pairs. To understand better, think of a phone
directory where hundreds and thousands of names and their corresponding numbers
have been added. Now the constant values here are Name and the Phone Numbers
which are called as the keys. And the various names and phone numbers are the
values that have been fed to the keys. If you access the values of the keys, you will
obtain all the names and phone numbers. So that is what a key-value pair is. And in
Python, this structure is stored using Dictionaries. Let us understand this better with
an example program.

Creating a Dictionary
Dictionaries can be created using the flower braces or using the dict() function. You
need to add the key-value pairs whenever you work with dictionaries.

1 my_dict = {} #empty dictionary

2 print(my_dict)

3 my_dict = {1: 'Python', 2: 'Java'} #dictionary with elements

4 print(my_dict)

Output:
{}
{1: ‘Python’, 2: ‘Java’}

TUPLES:
Tuples are the same as lists are with the exception that the data once entered into the
tuple cannot be changed no matter what. The only exception is when the data inside
the tuple is mutable, only then the tuple data can be changed. The example program
will help you understand better.

Creating a Tuple
You create a tuple using parenthesis or using the tuple() function.

1 my_tuple = (1, 2, 3) #create tuple

2 print(my_tuple)

Output:
(1, 2, 3)

Sets:
Sets are a collection of unordered elements that are unique. Meaning that even if the
data is repeated more than one time, it would be entered into the set only once. It
resembles the sets that you have learnt in arithmetic. The operations also are the
same as is with the arithmetic sets. An example program would help you understand
better.

Creating a set
Sets are created using the flower braces but instead of adding key-value pairs, you
just pass values to it.

1 my_set = {1, 2, 3, 4, 5, 5, 5} #create set

2 print(my_set)

Output:
{1, 2, 3, 4, 5}

FUNCTIONS IN PYTHON

In Python, a function is a group of related statements that performs a specific task.

Functions help break our program into smaller and modular chunks. As our
program grows larger and larger, functions make it more organized and
manageable.

Furthermore, it avoids repetition and makes the code reusable.

Syntax of Function

def function_name(parameters):

"""docstring"""

statement(s)
Above shown is a function definition that consists of the following components.

1. Keyword def that marks the start of the function header.


2. A function name to uniquely identify the function. Function naming follows the
same rules of writing identifiers in Python.
3. Parameters (arguments) through which we pass values to a function. They are
optional.

4. A colon (:) to mark the end of the function header.

5. Optional documentation string (docstring) to describe what the function does.

6. One or more valid python statements that make up the function body. Statements
must have the same indentation level (usually 4 spaces).

7. An optional return statement to return a value from the function.


Example of a function

def greet(name):
"""
This function greets to
the person passed in as
a parameter
"""
print("Hello, " + name + ". Good morning!")

FILE HANDLING AND EXCEPTION HANDLING

File Handling :
Opening a file in Python:
Python has a built-in open() function to open a file. This function returns a file
object, also called a handle, as it is used to read or modify the file accordingly.

Python has a built-in open() function to open a file. This function returns a file
object, also

called a handle, as it is used to read or modify the file accordingly.

>>> f = open("test.txt") # open file in current directory

>>> f = open("C:/Python38/README.txt") # specifying full path

We can specify the mode while opening a file. In mode, we specify whether we
want to

read r, write w or append a to the file. We can also specify if we want to open the
file in text mode or binary mode.

>>> f = open ("test.txt", ‘r’)

The default is reading in text mode. In this mode, we get strings when reading from
the

file.

On the other hand, binary mode returns bytes and this is the mode to be used when

dealing with non-text files like images or executable files.


There are four different methods (modes) for opening a file:

• "r" - Read - Default value. Opens a file for reading, error if the file does not exist.

• "a" - Append - Opens a file for appending, creates the file if it does not exist.

• "w" - Write - Opens a file for writing, creates the file if it does not exist.

• "x" - Create - Creates the specified file, returns an error if the file exists.

In addition you can specify if the file should be handled as binary or text mode

• "t" - Text - Default value. Text mode.

• "b" - Binary - Binary mode (e.g. images).

Exception Handling :
Python logical errors (Exceptions)

Errors that occur at runtime (after passing the syntax test) are called exceptions or
logical errors.
For instance, they occur when we try to open a file(for reading) that does not exist
(FileNotFoundError), try to divide a number by zero (ZeroDivisionError), or try to
import a module that does not exist (ImportError).

Whenever these types of runtime errors occur, Python creates an exception object.
If not handled properly, it prints a traceback to that error along with some details
about why that error occurred.

Let's look at how Python treats these errors:

>>> 1 / 0

Traceback (most recent call last):

File "<string>", line 301, in runcode

File "<interactive input>", line 1, in <module>

ZeroDivisionError: division by zero

>>> open("imaginary.txt")

Traceback (most recent call last):

File "<string>", line 301, in runcode

File "<interactive input>", line 1, in <module>

FileNotFoundError: [Errno 2] No such file or directory: 'imaginary.txt'

OBJECT ORIENTED PROGRAMMING IN PYTHON


Introduction to OOPs :

Python is a multi-paradigm programming language. Meaning, it supports


different programming approach.

One of the popular approach to solve a programming problem is by


creating objects. This is known as Object-Oriented Programming (OOP).

In python, the concept of OOP follows some basic principles

1.Inheritance:
Inheritance is the capability of one class to derive or inherit the
properties from another class. The benefits of inheritance are:
1. It represents real-world relationships well.
2. It provides reusability of a code. We don’t have to write the same
code again and again. Also, it allows us to add more features to a
class without modifying it.
3. It is transitive in nature, which means that if class B inherits from
another class A, then all the subclasses of B would automatically
inherit from class A.
`

2.Encapsulation:
Encapsulation is one of the fundamental concepts in object-oriented
programming (OOP). It describes the idea of wrapping data and the
methods that work on data within one unit. This puts restrictions on
accessing variables and methods directly and can prevent the accidental
modification of data. To prevent accidental change, an object’s variable
can only be changed by an object’s method. Those types of variables
are known as private variable.
A class is an example of encapsulation as it encapsulates all the data
that is member functions, variables, etc.

3. Polymorphism:
Polymorphism in python is used for a common function name
that can be used for different types. This concept is widely applied in
object-oriented based python programming. Like other programming
languages say Java, C+, polymorphism is also implemented in python
for different purpose commonly Duck Typing, Operator overloading
and Method overloading, and Method overriding. This polymorphism
process can be achieved in two main ways namely overloading and
overriding.

RAISE AND USER DEFINED EXCEPTIONS

Python throws errors and exceptions when there is a code gone wrong,
which may cause the program to stop abruptly. Python also provides an
exception handling method with the help of try-except. Some of the
standard exceptions which are most frequent include IndexError,
ImportError, IOError, ZeroDivisionError, TypeError, and
FileNotFoundError. A user can create his own error using the exception
class.

Creating User-defined Exception:

Programmers may name their own exceptions by creating a new


exception class. Exceptions need to be derived from the Exception
class, either directly or indirectly. Although not mandatory, most of the
exceptions are named as names that end in “Error” similar to the
naming of the standard exceptions in python. For example:

# A python program to create user-defined exception

# class MyError is derived from super class Exception

class MyError(Exception):

# Constructor or Initializer

def __init__(self, value):

self.value = value
# __str__ is to print() the value

def __str__(self):

return(repr(self.value))

try:

raise(MyError(3*2))

# Value of Exception is stored in error

except MyError as error:

print('A New Exception occured: ',error.value)

Output:
('A New Exception occured: ', 6)

Benefits of learning :
1. Improved Productivity.
2. Interpreted Language
3. Dynamically Type
4. Free and Open source.
5. Vast libraries support.
6. Short code texts.
7. Readable (Interpretable).
8. Easy to learn
IOT (Internet Of Things)
INTRODUCTION:

The Internet of things (IoT) describes physical objects (or groups of


such objects) that are embedded with sensors, processing
ability, software, and other technologies that connect and exchange data
with other devices and systems over the Internet or other
communications networks.[1][2][3][4]
The field has evolved due to the convergence of multiple technologies,
including ubiquitous computing, commodity sensors, increasingly
powerful embedded systems, and machine learning.[1] Traditional fields
of embedded systems, wireless sensor networks, control
systems, automation (including home and building automation),
independently and collectively enable the Internet of things. In the
consumer market, IoT technology is most synonymous with products
pertaining to the concept of the "smart home", including devices
and appliances (such as lighting fixtures, thermostats, home security
systems and cameras, and other home appliances) that support one or
more common ecosystems, and can be controlled via devices associated
with that ecosystem, such as smartphones and smart speakers. The IoT
can also be used in healthcare systems.[5]

Software used: Aurdino and Tinker card.

Hardware used: Microcontroller (Esp8266), Breadboard , IR Sensor,


Jumper Wires , LEDs, resistors , USB

SOFTWARE USED

Aurdino:
Arduino is an open-source hardware and software company, project,
and user community that designs and manufactures single-board
microcontrollers and microcontroller kits for building digital devices. Its
hardware products are licensed under a CC-BY-SA license, while
software is licensed under the GNU Lesser General Public
License (LGPL) or the GNU General Public License (GPL) permitting
the manufacture of Arduino boards and software distribution by anyone.
Arduino boards are available commercially from the official website or
through authorized distributors.
Arduino board designs use a variety of microprocessors and controllers.
The boards are equipped with sets of digital and
analog input/output (I/O) pins that may be interfaced to various
expansion boards ('shields') or breadboards (for prototyping) and other
circuits. The boards feature serial communications interfaces,
including Universal Serial Bus (USB) on some models, which are also
used for loading programs. The microcontrollers can be programmed
using the C and C++ programming languages, using a standard API
which is also known as the "Arduino language". In addition to using
traditional compiler toolchains, the Arduino project provides
an integrated development environment (IDE) and a command line tool
developed in Go.
The Arduino project began in 2005 as a tool for students at
the Interaction Design Institute Ivrea, Italy, aiming to provide a low-cost
and easy way for novices and professionals to create devices that interact
with their environment using sensors and actuators. Common examples
of such devices intended for beginner hobbyists include
simple robots, thermostats and motion detectors.

HARDWARE USED

NodeMCU:
.
The NodeMCU (Node MicroController Unit) is an open-source software
and hardware development environment built around an inexpensive
System-on-a-Chip (SoC) called the ESP8266. The ESP8266, designed
and manufactured by Espressif Systems, contains the crucial elements of
a computer: CPU, RAM, networking (WiFi), and even a modern
operating system and SDK. That makes it an excellent choice for
Internet of Things (IoT) projects of all kinds.

However, as a chip, the ESP8266 is also hard to access and use. You
must solder wires, with the appropriate analog voltage, to its pins for the
simplest tasks such as powering it on or sending a keystroke to the
“computer” on the chip. You also have to program it in low-level
machine instructions that can be interpreted by the chip hardware. This
level of integration is not a problem using the ESP8266 as an embedded
controller chip in mass-produced electronics. It is a huge burden for
hobbyists, hackers, or students who want to experiment with it in their
own IoT projects.

But, what about Arduino? The Arduino project created an open-source


hardware design and software SDK for their versatile IoT controller.
Similar to NodeMCU, the Arduino hardware is a microcontroller board
with a USB connector, LED lights, and standard data pins. It also
defines standard interfaces to interact with sensors or other boards. But
unlike NodeMCU, the Arduino board can have different types of CPU
chips (typically an ARM or Intel x86 chip) with memory chips, and a
variety of programming environments. There is an Arduino reference
design for the ESP8266 chip as well. However, the flexibility of Arduino
also means significant variations across different vendors. For example,
most Arduino boards do not have WiFi capabilities, and some even have
a serial data port instead of a USB port.
BREADBOARD:

A breadboard is a rectangular plastic board with a bunch of tiny


holes in it. These holes let you easily insert electronic components to
prototype (meaning to build and test an early version of) an electronic
circuit, like this one with a battery, switch, resistor, and an LED (light-
emitting diode)

IR SENSOR:
.An infrared sensor (IR sensor) is a radiation-sensitive optoelectronic
component with a spectral sensitivity in the infrared wavelength range
780 nm … 50 µm. IR sensors are now widely used in motion detectors,
which are used in building services to switch on lamps or in alarm
systems to detect unwelcome

JUMPER WIRES:

A jumper wire is a conducting wire used to transfer electrical


signals between two points in a circuit. The wires can either be used to
modify circuits or to diagnose problems within a circuit. Jumper wires
typically vary in color and size depending on what they are being used
for. In breadboards, jump wires are used to establish connections
between the central micro controller and other devices such as buttons
and sensors.

LED’S:
A light-emitting diode (LED) is
a semiconductor light source that emits light when current flows through
it. Electrons in the semiconductor recombine with electron holes,
releasing energy in the form of photons. The color of the light
(corresponding to the energy of the photons) is determined by the energy
required for electrons to cross the band gap of the semiconductor. White
light is obtained by using multiple semiconductors or a layer of light-
emitting phosphor on the semiconductor device.

RESISTORS:

Resistor is a passive two-terminal electrical component that


implements electrical resistance as a circuit element. In electronic
circuits, resistors are used to reduce current flow, adjust signal levels,
to divide voltages, bias active elements, and terminate transmission
lines, among other uses. High-power resistors that can dissipate
many watts of electrical power as heat, may be used as part of motor
controls, in power distribution systems, or as test loads for generators.
Fixed resistors have resistances that only change slightly with
temperature, time or operating voltage. Variable resistors can be used to
adjust circuit elements (such as a volume control or a lamp dimmer), or
as sensing devices for heat, light, humidity, force, or chemical activity.
Resistors are common elements of electrical networks and electronic
circuits and are ubiquitous in electronic equipment. Practical resistors as
discrete components can be composed of various compounds and forms.
Resistors are also implemented within integrated circuits.

USB:

Universal Serial Bus (USB) is an industry standard that establishes


specifications for cables, connectors and protocols for connection,
communication and power supply (interfacing) between
computers, peripherals and other computers. A broad variety of USB
hardware exists, including fourteen different connectors, of which USB-
C is the most recent.
The USB standard is maintained by the USB Implementers
Forum (USB-IF). There have been four generations of USB
specifications: USB 1.x, USB 2.0, USB 3.x, and USB4.[4]

PROJECTS

1.Blinking LED on Node MCU:


In this part,we will learn how to use the Arduino IDE to blink the on-
board LED,the blue led in the board was used to signal the execution of
a particular procedure.

First,connect the NodeMCU to the PC,put below code to the Arduino


IDE:

Source code:
After burning the Code in NodeMCU you’ll see a small LED on
NodeMCU will start blinking. The Blinking speed can be controlled by
reducing the delay value in the code and reuploading it into NodeMCU

2.Alternative blinking on Node MCU:

In this the three different led’s will glow simultaneously uding


Node MCU.
SOURCE CODE:
3. Alarm using IR sensor:

This project detects motion or obstacle and acts accordingly I.e., beeps
or can customize according to our will .the Components required for this
project are IR sensor .buzzer, wires and NODEMCU ESP8266. the
required code is given below.
SOURCE CODE:
END OF REPORT
____________________________________________________

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy