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

Subject: Microcontroller Applications

Subject Code: 21EE1405

MCQs (English and Gujarati)


Q.1 The 8051 is ____ bit Microcontroller
(a) 16, (b) 4, (c) 8, (d) 32
ANSWER: (c) 8

Q.1 8051 એ ____ બીટ(bit) માઇક્રોકન્ટ્રોલર છે


(a) 16, (b) 4, (c) 8, (d) 32
જવાબ: (c) 8

Q.2 The 8051 microcontrollers is consisting of a ___ bit data bus.


(a) 8 (b) 16 (c) 32 (d) 64
ANSWER: (a) 8

Q.2 8051 માઇક્રોકન્ટ્રોલરોમાં ___ બીટ ડેટા બસનો સમાવેશ થાય છે .


(a) 8 (b) 16 (c) 32 (d) 64
જવાબ: (a) 8

Q.3 The 8051 contains total ____ interrupts.


(a) 1 (b) 4 (c) 5 (d) 10.
ANSWER: (c) 5

Q.3 8051માં total ____ વિક્ષેપો (interrupts) છે .


(a) 1 (b) 4 (c) 5 (d) 10.
જવાબ: (c) 5

Q.4 In 8051 Microcontroller, the Program Counter (PC) and Data pointer (DPTR) is ____ Register.
(a) 8-bit (b) 4-bit (c) 32-bit (d) 16-bit
ANSWER: (d) 16-bit

Q.4 8051 માઇક્રોકન્ટ્રોલરમાં, પ્રોગ્રામ કાઉન્ટર (PC) અને ડેટા પોઇન્ટર (DPTR) એ ____ રજીસ્ટર છે .
(b) 8-bit (b) 4-bit (c) 32-bit (d) 16-bit
જવાબ: (d) 16-bit

Q.5 What is the function of MUL AB instruction?


(a) Multiply A*B, (b) Addition A+B, (c) Division A/B, (d) none of these.
ANSWER: (a) Multiply A*B

Q.5 MUL AB ઇન્સ્ટ્રક્શનનુ ં કાર્ય શું છે ?


(a) Multiply A*B, (b) Addition A+B, (c) Division A/B, (d) આમાંથી એક પણ નહિ.
જવાબ: (a) Multiply A*B
Q.6 What does CPL A instruction mean?
(a) Complement Accumulator, (b) Compare Accurately, (c) Compare with Register B, (d) none of these.
ANSWER: (a) Complement Accumulator

Q.6 CPL A ઇન્સ્ટ્રક્શનનો અર્થ શું થાય છે ?


(a) Complement Accumulator, (b) Compare Accurately,
(c) Compare with Register B, (d) આમાંથી એક પણ નહિ.
જવાબ: (a) Complement Accumulator

Q.7 DAC0808 is a ____ bit D-to-A converter.


(a) 8, (b) 4, (c) 16, (d) none of these.
ANSWER: (a) 8

Q.7 DAC0808 એ ____ બીટ ડી-ટુ-એ કન્વર્ટર છે .


(a) 8, (b) 4, (c) 16, (d) આમાંથી એક પણ નહિ.
જવાબ: (a) 8

Q.8 The RPM rating given for the DC Motor is for ___________.
(a) Semi-Load, (b) Full Load, (c) No-Load, (d) none of these.
ANSWER: (c) No-Load

Q.8 DC મોટર માટે આપવામાં આવેલ RPM રે ટિંગ ___________ માટે છે .


(a) Semi-Load, (b) Full Load, (c) No-Load, (d) આમાંથી એક પણ નહિ.
જવાબ: (c) No-Load

Q.9 Without __________ Arduino cannot be run.


(a) Power Source, (b) Regulator, (c) Inverter, (d) none of these.
ANSWER: (a) Power Source

Q.9 __________ વિના Arduino ચલાવી શકાત ું નથી.


(a) પાવર સોર્સ , (b) રે ગ્યુલેટર, (c) ઇન્વર્ટર, (d) આમાંથી એક પણ નહિ.
જવાબ : (a) પાવર સોર્સ

Q.10 If the voltage is greater than _____, then the Arduino will destroy.
(a) 10, (b) 30, (c) 20, (d) none of these.
ANSWER: (c) 20

Q.10 જો વોલ્ટે જ _____ કરતા વધારે હોય, તો Arduino નષ્ટ થઇ જશે.


(a) 10, (b) 30, (c) 20, (d) આમાંથી એક પણ નહિ.
જવાબ : (c) 20
Subject: Microcontroller Applications
Subject Code: 21EE1405

MODULE-I: INTRODUCTION OF MICRO-CONTROLLERS


Q.001 Explain the block diagram of 8051 Microcontroller.

Answer. 001

Fig. 001 Block diagram of 8051 Microcontroller

CPU (Central Processing Unit): CPU acts as the mind of any processing machine. It
synchronizes and manages all processes that are carried out in a microcontroller. User has no
power to control the functioning of the CPU. It interprets the program stored in ROM and carries
out from storage and then performs its projected duty. CPU manage the different types of
registers available in 8051 microcontrollers.

Interrupts: Interrupts is a sub-routine call that is given by the microcontroller when some other
program with high priority is requested for acquiring the system buses then interrupts occur in
the current running program.

Interrupts provide a method to postpone or delay the current process, perform a sub-routine task
and then restart the standard program again.
Types of interrupt in 8051 Microcontroller:

Let's see the five sources of interrupts in 8051 Microcontroller:

● Timer 0 overflow interrupt - TF0

● Timer 1 overflow interrupt - TF1

● External hardware interrupt - INT0

● External hardware interrupt - INT1

● Serial communication interrupt - RI/TI

Memory: For operation Microcontroller required a program. This program guides the
microcontroller to perform the specific tasks. This program installed in the microcontroller
required some on chip memory for the storage of the program.

Microcontroller also required memory for storage of data and operands for a short duration. In
microcontroller 8051 there is code or program memory of 4 KB that is it has 4 KB ROM and it
also comprises data memory (RAM) of 128 bytes.

Bus : Bus is a group of wires which is used as a communication canal or acts as means of data
transfer. The different bus configuration includes 8, 16 or more cables. Therefore, a bus can bear
8 bits, 16 bits all together.

Types of buses in 8051 Microcontroller:

Let's see the two types of bus used in 8051 microcontroller:

● Address Bus: 8051 microcontrollers is consisting of a 16 bit address bus. It is generally


used for transferring the data from the Central Processing Unit to Memory.

● Data bus: 8051 microcontroller consists of 8 bits data bus. It is generally used for
transferring the data from one peripheral position to other peripherals.

Oscillator: As the microcontroller is a digital circuit therefore it needs a timer for their
operation. To perform timer operation inside a microcontroller it required an externally
connected or on-chip oscillator. Microcontroller is used inside an embedded system for
managing the function of devices. Therefore, 8051 uses the two 16 bit counters and timers. For
the operation of these timers and counters the oscillator is used inside the microcontroller.

Input/Output Port: As we are acquainted with that Microcontroller is employed in embedded


systems to manage the functions of devices. Thus, to gather it to other machinery, gadgets or
peripherals we need I/O (input/output) interfacing ports in the Microcontroller. For this function
Microcontroller 8051 consists of 4 input/output ports to unite it to other peripherals.
Timers/Counters: Microcontroller 8051 is incorporated with two (02) 16 bit counters & timers.
The counters are separated into 8-bit registers. The timers are utilized for measuring the
intervals, to find out width etc.

Q.002 Write down the common features of Microcontrollers.


Answer. 002
An 8051 microcontroller comes bundled with the following features −

● 4KB bytes on-chip program memory (ROM)


● 128 bytes on-chip data memory (RAM)
● Four register banks
● 128 user defined software flags
● 8-bit bidirectional data bus
● 16-bit unidirectional address bus
● 32 general purpose registers each of 8-bit
● 16 bit Timers (usually 2, but may have more or less)
● Three internal and two external Interrupts
● Four 8-bit ports,(short model have two 8-bit ports)
● 16-bit program counter and data pointer

Q.003 State the Applications of Microcontrollers.


Ans. 003

The Microcontrollers are used in small applications like toys to very high end applications like
robotics and image processing. The microcontrollers are available in 4-bit to 32-bit size and their use are
targeted as:
4-Bit Microcontrollers

(1) Used in large volumes with less cost.


(2) Typical application is in toy production with large volumes.

8-Bit Microcontrollers
(1) Most widely used.
(2) Used in many control and monitoring applications like temperature control, monitoring
some parameters in plant etc.
(3) Well suited for devices like modems, home appliances like VCRs, microwave ovens,
TVs, etc.
(4) Useful also for high-speed machine controls.

16-Bit Microcontrollers
(1) Used for high speed control applications involving faster calculations. e.g. controlling
motor speed.

32-Bit Microcontrollers
(1) High speed, high performance microcontrollers which can be used also at supervisory
level.
(2) Typical applications are robotics, highly intelligent instrumentation, image processing,
avionics, telecommunications, automobiles etc.
Q.004 State advantages of microcontroller compared to microprocessor.
Ans. 004
The inbuilt memory and I/O functions within the microcontroller provides following advantages
in designing microcontroller based systems (specifically dedicated systems) over the microprocessor
based system.

(1) Cost of the system is low as most components are integrated in a single chip.
(2) Product is small in size and highly reliable as the external interface is very small.
(3) System development life cycle is small as design requires very less time.
(4) System maintenance is easy.
(5) Security of software is high as stored in internal ROM.
(6) Possibility to connect external RAM/ROM as well as external I/O functions also satisfies the need
for large and complex systems.
Q.005 Compare Microprocessor (8085) and Microcontroller (8051).
Ans. 005

Microprocessor (8085) Microcontroller (8051)


(μP - 8085) (μC - 8051)

→The Microprocessors are used to design → The Microcontrollers are used generally
general purpose or sometimes dedicated for real time instrumentations and
systems by connecting it to external industrial applications and performs
hardware devices like RAM, ROM and dedicated Functions. So, they required less
Peripheral Devices. external hardware as μC has almost
everything in-built.

Pin Configuration: 8085 Pin Configuration: 8051

01. Total Pins : 40 01. Total Pins : 40


02. Address Lines : 16 02. Address Lines : 16
03. Data Lines : 08 03. Data Lines : 08
04. Interrupt Pins : 05 04. Interrupt Pins : 02
05. I/O Pins : 02 05. I/O Pins : 32

Architecture: 8085 Architecture: 8051

01. 8-bit Registers : 07 01. 8-bit Registers : 34


02. 16-bit Registers : 02/05 02. 16-bit Registers : 02
03. Stack Size : not fixed 03. Stack Size : 128
04. Internal ROM : 00 04. Internal ROM : 4KB
05. Internal RAM : 00 05. Internal RAM : 128 Byte
06. External Memory : 64 KB 06. External Memory : 128 KB
07. Flags : 05 07. Flags : 04
08. Timers : 00 08. Timers : 02
09. Parallel Ports : 00 09. Parallel Ports : 04
10. Serial Ports : 01 10. Serial Ports : 01

→ The μP instruction set has many → While the μC instructions are most of the
instructions performing external move time perform only internal move operation
operation. There are only few instructions to perform
external moves.

→The Microprocessors are not bit oriented → The Microcontrollers contain no. of bit
and hence they have no instructions or few oriented instructions which are useful to
instructions performing bit operations. perform operations like switching.

Bit operations are useful in performing control operations with a speed or in real time
manner which is primary requirement of industrial control applications.

→ The Microprocessors use multiple byte → While Microcontrollers use most


instructions which takes more time for instructions of single or double byte which are
execution. faster in execution.

As a result, Programmers need more effot and time to develop programs using the μC
instruction set. But this problem can be solved by using more software tools.
Module-2 8051 Hardware
Q.001 Explain Pin Function diagram of 8051 Microcontroller.
Ans. 001
Q.002 Write a short note: Architecture of the 8051 Microcontroller.
Ans. 002
Q.003 Explain the 8051 Flag register or Program Status Word (PSW).
Ans.003
Q.004 Differentiate between PC and DPTR in 8051 Microcontroller.
Ans.004
Q.005 What is SFRs? Give its list and functions. Also explain in brief: SP (Stack Pointer).
Ans.005
Q.006 Explain Internal RAM Organization in 8051 Microcontroller.
Ans.006
Q.007 Write a short note on 8051 I/O ports.
Ans.007
Q.008 Explain 8051 Timer/Counters.
Ans.008
MODULE-3: 8051 Programing

Q.001 Write an ALP (Assembly Language Program) based on Data Transfer Instruction.
(The data in the memory address d:40H is transferred to d:50H)
Answer.001

MOV R0, #40H ; Load R0 with 40H


MOV R1, #50H ; Load R1 with 50H
MOV R2, #05 ; Load R2 with 05 (For Loop counting purpose)
RPT: MOV A, @R0 ; copy the data pointer from R0 to Accumulator A
MOV @R1, A ; copy the data pointer from Accumulator A to R1
INC R0 ; Increment R0
INC R1 ; Increment R1
DJNZ R2, RPT ; Decrement and Jump if Not to Zero
END

Q.002 Write an ALP (Assembly Language Program) based on


(a) Multiply the Two Numbers 25H and 65H
(b) Division of Two Numbers 95 and 10.
Answer.002
(a) Multiplication (MUL AB)
MOV A, #25H ; Load 25H in register A (Accumulator)
MOV B, #65H ; Load 25H in register B
MUL AB ; 25H * 65H = E99H when B= 0EH and A=99H

(b) Division (DIV AB; Divide A by B)


MOV A, #95 ; Load 95 in register A (Accumulator)
MOV B, #10 ; Load 10 in register B
DIV AB ; Now A=09 (Quotient) , B=05 (remainder)
Q.003 Write an ALP (Assembly Language Program) based on Logical Operation
Instruction
(a) AND operation between 35H and 0FH
(b) OR operation between 04H and 30H.
(c) Complement Operation (NOT gate Operation) of 85H. (only 1’s Complement)
Also, Draw the Truth Table and write the basic solution for each operation respectively.
Answer.003
(a) AND operation between 35H and 0FH

Syntex: ANL destination, source ; destination=destination AND source

MOV A, #35H ; Load 35H in Register A


ANL A, #0FH ; A = A AND 0FH. (Now A=05H)

35H → 0011 0101


0FH → 0000 1111 35H AND 0FH = 05H
_________________
05H → 0000 0101
(b) OR operation between 04H and 30H.

Syntex: ORL destination, source ; destination=destination OR source

MOV A, #04H ; Load 04H in Register A


ORL A, #30H ; A = A AND 30H. (Now A=34H)

04H → 0000 0100


30H → 0011 0000 04H OR 30H = 34H
_________________
34H → 0011 0100
(c) Complement Operation (NOT gate Operation) of 85H. (only 1’s Complement)

MOV A, #85H ; Load 85H in Register A


CPL A ; Complement of Accumulator A (1’s Complement)

85H → 1000 0101


(1’s complement) → 0111 1010 7AH (1’s Complement)

Q.004 Write an ALP (Assembly Language Program) based on Looping, counting and indexing
Concept.
(a) Multiply 25 by 10 using the technique of repeated addition.
(b) Write a program to add the first 10 natural numbers.
Answer.004
(a) Multiply 25 by 10 using the technique of repeated addition.
E.g. 25 * 10 = 250 (FAH)
25 + 25 + 25 + 25 + 25 + 25 + 25 + 25 + 25 + 25 = 250

MOV A, #0 ; A=0, clear Accumulator


MOV R2, #10 ; the multiplier is placed in R2

AGAIN: ADD, #25H ; add the multiplicand to the accumulator


DJNZ R2, AGAIN ; repeat until R2=0 (10 times)
MOV R5, A ; save the result of Accumulator in R5 (R5=FAH)

(b) Write a program to add the first 10 natural numbers.

MOV A, #0 ; A=0, clear Accumulator


MOV R2, #10 ; Load counter value in R2
MOV R0, #0 ; Initialize R0 to zero.
AGAIN: INC R0 ; Increment R0 to hold the natural numbers
ADD A, R0 ; Add first number to Accumulator
DJNZ R2, AGAIN ; repeat until R2=0 (10 times)
MOV 46H, A ; Save the result (37H) in RAM location 46H.
Q.005 Write an ALP (Assembly Language Program) to read and test P1 to see whether it has
the values of 45H. If it does, send 99H to P2; otherwise, it stays cleared. (based on XOR
Logic).
Answer.005

MOV P2, #00 ; Clear P2


MOV P1, #00FH ; make P1 an input port
MOV R3, #45H ; R3 = 45H
MOV A, P1 ; read P1
XRL A, R3 ;
JNZ EXIT ; jump if A value other than zero.
EXIT…

******************************************************************************
MODULE-4: 8051 Interfacing
Q.001 Explain External Memory Interfacing with the 8051.
Ans.001
Q.002 Explain ADC0804 (Analog to Digital Converter) chip Interfacing with the 8051.
Ans.002

Fig.1 8051 connection to ADC0804 with Self-Clocking.

➔ The ADC0804 is an 8-bit parallel ADC. It works on +5 volts VCC and has a resolution of
8 bits.

➔ The conversion time varies depending on the clocking signals applied to the CLK IN pin,
but it cannot be faster than 110 Microseconds.

➔ The speed at which an analog input is converted to the digital output depends on the
speed of the CLK input. Also, the typical operating frequency is approximately 640 kHZ
at 5 volts.
Q.003 Explain Stepper Motor Interfacing with the 8051.
Answer.003

Stepper Motor Connection with 8051 using ULN2003

➔ Here we are going to interface 6 wires Unipolar Stepper Motor with an 8051 controller.
➔ Only four wires are required to control the stepper motor.
➔ Two common wires of the stepper motor are connected to the 5V supply.
➔ ULN2003 driver is used to driving the stepper motor.
➔ Note that to know the winding coil and their center tap leads measure resistance in
between leads. From center leads, we will get half the resistance value of that winding.
Q.004 Explain DC Motor Interfacing with the 8051.
Answer. 004

8051 DC Motor Connection using L293D Motor Driver

Let’s interface the DC motor with the AT89S52 microcontroller and control the DC motor speed
by using the Speed Increment Switch and Speed Decrement Switch connected to the
Microcontroller port and direction by using Direction Switch.
We are going to use the L293D motor driver IC to control the DC motor movement in both
directions. It has an in-built H-bridge motor drive.
➔ As shown in the above figure we have connected two toggle switches on the P1.0 and
P1.1 pin of the AT89S52 microcontroller to change the speed of the DC motor by 10%.
➔ One toggle switch at pin P1.2 controls the motor's rotating direction.
➔ P1.6 and P1.7 pins are used as output direction control pins. It provides control to motor1
input pins of the L293D motor driver which rotate the motor clockwise and anticlockwise
by changing their terminal polarity and Speed of the DC Motor is varied through PWM
Out pin P2.0.
➔ Here we are using the timer of AT89S52 to generate PWM.
Q.005 Explain LEDs Interfacing with the 8051.
Answer: 005
LEDs (Light Emitting Diodes) are components most commonly used for displaying pin digital state.
The 32 LEDs connected to the microcontroller ports P0, P1, P2 and P3. The extra port P4 is
connected with 6 extra LEDs which represent the SW2 (Switch Group).

LEDs are arranged in Five groups. Each groups expect LEDs belonging to port P4 consists of eight
LEDs that can be enabled or disabled using switches of the switch group SW2.

LEDs are enabled when the corresponding switch of the SW2 is on. When enabled, LEDs display the
state of the corresponding microcontroller pin. Otherwise, the LEDs are always off, no matter what
port state is, since no current can flow through them.

Note: LEDs are activated by logic zero (0), which means that if LED is ON, the appropriate
microcontroller pin’s voltage is low (0). If LED is OFF, the appropriate microcontroller pin’s
voltage is high (1).

Figure12 illustrates the connection between port P1 pins and the corresponding LEDs. A resistor is
serially connected to LEDs in order to limit current through them. In this case the resistor value is 1K.
Q.006 Explain 7 segment LED display Interfacing with the 8051.
Answer.006

The circuit diagram shown above is of an AT89S51 microcontroller based 0 to 9 counter


which has a 7 segment LED display interfaced to it in order to display the count.

This simple circuit illustrates two things. How to setup simple 0 to 9 up counter using
8051 and more importantly how to interface a seven segment LED display to 8051 in
order to display a particular result.

The common cathode seven segment display D1 is connected to the Port 1 of the
microcontroller (AT89S51) as shown in the circuit diagram. R3 to R10 are current
limiting resistors. S3 is the reset switch and R2,C3 forms a debouncing circuitry. C1, C2
and X1 are related to the clock circuit. The software part of the project has to do the
following tasks.

1. Form a 0 to 9 counter with a predetermined delay (around 1/2 second here).


2. Convert the current count into a digit drive pattern.
3. Put the current digit drive pattern into a port for displaying.
Q.007 Explain RS232 cable Interfacing with the 8051.
Answer.007
➔ The 8051 microcontroller has an internal serial port, which can be operated in four
modes.
➔ The baud rates for serial communication are programmable using internal Timer-1 of the
8051 controller. The 8051 controller can be used as a full duplex serial communication
device.
➔ A simple schematic for serial communication using 8051 is shown.

➔ The system requires a 8x5x microcontroller with internal program memory and RS232
level converter like MAX 232. A quartz crystal and a reset circuit should be connected to
the microcontroller.
➔ The program for serial communication can be stored permanently in internal ROM and so
there is no need for external memory. In case if 8031 controller is used then an external
EPROM has to be interfaced for program storage.
➔ The serial bus is formed by using only three lines TxD, RxD and Vss (Ground).
➔ The signals TxD and RxD will have TTL logic levels and they can be converted to
standard RS232 logic levels using bidirectional level converter MAX 232.
➔ The RS232 level serial port signal can be terminated on a standard 9-pin D-type
connector, so that any standard serial device can be connected to an 8051 controller for
serial communication.
➔ The parallel data transfer can be achieved through ports. The parallel input data is
received through port-2 and parallel output data is sent through port-1.
➔ The controller can receive parallel data from an ADC and convert it to serial and transmit
via serial port to another serial device. Also the controller can receive serial data from
another serial device via serial port and convert to parallel, and then output through
port-1 to a parallel device like DAC.
➔ The 8051 controller supports full duplex communication and so the transmission and
reception can be performed simultaneously.
Q.008 Explain Digital Thermometer (DS1820) Interfacing with the 8051.
Answer.008

➔ DS1820 digital thermometer is convenient for temperature measurement in the range of


-55°C to 125° C with +/- 5° accuracy.

➔ It must be properly placed in the 3-pin socket provided on the kit or development board,
with its rounded side oriented as marked on the board (as shown in the above Figure).

➔ Otherwise, the DS1820 could be permanently damaged. DS1820 data pin can be
connected to either P3.3 or P1.2 Selection is performed by Jumper J7.

************************************************************************
MODULE-5: Applications based on Arduino Programming

Q.001 Write a short note on Arduino.


Answer.001
→ 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.

→ You can tell your board what to do by sending a set of instructions to the
microcontroller on the board. To do so you use the Arduino programming
language (based on Wiring), and the Arduino Software (IDE), based on
Processing.

→ Over the years Arduino has been the brain of thousands of projects, from
everyday objects to complex scientific instruments.

Fig.1

→ A worldwide community of makers - students, hobbyists, artists, programmers,


and professionals - has gathered around this open-source platform, their
contributions have added up to an incredible amount of accessible knowledge
that can be of great help to novices and experts alike.

→ One thing that makes Arduino unique is that it provides not only boards but also
other electronics kits such as sensors, robotics arms, meters, etc. that makes it
very useful to assemble IoT(Internet of Things) devices quickly.
Q.2 Explain interfacing of Sensors and Actuators with Arduino.
Answer.002
In this chapter, we will learn about the 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. Some boards look a bit different from the one given below,
but most Arduinos have the majority of these components in common.

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,000,000 Hertz or
16 MHz.

Arduino Reset
You can reset your Arduino board, i.e., start your program 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
​ 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. The microcontrollers are usually of the ATMEL Company. You must
know what IC your board has before loading up a new program from the Arduino IDE.
This information is available on the top of the IC. For more details about the IC
construction and functions, you can refer to the data sheet.
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.
Actually, you are slaving the output device to the master of the SPI bus.

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. The speed of flashing depends
on the baud rate used by the board. RX flashes during the receiving process.

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.
Q.003 Explain in short the Programming Structure in Arduino.
Answer.003
In this chapter, we will study in depth, the Arduino program structure
and we will learn more new terminologies used in the Arduino world. The
Arduino software is open-source. The source code for the Java environment is
released under the GPL and the C/C++ microcontroller libraries are under
the LGPL.
Sketch − The first new terminology is the Arduino program called
“sketch”.
Arduino programs can be divided into three main parts:
01.Structure,
02.Values (variables and constants), and
03.Functions.
In this tutorial, we will learn about the Arduino software program, step
by step, and how we can write the program without any syntax or compilation
error.
Let us start with the Structure. Software structure consist of two main
functions −
​ (a) Setup( ) function
​ (b) Loop( ) function

Fig.2
Void setup ( ) {

}
PURPOSE − The setup() function is called when a sketch starts. Use it to
initialize the variables, pin modes, start using libraries, etc. The setup function will
only run once, after each power up or reset of the Arduino board.

INPUT − -
OUTPUT − -
RETURN − -
Void Loop ( ) {

}
PURPOSE − After creating a setup() function, which initializes and sets the
initial values, the loop() function does precisely what its name suggests, and loops
consecutively, allowing your program to change and respond. Use it to actively
control the Arduino board.

INPUT − -
OUTPUT − -
RETURN − -
Q.004 Explain the phenomenon of Signal Storage and its analysis using Arduino.
Answer.004
→ Extensible and open source hardware boards, such as Arduino, make it feasible to add
on the other hardware capabilities as you need to supplement the hardware resources.
→ One such extension that you could possibly do is to add a hardware module for storing
and processing data through either a micro-SD or a regular SD-Card.
→ The following snapshot shows a micro-SD module.

Fig.1 micro-SD Card module

VCC pin provides power to the module and should be connected to the Arduino’s 5V pin.

GND is a ground pin.

MISO (Master In Slave Out) is the SPI output from the microSD card module.

MOSI (Master Out Slave In) is the SPI input to the microSD card module.

SCK (Serial Clock) pin accepts clock pulses from the master (an Arduino in our case) to
synchronize data transmission.

SS (Slave Select) pin is a control pin that is used to select one (or a set) of slave
devices on the SPI bus.
→ The micro-SD module has power ground and SPI (Serial Peripheral Interface) pins. Serial
Peripheral Interface (SPI) is a synchronous serial data protocol used for communicating with
one or more peripheral devices. In SPI connection, there is usually one master device and one
or more slave devices.
→ This micro-SD module could be connected to an Arduino board for storing signal data and
processing data from the micro-SD card.

Fig.2 The micro-SD Card module interfacing with Arduino

Q.005 Write a program to Blink the LED for 1(one) second using Arduino.
Answer.005
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
*/
// the setup function runs once when you press reset or power the board

void setup() { // initialize digital pin 13 as an output.


pinMode(2, OUTPUT);
}

// the loop function runs over and over again forever

void loop() {
digitalWrite(2, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(2, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

*************************************************************************

You might also like