0% found this document useful (0 votes)
69 views50 pages

IV Ansar Org

The document provides details about an industrial visit to Arun Systems company to learn about embedded programming, IoT, TinkerCAD, MATLAB and Simulink. The visit included learning how to use TinkerCAD to build 3D models and circuits, use MATLAB for simulations and solving problems, and Simulink to build models of logic gates. Students were able to simulate turning an LED on/off, adding variables, controlling an LED and servo motor, and connecting a DC motor. They also learned about the MATLAB interface, basic commands, and programming. The training aimed to teach modeling with TinkerCAD and solving problems using MATLAB and building models with Simulink.

Uploaded by

Abhin As
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views50 pages

IV Ansar Org

The document provides details about an industrial visit to Arun Systems company to learn about embedded programming, IoT, TinkerCAD, MATLAB and Simulink. The visit included learning how to use TinkerCAD to build 3D models and circuits, use MATLAB for simulations and solving problems, and Simulink to build models of logic gates. Students were able to simulate turning an LED on/off, adding variables, controlling an LED and servo motor, and connecting a DC motor. They also learned about the MATLAB interface, basic commands, and programming. The training aimed to teach modeling with TinkerCAD and solving problems using MATLAB and building models with Simulink.

Uploaded by

Abhin As
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

A INDUSTRIAL VISIT REPORT ON

EMBEDDED PROGRAMMING AND IOT


Submitted in partial fulfilment of the requirements for the award of

DIPLOMA IN ENGINEERING IN ELECTRONICS AND


COMMUNICATION ENGINEERING.

Submitted by: ANSAR S

Register No: 19201351

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

MGM POLYTECHNIC COLLEGE

MGM TECHNOLOGICAL CAMPUS, KILIMANOOR,


THIRUVANANTHAPURAM-695612
MGM POLYTECHNIC COLLEGE, TECHNOLOGICAL CAMPUS,
KILIMANOOR, THIRUVANANTHAPURAM-695612.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE
Certified that “THE INDUSTRIAL VISIT” entitled “EMBEDDED PROGRAMMING AND IOT” is a
bonafide work carried out in the fifth semester by “ANSAR S.” in partial fulfilment for the
award of Diploma in Engineering on “ELECTRONICS AND COMMUNICATION ENGINEERING”
from Board of Technical Education during the academic year 2020-2022, who carried out the
Industrial Visit work under our guidance.

Mr ANEESH A
(HOD AND CO-ORDINATOR)
LECTURER IN ECE
MGM POLYTECHNIC COLLEGE
MGM TECHNOLOGICAL CAMPUS
KILIMANOOR
ACKNOWLEDGEMENT

First of all, I am indebted to GOD ALMIGHTY for giving me an opportunity to


excel in my efforts to complete this Industrial Visit report on time.

I am extremely grateful to Mr Raju, Principal, MGM POLYTECHNIC COLLEGE,


Kilimanoor and Mr Aneesh.A, head Of Department, Department of Electronics
and Communication Engineering, for providing all the required resources for
the successful completion of my Industrial Visit.

My heart felt gratitude to my Industrial Visit Co-ordinator Mr Aneesh.A, HOD,


Electronics and Communication Engineering, for his valuable suggestions and
guidance in the preparation of the Industrial Visit Report.

I express my thanks to all staff members, Dept. of Electronics and


Communication Engineering and friends for all the help and Co-ordination
extended in bringing out this Industrial Visit successful in time.

I will be failing in duty if I do not acknowledge with grateful thanks to the


authors of the references and other literates referred to in this industrial Visit.

Last but not the least, I am very much thankful to my parents who guided me I
every step which I took.

ANSAR S
CONTENTS

TITLE

ACKNOWLEDGEMENT

INTRODUCTION

COMPANY PROFILE

1. TinkerCad
2. Simulations
a. Turn LED ON/OFF
b. Familiarisation of Variables
c. Controlling LED
d. Adding Text Output
e. Connecting Servo Motor
f. Connecting DC Motor
3. Matlab
a. Toolbox
b. Matlab system
c. Matlab Windows
d. Basic Commands
e. Matlab Programming
4. Simulink
a. Models of Logic Gates
5. MATLAB and Arduino
6. Internet of Things
7. Conclusion
Company Profile:

Arun Systems is a leading software Development company specialized in


Development of software solutions for many of your business needs which
includes, but not limited to, Assistive Technologies,CRM,Billing Solutions,
Automation. A pleasure to share our motto is hundred percent customer
satisfaction and reliability through efficient use of latest technologies. Arun
Systems offers creative and technologically advanced solutions for small to large
business concerns. We provide the best and most efficient solutions to our clients
all over the globe. We have a great team with highly talented and experienced
software Developers, Designers and SEO experts whom are always ready to take
any project as a challenge and dedicated themselves to offer the best result. It is
our commitment and business policy to produce satisfactory service at a
reasonable price to every client. We also provide quality training options for
Employees, students and faculties covering various streams such as
Engineering,Technology,Education to list a few.

Vision and Mission:


Vision:
Our Vision is to be a leading Solution provider in IT sector and progress in
our current position in market. We know that Customer’s growth is our growth,
so we commit our customers to help in achieving their business goals. We also
help in shaping future technocrats through quality Training programs. We want to
be known as the reliable, innovative and user friendly software service provider in
IT industry.
Mission:

Exceed client's expectations by going beyond software to provide best


development solutions that transform problems into solution, enabling them to
solve their problems through quality training and technical support.
INTRODUCTION

TINKERCAD:

Tinkercad is a free-of-charge, online 3D modeling program that runs in a web browser, known
for its simplicity and ease of use. Since it became available in 2011 it has become a popular
platform for creating models for 3D printing as well as an entry-level introduction
to constructive solid geometry. Tinkercad was founded as a company in 2011 in the European
Union by former Google engineer Kai Backman and his cofounder Mikko Mononen, with a goal
to make 3D modeling, especially the design of physical items, accessible to the general public,
and allow users to publish their designs under a Creative Commons license. In 2011, the
tinkercad.com website was launched as a web-based 3D modeling tool for WebGL-enabled
browsers, and in 2012 the company moved its headquarters to San Francisco. By 2012 over
100,000 3D designs had been published by users Tinkercad uses a simplified constructive solid
geometry method of constructing models. A design is made up of primitive shapes that are
either "solid" or "hole". Combining solids and holes together, new shapes can be created, which
in turn can be assigned the property of solid or hole. In addition to the standard library of
primitive shapes, a user can create custom shape generators using a built-in JavaScript editor.
Shapes can be imported in three formats: STL and OBJ for 3D, and 2-dimensional SVG shapes
for extruding into 3D shapes. Tinkercad exports models in STL or OBJ formats, ready for 3D
printing.
Tinkercad also includes a feature to export 3D models to Minecraft Java Edition,and also offers
the ability to design structures using Lego bricks.
MATLAB:

MATLAB (MATrix LABoratory) is matrix-based software package for computation in


engineering, Science and applied mathematics. It offers a powerful programming language,
excellent graphics, and a wide range of expert knowledge. A numerical analyst called Cleve
Moler wrote the first version of MATLAB in the 1970s. MATLAB is published by and a trademark
of The Math Works Inc. The focus in MATLAB is on computation, not mathematics.MATLAB is a
high-performance language for technical computing. It integrates computation, visualization,
and programming in an easy-to-use environment where problems and solutions are expressed
in familiar mathematical notation.

The training Focus on the introductory concepts of Tinkercad and Matlab.

At the end of the training the students will be able to build models using Tinkercad,simulate
problems and find solutions using matlab and build models using Simulink.
TinkerCAD
Tinkercad is a free and easy-to-use application for 3D design, electronics, and coding. Aim of the program is to learn how to
select, place and program components using Arduino. Few applications are:

No need to buy any physical components, sensors, Arduino boards or modules.


No destruction of any physical components if circuit is incorrect.

Steps for using TingerCAD:

1. Navigate to TinkerCAD.com > Click Sign In Icon

2. Select Circuits > Select Create New Circuit

2. Select Create new Circuit

1. Select Circuits

3. Change Name of Circuit to Electrical Circuit 1: Series Circuit

Select Default File name in the Top Left Corner

4. Adding Electrical Components. TinkerCAD is a Drag and Drop interface


5. Rename File > TinkerCAD Electrical 3: Arduino 1
Arduino: is an open-source hardware and software that allows users to wire a circuit using resistors, buttons, sensors,
etc. and write a program that can receive and transmit data to control the circuit.

Arduino has its own IDE Software where the user programs then downloads to the Arduino Board. TinkerCAD offers a
simulation, that allows the user to create a simulated Arduino board and its circuit and then the user can write a
program to receive and/or transmit data to control said circuit.

Arduino uses a C++ based programming language. Arduino Programming Syntax is very similar to C++, so things like
comparison (IF/THEN Statement), Mathematical Computations, Loops (FOR, DO, DO/WHILE), Ending of Line
Statements ( ; ), etc. are written the same. What differs is how to INPUT/OUTPUT data varies.
See Reference Document: Arduino Common Syntax on the class website for common coding commands.

Objective: First Tutorial is designed to simply wire a single LED and then Program its use.

1. Electrical Component Toolbox > Find Arduino Uno > Drag and Drop Arduino Uno onto screen

Power Cord to Scroll Down in


Computer. Power Cord the Basic
will take the place of a Category
battery. When
simulation runs then the
power cord will plug into
the Arduino board
automatically.

2. Arduino Board Overview

Digital I/O Pins 0-13: Operate in an On/OFF State. Meaning what is being controlled in these ports is either On or
OFF. Example would be a push button: it is either pressed or it is not, there is no in-between state.

Analog In Pins 0-5: Operate within a range of values, which allows the user to bring in data that is constantly
changing. Example: Thermocouple (Thermometer) is constantly sensing temperature and has a range of values
that it falls into.
3. Wire the following Circuit (Change Electrical Component Ratings and Wire Color as shown)

a. Start Digital Pin 7: The digital pins act as a switch to turn on/off the flow of electricity to the circuit. On the
Arduino Board is a 5V and 3.3V Port that can be used to apply direct electricity to a circuit without
b. Drag Wire to + Row on Breadboard
c. Place Resistor = 220 Ω starting from + row on breadboard to adjacent row

Notice: The end of the Resistor is not touching the Red Wire from Arduino. Once a wire is in either the + or –
row the whole row is charged with electricity

d. Place LED with the pins in different columns. NOTE: Anode (Bent Wire) should be on the Resistor Side and
the Cathode (Straight Wire) should be leading towards the – on the board.

Notice: The end of the Resistor is not touching the end of the LED. Once a wire is placed in the column a-e or
f-j the whole column (vertically) is charged with electricity

e. Drag a wire from Cathode side of the LED to the – Row on breadboard
f. Drag a wire from – row on breadboard to GND (Ground) on the Arduino (NOTE: the Arduino Board has 3
GND (Ground Ports). It does not matter which of these ports the user places the wire.
4. Select the Code Button on the Top Right Hand Side of the Screen > Select Drop Down Menu (Defaults at Blocks) >
Change to Text > Pop-Up Message will appear > Press Continue

TinkerCAD allows the user to program in 1 of 2 ways


a. Block: Which is designed with blocks of prebuilt code and link together like puzzle pieces. Similar to
Scratch or Snap. Block is an easier form of programming and is a good place to start, but there is less
flexibility when doing complex computations, controlling of multiple motors/sensors, etc.
b. Text: is C++ based programming language. The user will type the code to operate the circuit. Text offers
the user a wider range and flexibility of options when programming

5. Highlight all code and delete


6. Type the following code Libraries: Allows users advanced
functions like LCD, motors,
Game controllers, etc. without Choose the type of
have to program the base code Arduino that is being
Download: Saves the code to be for those components used. NOTE: we are using
downloaded onto an Arduino the Arduino Uno in class
Board for live testing.
Debugger: User can
check to see if the
code has any errors
in it.
7. Program: Blink
Objective:
1. Turn the LED ON/OFF
2. Using Variables in Arduino Code
3. Control the Number of Times the LED is turned ON/OFF
4. Output Text using the Serial Monitor

NOTE: whenever the users // before any text; the text that follows on that line becomes a comment, which the software will
not read it as a command and skip over it. To comment out large sections at a time use /* at the beginning and */ and the end,
this allows the user to comment large portions of code out at a time.

Objective 1: Turn LED ON/OFF


a. Type the following Code (NOTE: do not worry about the color coding. Original code is programmed in the
Arduino IDE, which color codes commands. TinkerCAD only codes some of the commands.) > Select
Debug to see if there are any errors > Correct errors as needed

b. Running the Code. Press Start Simulation > Notice the following
i. Power cord plugs into the Arduino providing electricity to the board
ii. LED turns on for 1000ms or 1s then turns off.
iii. Simulation continues to run until user presses Stop Simulation. Theoretically the program is
continue to run because the void loop() is unbreakable, but since there is nothing located in this
function nothing appears to be happening.
c. Adjust the code as shown below

d. Running the Code. Press Start Simulation > Notice the following
i. Power cord plugs into the Arduino providing electricity to the board
ii. LED turns ON for 1000ms or 1s
iii. LED turns OFF for 2000ms or 2s
iv. Then void loop() repeats itself

Objective 2: Variables in Arduino Code


In Arduino Code the same variable types are used as C++

- int = integer
- double or float = real number
- char = character
- string = 286 consecutive characters
- among others

One issue we may run into when programming and wiring circuits if we need to move wires for different pins, then in our code
we would have to change the pin numbers more than likely missing one. So, what we will do is use a variable name to act as
our pin.

There is three four places where variable can be declared

1. before void setup(): this allows the variable to be used throughout the program (void setup(), void loop(), any other
functions that maybe used
2. in the void setup(): this allows the variable only to be used within the void setup() function
3. above void loop(): this allows the variable to be used by any functions after the declaration
4. in the void loop(): this allows the variable only to be used within he void loop()

Depending on what you want the variable to do will depend on where it is declared; I prefer to option 1 so I only need to look
in one location. Mind you it depends on the program the more complex the program is the more likely variable declartions
will be placed throughout the program.
1. Adjust the code as follows.
Since the pin we are using is the number 7 and the number 7 is an integer we will declare a variable called redled (my
led is the color red) as a integer and assign the value of 7 to it > then adjust our code to where ever the number 7
appears to redled

a. Run the simulation > Notice the program runs the same as previous

Objective 3: Control the Number of Times the LED is turned ON/OFF

Now the code will be adjusted to turn the LED ON/OFF a number of times then give the illusion that the program has ended

1. Add the following code


2. Run the Simulation
a. Notice the code runs and the LED is always flashing. The reason for this is the FOR loop is running 3 times
turning the LED ON/OFF then resets itself after it falls out of the loop the 3rd time. So, we still have an infinite
loop.
b. Test to show the FOR loop ends, but the void loop () does not.

Add a delay statement after the FOR Loop of 3000 ms (3s) > Notice know that the light flashes fast then there
is a long delay to reset itself.

Now we will trap the user within a loop that does not do anything to give them the illusion that the program
has ended by using a while loop.

c. Modify the code as follows


d. Run the Simulation > Notice
i. Light Flashes ON/OFF 3 times checking each time with the IF/THEN if counter equals 4
ii. Once counter equals 4 the light turns off

Objective 4: Adding Text Output


Adding text to a program to output/input information Arduino uses the Serial Monitor. The Serial Monitor is located on the
Bottom Left of the Programming Screen

Serial Monitor

This is where Arduino programming varies from C++ programming when dealing with Input/Output.

1. Connecting to the Serial Monitor and outputting to the Serial Monitor


a. In void setup() place the following line of code
serial.Begin (9600); This code sets the baud rate in which information is sent between the PC and
the Arduino board. 9600 is the goldilocks number to transfer English data charaters.
b. In void loop() place the following code
Two Options to print items to the Serial Monitor
Option 1: Serial.print (“TYPE INFO TO OUTPUTTED); or Serial.print (Place Variable Name); Both options will
keep the cursor on the same line when outputting

Insert Output Line


Here

Text stays on same line

Option 2: Serial.println (“TYPE INFO TO OUTPUTTED); or Serial.println (Place Variable Name); Both options will
drop the cursor down to the next line

Insert Output Line


Here

Text stays on drops to the next line

NOTE: There is not a way in Arduino to mix User Text (“HELLO WORLD “) with variables. Each has to be on its own Serial.print
or Serial.println line

NOTE: TinkerCAD Serial Monitor does not clear the previous run. Refresh the Browser and it will clear the last test run
Exercise Solved
Connecting Servo motor:

#include <Servo.h>

int sensorValue = 0;

int outputValue = 0;

Servo servo_6;

void setup()
{

pinMode(A0, INPUT);

servo_6.attach(6, 500, 2500);

void loop()

sensorValue = analogRead(A0);

outputValue = map(sensorValue, 0, 1023, 0, 180);

servo_6.write(outputValue);

delay(10); // Delay a little bit to improve simulation performance

Connecting DC motor:
int button = 0;

void setup()

pinMode(13, INPUT);

pinMode(6, OUTPUT);

pinMode(3, OUTPUT);

void loop()

button = digitalRead(13);

if (button == 0) {

digitalWrite(6, LOW);

digitalWrite(3, LOW);

} else {

digitalWrite(6, HIGH);

digitalWrite(3, HIGH);
}

delay(10); // Delay a little bit to improve simulation performance

}
MATLAB & SIMULINK
MATLAB :
MATLAB (MATrix LABoratory) is matrix-based software package for computation in
engineering, Science and applied mathematics. It offers a powerful programming language,
excellent graphics, and a wide range of expert knowledge. A numerical analyst called Cleve
Moler wrote the first version of MATLAB in the 1970s. MATLAB is published by and a
trademark of The Math Works Inc. The focus in MATLAB is on computation, not
mathematics.MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where
problems and solutions are expressed in familiar mathematical notation. Typical uses
include
 Math and computation
 Algorithm development
 Data
acquisition
 Modeling, simulation, and prototyping
 Data analysis, exploration, and visualization
 Scientific and engineering graphics
 Application development, including graphical user interface building.

MATLAB is an interactive system whose basic data element is an array that does not
require dimensioning. This allows you to solve many technical computing problems,
especially those with matrix and vector formulations, in a fraction of the time it would take
to write a program in a scalar no interactive language such as C or FORTRAN. It provides s
an interactive environment with hundreds of built in functions for technical computation
and graphics.
1. TOOLBOXES

MATLAB features a family of add-on application-specific solutions called toolboxes.


Very important to most users of MATLAB, toolboxes allow you to learn and apply
specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-
files) that extend the MATLAB environment to solve particular classes of problems. Areas in
which toolboxes are available include signal processing, control systems, neural networks,
fuzzy logic, wavelets, simulation, and many others.

2. MATLAB SYSTEM

The MATLAB system consists of five main parts:

2.1 Development Environment. This is the set of tools and facilities that help you use
MATLAB functions and files. Many of these tools are graphical user interfaces. It includes
the MATLAB desktop and Command Window, a command history, an editor and debugger,
and browsers for viewing help, the workspace, files, and the search path.

2.2 The MATLAB Mathematical Function Library. This is a vast collection of computational
algorithms ranging from elementary functions, like sum, sine, cosine, and complex
arithmetic, to more sophisticated functions like matrix inverse, matrix eigen values, Bessel
functions, and fast Fourier transforms.

2.3 The MATLAB Language. This is a high-level matrix/array language with control flow
statements, functions, data structures, input/output, and object-oriented programming
features. It allows both “programming in the small” to rapidly create quick and dirty throw-
away programs, and “programming in the large” to create large and complex application
programs.

2.4 Graphics. MATLAB has extensive facilities for displaying vectors and matrices as graphs,
as well as annotating and printing these graphs. It includes high-level functions for two-
dimensional and three-dimensional data visualization, image processing, animation, and
presentation graphics. It also includes low-level functions that allow you to fully customize
the appearance of graphics as well as to build complete graphical user interfaces on your
MATLAB applications.
2.5 The MATLAB Application Program Interface (API). This is a library that allows you to
write C and FORTRAN programs that interact with MATLAB. It includes facilities for calling
routines
from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading
and writing MAT-files.

3. MATLAB WINDOWS

3.1 Command window


The command window is the MATLAB’s main window and opens when the MATLAB is
started. It is convenient to have the command window as the only visible window and this
can be done by either closing all the windows or by choosing the COMMAND WINDOW in
the VIEW menu in the toolbar
Fig 1.1 Command Window

3.2 Figure window


The figure window opens automatically when graphic commands are executed and contains
graphs created by these commands

Fig 1.2 Figure window


3.3 Editor window
The editor window is used for writing and editing programs. This window is opened from
the FILE menu in the command window.
Fig 1.3 Editor Window

3.4 Help window


The help window contains help information. This window can be opened from the help
menu in the toolbar of any MATLAB window. The help window is interactive and can be
used to obtain information on any feature of MATLAB.

Fig 1.4 Help Window

3.5 Work space window

The workspace window provides information about the variables that are used.

3.6 Command history window

The command history window shows the command entered in the command window.
4. BASIC COMMANDS IN MATLAB

4.1 On-Line Help Commands


help Lists on which help is available
helpwin opens the interactive help window
help topic provide help on topic
lookfor string lists help topic containing string
demo runs the demo program

4.2 Workspace Information


who Lists the variable currently in the workspace
whos lists the variable currently in the workspace with their size
clear clear the workspace, all variables are removed
clear x y z clears only variables x, y and z
close all close all the graphic windows, which are open
clc clears command window
home same as clc
clf clear figure window

5. MATLAB PROGRAMMING
Functions and Operators in MATLAB

5.1 Mathematical Operators


+ addition
- subtraction
* matrix multiplication
^ power
‘ transpose
\ left division
5.1 Operators used for arrays

.* term by term multiplication


./ term by term left division
.^ term by term exponentiation
.\ term by term right division

5.3 Relational Operators


The relational operators in MATLAB are
< less than
> greater than
<= less than or equal
>= greater than or equal
== equal
~= not equal.

Note that “=" is used in an assignment statement while “= =" is used in a relation.

5.4 Logical Operators


& and
| or
~ not
xor exclusive or

5.5 Elementary math functions


abs absolute value or complex magnitude
angle phase angle
sqrt square root
real real part
imag imaginary part
conj complex conjugate
exp exponential base e

5.6 Commonly used programming functions


input prompt for user input
keyboard invoke keyboard as if it were a script _le
menu generate menu of choices for user input
pause waits for user response
function define function
eval execute string with MATLAB expression
feval evaluate function speci_ed by string
global define global variables
save saving a variable value
load loading a variable from the specified location.

SIMULINK:

Simulink is a graphical extension to MATLAB for modeling and simulation of systems.


In Simulink, systems are drawn on screen as block diagrams. Many elements of block
diagrams are available, such as transfer functions, summing junctions, etc., as well as virtual
input and output devices such as function generators and oscilloscopes. Simulink is
integrated with MATLAB and data can be easily transferred between the programs. In these
tutorials, we will apply Simulink to the examples from the M ATLAB tutorials to model the
systems, build controllers, and simulate the systems. Simulink is supported on Unix,
Macintosh, and Windows environments; and is included in the student version of M ATLAB
for personal computers. For more information on Simulink, contact the Math Works.
Simulink is started from the MATLAB command prompt by entering the following command:
Fig 1.5 Path to Simulink Library
Alternatively, you can hit the New Simulink Model button at the top of the MATLAB
command window as shown below

Fig 1.6 Alternative path to Simulink library

When it starts, Simulink brings up a window called Simulink Library Browser as shown below.
Fig 1.7 Simulink Library
A model of a system is created in another window called model window. A new model can
be created by selecting New from the File menu in any Simulink Library Browser window or
by hitting Ctrl + N.

There are two major classes of items in Simulink: blocks and lines. Blocks are used to
generate, modify, combine, output, and display signals. Lines are used to transfer signals
from one block to another. There are several general classes of blocks:
 Sources: Used to generate various signals
 Sinks: Used to output or display signals
 Discrete: Linear, discrete-time system elements (transfer functions, state-space
models, etc.)
 Linear: Linear, continuous-time system elements and connections (summing
junctions, gains, etc.)
 Nonlinear: Nonlinear operators (arbitrary functions, saturation, delay, etc.)
Connections: Multiplex, Demultiplex, System Macros, etc.
REALIZATION OF LOGIC GATES USING SIMULINK TOOL BOX
Digital systems are said to be constructed by using logic gates. These gates are the AND,
OR, NOT, NAND, NOR, EXOR and EXNOR gates. The basic operations are described below
with the aid of truth tables. AND gate OR gate

AND Gate:

OR Gate:

NOT Gate:

NOR Gate:

NAND Gate:
EX-OR Gate:

Simulink Block Diagram:


MATLAB and Arduino
Install Arduino Package in Matlab:
Step 1: In matlab click addon and select Get Add-on from drop down

Select MATLAB support package for Arduino Hardware and click install
 It will ask for login to mathworks
 Login with your mathworks account
 Then click install
Wait until all download and installation is completed
Click Setup Now
Click Next and Complete Installation

Connect the USB cable into the computer and click next
Select USB and Click Next
Select Board, Port and click program

Click Next
Click Test Connection. If Successful Click Next

Click Test Connection. If Successful Click Next


Final Screen – click Finish
Exercise: Control Servo Motors using MATLAB and Arduino
 Hardware setup

Step 1
 Create servo object and calibrate the motor
 clear a;
 a = arduino(‘COM3', 'Uno', 'Libraries', 'Servo');
Step 2: Create a Servo object
 s = servo(a, 'D4’)
 Check your servo motor's data sheet pulse width range values to calibrate the motor to
rotate in expected range.
 clear s;
 s = servo(a, 'D4', 'MinPulseDuration’, 1.5*10^-3, 'MaxPulseDuration’, 2*10^-3)
Step 3: Write and read Servo position

 for angle = 0:0.2:1


 writePosition(s, angle);
 current_pos = readPosition(s);
 current_pos = current_pos*180;
 fprintf('Current motor position is %d degrees\n', current_pos);
 pause(2);
 end
Step 4: Clean up
 clear s a

Final code
Internet of Things
IOT:

The Internet of Things, or IoT, refers to the billions of physical objects linked to the internet and
collecting and exchanging data throughout the world. It's now feasible to transform everything,
from a pill to a jet, into a component of the Internet of Things, thanks to the advent of super-
cheap computer chips and the widespread availability of wireless networks. Connecting all of
these diverse products and attaching sensors to them gives machines that would otherwise be
dumb a level of digital intelligence, allowing them to convey real-time data without engaging a
person. The Internet of Things is bringing the digital and physical worlds together to make the
world around us smarter and more responsive.

Devices and items with built-in sensors are connected to an Internet of Things platform, which
combines data from various devices and uses analytics to share the most useful information
with apps tailored to individual needs.

These sophisticated IoT solutions can detect precisely which data is important and which may
be safely disregarded. This data may be used to spot patterns, make recommendations, and
identify potential issues before they arise.

Installing Boards Manager:

Instructions
 Start Arduino and open Preferences window.

 Enter https://arduino.esp8266.com/stable/package_esp8266com_index.json into


Additional Board Manager URLs field. You can add multiple URLs, separating them with
commas.

 Open Boards Manager from Tools > Board menu and find esp8266 platform.

 Select the version you need from a drop-down box.

 Click install button.

 Don’t forget to select your ESP8266 board from Tools > Board menu after installation
The ESP8266 module enables microcontrollers to connect to 2.4 GHz Wi-Fi, using IEEE 802.11
bgn. It can be used with ESP-AT firmware to provide Wi-Fi connectivity to external host MCUs,
or it can be used as a self-sufficient MCU by running an RTOS-based SDK. The module has a full
TCP/IP stack and provides the ability for data processing, reads and controls of GPIOs.

ESP8266 Specifications
ESP8266 architecture

The ESP8266 uses a 32bit processor with 16 bit instructions. It is Harvard architecture which
mostly means that instruction memory and data memory are completely separate.

The ESP8266 has on die program Read-Only Memory (ROM) which includes some library code
and a first stage boot loader. All the rest of the code must be stored in external Serial flash
memory (provides only serial access to the data - rather than addressing individual bytes, the
user reads or writes large contiguous groups of bytes in the address space serially).

Depending on your ESP8266, the amount of available flash memory can vary.

As any other microcontroller, ESP8266 has a set of GPIO pins (General Purpose Input(Output
pins) that we can use to “control” external sensors.
Our ESP8266 has 17 GPIO pins but only 11 can be used (among 17 pins, 6 are used for
communication with the on-board flash memory chip). It also has an analog input (to convert a
voltage level into a digital value that can be stored and processed in the ESP8266).

It also has a WIFI communication to connect your ESP8266 to your WIFI network, connect to
the internet, host a web server, let your smartphone connect to it, etc.

Another advantage of an ESP8266 is that is can be programmed as any other microcontroller


and especially any Arduino.

Conclusion:

The training Was done on three popular simulating tools namely TinkeCAD,Matlab and
Simulink.Various Circuits were build,tested and verified using the software.The training started
with an introduction to various emerging and popular technologies like automation ,
Robotics,Internet of Things and so on.The job oppurtunities in these field was also discussed in
detail.

You might also like