lOMoARcPSD|64626821
Io T Manual - none
Business Intelligence Analyst (G H Raisoni College of Engineering)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Dharsh King ([Link]@[Link])
lOMoARcPSD|64626821
Internet of Things - Lab Manual
Experiment # 01
Aim: To study the architecture of Arduino microcontroller, Node MCU and Raspberry PI
controller.
Apparatus Requirement: Arduino microcontroller, Node MCU and Raspberry PI controller,
Arduino IDE software.
Theory:
Introduction to Arduino
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a
Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing
something online. There are many other microcontrollers and microcontroller platforms available
for physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard,
and many others offer similar functionality. All of these tools take the messy details of
microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies
the process of working with microcontrollers, but it offers some advantage for researchers over
other systems:
Inexpensive - Arduino boards are relatively inexpensive compared to other
microcontroller platforms.
Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX, and
Linux operating systems. Most microcontroller systems are limited to Windows.
Simple, clear programming environment - The Arduino Software (IDE) is easy-to-use for
beginners, yet flexible enough for advanced users to take advantage of as well.
Open source and extensible software - The Arduino software is published as open source
tools, available for extension by experienced programmers.
Open source and extensible hardware - The plans of the Arduino boards are published
under a Creative Commons license, so experienced circuit designers can make their own
version of the module, extending it and improving it.
Arduino UNO
There are many different components on the Arduino board. We will study the Arduino UNO board
because it is the most popular board in the Arduino board family. In addition, it is the best board to
get started with electronics and coding.
Sagar Singh Rathore, Assistant Professor (ETC) Page 1
Downloaded by Dharsh King ([Link]@[Link])
lOMoARcPSD|64626821
Internet of Things - Lab Manual
Power USB
Arduino board can be powered by using the USB cable from your computer. All you
need to do is connect the USB cable to the USB connection (1).
Power (Barrel Jack)
Arduino boards can be powered directly from the AC mains power supply by
connecting it to the Barrel Jack (2).
Voltage Regulator
The function of the voltage regulator is to control the voltage given to the Arduino
board and stabilize the DC voltages used by the processor and other elements.
Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. How does Arduino
calculate time? The answer is, by using the crystal oscillator. The number printed on
top of the Arduino crystal is 16.000H9H. It tells us that the frequency is 16 MHz.
Arduino Reset
You can reset your Arduino board, i.e., start your programs from the beginning. You
can reset the UNO board in two ways. First, by using the reset button (17) on the
board. Second, you can connect an external reset button to the Arduino pin labelled
RESET (5).
Pins (3.3, 5, GND, Vin)
3.3V (6) − Supply 3.3 output volt
5V (7) − Supply 5 output volt
Sagar Singh Rathore, Assistant Professor (ETC) Page 2
Downloaded by Dharsh King ([Link]@[Link])
lOMoARcPSD|64626821
Internet of Things - Lab Manual
Most of the components used with Arduino board works fine with 3.3 volt and
5 volt.
GND (8)(Ground) − There are several GND pins on the Arduino, any of
which can be used to ground your circuit.
Vin (9) − This pin also can be used to power the Arduino board from an
external power source, like AC mains power supply.
Analog pins
The Arduino UNO board has six analog input pins A0 through A5. These pins can
read the signal from an analog sensor like the humidity sensor or temperature sensor
and convert it into a digital value that can be read by the microprocessor.
Main microcontroller
Each Arduino board has its own microcontroller (11). You can assume it as the brain
of your board. The main IC (integrated circuit) on the Arduino is slightly different
from board to board.
ICSP pin
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino consisting
of MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred to as an SPI
(Serial Peripheral Interface), which could be considered as an "expansion" of the
output.
Power LED indicator
This LED should light up when you plug your Arduino into a power source to
indicate that your board is powered up correctly. If this light does not turn on, then
there is something wrong with the connection.
TX and RX LEDs
On your board, you will find two labels: TX (transmit) and RX (receive). They appear
in two places on the Arduino UNO board. First, at the digital pins 0 and 1, to indicate
the pins responsible for serial communication. Second, the TX and RX led (13). The
TX led flashes with different speed while sending the serial data.
Digital I/O
The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM
(Pulse Width Modulation) output. These pins can be configured to work as input
digital pins to read logic values (0 or 1) or as digital output pins to drive different
modules like LEDs, relays, etc. The pins labeled “~” can be used to generate PWM.
AREF
AREF stands for Analog Reference. It is sometimes, used to set an external reference
voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.
Sagar Singh Rathore, Assistant Professor (ETC) Page 3
Downloaded by Dharsh King ([Link]@[Link])
lOMoARcPSD|64626821
Internet of Things - Lab Manual
Node MCU: ESP8266
NodeMCU is an open source platform based on ESP8266 which can connect objects and let data
transfer using the Wi-Fi protocol. In addition, by providing some of the most important features of
microcontrollers such as GPIO, PWM, ADC, and etc.
The general features of this board are as follows:
Easy to use
Programmability with Arduino IDE or IUA languages
Available as an access point or station
practicable in Event-driven API applications
Having an internal antenna
Containing 13 GPIO pins, 10 PWM channels, I2C, SPI, ADC, UART, and 1-
Wire
ESP8266 NodeMcu Pinout
The ESP8266 NodeMcu has 16 GPIO pins and one analog input pin. However only 10 of these
GPIO pins can be used for digital input and output operations.
Pin Functions
Pin numbers in the Arduino IDE correspond directly to the ESP8266 GPIO pin
numbers. pinMode, digitalRead, and digitalWrite functions work as usual, so to read GPIO2,
call digitalRead(2) or its alias name digitalRead(D10).
At startup, pins are configured as INPUT. Digital pins 0—15 can be INPUT, OUTPUT,
or INPUT_PULLUP.
Pin 16 can be INPUT, OUTPUT or INPUT_PULLDOWN_16 and is connected to the build-in
LED. It can be addressed with digitalRead(D0), digitalRead(16) or digitalRead(LED_BUILDIN).
Pins may also serve other functions, like Serial, I2C, SPI. These functions are normally activated by
the corresponding library.
Reserved Pin
GPIO pins 6—11 are not shown on this diagram because they are used to connect flash memory
chip on most modules. Trying to use these pins as IOs will likely cause the program to crash.
Note that some boards and modules (ESP-12ED, NodeMCU 1.0) also break out pins 9 and 11.
These may be used as IO if flash chip works in DIO mode (as opposed to QIO, which is the default
one).
Vin, 3V3 ,GND
Vin is the NodeMcu's voltage input that is connected to its internal voltage regulator allowing an
input voltage range of 4.75V to10V. It will be regulated to 3.3V. Alternatively an external voltage
source of 3.3V can be directly connected to the NodeMcu's 3V3 pins. The 3V3 pin can be also a
voltage source to other components such as LEDs. GND is the common ground of the board.
Sagar Singh Rathore, Assistant Professor (ETC) Page 4
Downloaded by Dharsh King ([Link]@[Link])
lOMoARcPSD|64626821
Internet of Things - Lab Manual
Analog Input
ESP8266 has a single ADC channel available to users. It may be used either to read voltage at ADC
pin, or to read module supply voltage (VCC).
Analog Output
analogWrite(pin,value) enables software PWM on the given pin. PWM may be used on pins 0 to
16.
PWM frequency is 1 kHz by default. Call analogWriteFreq(new_frequency) to change the
frequency. The unit representation is in [Hz].
Sagar Singh Rathore, Assistant Professor (ETC) Page 5
Downloaded by Dharsh King ([Link]@[Link])
lOMoARcPSD|64626821
Internet of Things - Lab Manual
Raspberry Pi
Raspberry Pi 3 Board
Raspberry Pi is a small single board computer. By connecting peripherals like Keyboard, mouse,
display to the Raspberry Pi, it will act as a mini personal computer.
Raspberry Pi is popularly used for real time Image/Video Processing, IoT based applications and
Robotics applications.
Raspberry Pi is slower than laptop or desktop but is still a computer which can provide all the
expected features or abilities, at low power consumption.
OS for Raspberry Pi
Raspberry Pi Foundation officially provides Debian based Raspbian OS. Also, they provide
NOOBS OS for Raspberry Pi. We can install several Third-Party versions of OS like Ubuntu,
Archlinux, RISC OS, Windows 10 IOT Core, etc.
Raspbian OS is official Operating System available for free to use. This OS is efficiently optimized
to use with Raspberry Pi. Raspbian have GUI which includes tools for Browsing, Python
programming, office, games, etc.
We should use SD card (minimum 8 GB recommended) to store the OS (operating System).
Raspberry Pi is more than computer as it provides access to the on-chip hardware i.e. GPIOs for
developing an application. By accessing GPIO, we can connect devices like LED, motors, sensors,
etc and can control them too.
Sagar Singh Rathore, Assistant Professor (ETC) Page 6
Downloaded by Dharsh King ([Link]@[Link])
lOMoARcPSD|64626821
Internet of Things - Lab Manual
Raspberry Pi processor
It has ARM based Broadcom Processor SoC along with on-chip GPU (Graphics Processing Unit).
The CPU speed of Raspberry Pi varies from 700 MHz to 1.2 GHz. Also, it has on-board SDRAM
that ranges from 256 MB to 1 GB.
Raspberry Pi also provides on-chip SPI, I2C, I2S and UART modules.
There are different versions of raspberry pi available as listed below:
Raspberry Pi 1 Model A Raspberry Pi 1 Model A+
Raspberry Pi 1 Model B Raspberry Pi 1 Model B+
Raspberry Pi 2 Model B Raspberry Pi 3 Model B
Raspberry Pi Zero
Description of special pins
1. HDMI (High-Definition Multimedia Interface): It is used for transmitting uncompressed video
or digital audio data to the Computer Monitor, Digital TV, etc. Generally, this HDMI port helps
to connect Raspberry Pi to the Digital television.
2. CSI Camera Interface: CSI (Camera Serial Interface) interface provides a connection in
between Broadcom Processor and Pi camera. This interface provides electrical connections
between two devices.
3. DSI Display Interface: DSI (Display Serial Interface) Display Interface is used for connecting
LCD to the Raspberry Pi using 15-pin ribbon cable. DSI provides fast High-resolution display
interface specifically used for sending video data directly from GPU to the LCD display.
4. Composite Video and Audio Output: The composite Video and Audio output port carries video
along with audio signal to the Audio/Video systems.
5. Power LED: It is a RED colored LED which is used for Power indication. This LED will turn
ON when Power is connected to the Raspberry Pi. It is connected to 5V directly and will start
blinking whenever the supply voltage drops below 4.63V.
6. ACT PWR: ACT PWR is Green LED which shows the SD card activity.
Result: The architecture and pin configuration of Arduino microcontroller, Node MCU and
Raspberry PI controller are studied.
Sagar Singh Rathore, Assistant Professor (ETC) Page 7
Downloaded by Dharsh King ([Link]@[Link])