Internet of Things and its Applications
Building IoT Applications Question & Answer
Question : 1
Write short notes an the following: Resistor: Resistor, Breadboard, VIN, Servo Moto, DC motor
A resistor is a passive electrical component with the primary function to limit the flow of electric current.
A breadboard is a temporary circuit board for testing and prototyping circuits, no soldering is done on the board, this mean it is faster and easier to prototype circuits.
The input voltage to the Arduino / Genuino board when it is using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). We can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
A Servo Motor is a small device that has an output shaft. This shaft can be positioned to specific angular positions by sending the servo a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of the shaft. If the coded signal changes. Servos are extremely useful in robotics.
A DC motor (Direct Current motor) is the most common type of motor. DC motors normally have just two leads, one positive and one negative. If you connect these two leads directly to a battery, The motor will rotate. If you switch the leads, the motor will rotate in the opposite direction.
Question : 2
What is the use of setup() function?
The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup() function will only run once, after each powerup or reset of the Arduino board.
Question : 3
What is text editor? What is its file extension?
It is used for writing the required code. The sketch is written in the text editor and is then saved with the extension .ino.
Question : 4
What is Pulse Width Modulation?
Pulse Width modulation or PWM is a common technique used to vary the width of the pulses. PWM has many applications such as controlling servos and speed controllers, limiting the effective power of motors and LEDs.
Question : 5
What are Libraries?
Libraries are simply a collection of code that helps us to interface the hardware with any peripheral devices such as sensors, modules, shields, etc. easily. We can use built-in functions of the libraries to make a coding project much more comfortable.
Question : 6
What is the purpose of the /* and */ character pairs?
This sequence of characters marks the start and end of a multiline comment in a program.
Question : 7
Discuss the role of PWM pins in Arduino UNO.
PWM stands for Pulse Width Modulation technique, is used to convert the digital signal into an analog by varying the width of the Pulse. The PWM pins are used for giving the desired analog output. They are used to set the LED brightness or to run Stepper or Servo Motor or anything which require analog inputs.
Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of “on time” is called the pulse width. To get varying analog values, we change, or modulate, that pulse width. If we repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.
Question : 8
What is an Infrared sensor?
An Infrared sensor is an electronic device, that emits in order to sense some aspects of the surroundings. An IR sensor can measure the heat of an object as well detects the motion. These types of sensors measures only infrared radiation, rather than emitting it that is called as a passive IR sensor.
Question : 9
Can an IR sensor detect humans?
Yes, the Passive Infrared (PIR) sensor is used to detect the presence of human.
Question : 10
What is the use of break and continue?
Answer : The break and continue statements are often used within loops structures. A break statement sends program control to the statement that immediately follows the closing brace of loop body. The continue statement immediately sends program control to the test conditions of the loop.
Question : 11
What is bootloader?
Bootloader, is basically the initial piece of code which runs whenever any microcontroller is powered up or resets. It can be used to setup the microcontroller or provide limited ability to update the main program's code.
Question : 12
How setup() is different from loop()?
setup() is called once in the program when a sketch starts after power-up. It is used to initialize variables, input and output pin modes, and other libraries needed in the sketch.
loop() is used after setup() been called, function loop() is executed repeatedly in the main program. It controls the board until the board is powered off or is reset.
Question : 13
How many digital pins are there on the UNO board?
It has 14 digital pins input / output pins of which 6 can be used as PWM output.
Question : 14
What is the application area of LilyPad board?
LilyPad was creatively designed with large connecting pads and a flat back to allow them to be sewn into clothing with conductive thread.
Question : 15
What is difference between Verify / Compile and Upload?
Verify/Compile: It checks the errors present in your sketch and informs you about the memory space occupied by the variables in the console area.
Upload: It automatically compiles and loads the code (binary file) into the selected Arduino hardware through the configured Port.
Question : 16
What is outpane?
The bottom of the main screen is described as an Output Pane that mainly highlights the compilation status of the running code: the memory used by the code, and errors occurred in the program. We need to fix those errors before we intend to upload the hex file into our Arduino Module.
Question : 17
What is the role of Serial Monitor?
The Serial Monitor allows your computer to connect serially with the Arduino. this is important because it takes data that our Arduino is receiving from sensors and other devices and displays it in real-time on our computer.
Question : 18
What is serial plotter?
Arduino Serial Plotter is another component of the Arduino IDE, which allows us to generate a real-time graph of our serial data. The serial plotter makes it much easier for us to analyze our data through a visual display.
Question : 19
What is the use of modulo operator?
The remainder operator (or modulo operator) is used to find the remainder after the division of two numbers. The percentage sign (%) is used as the modulo operator.
Question : 20
What is the function of keyword void in function declaration?
Void may be used to declare functions that do not return a value. thus, functions with no return value will have a new type void.
Question : 21
Differentiate between local and global variables.
Answer : A local variable is one that defined within a function. The scope of a local variable is limited to the function in which it is defined. The life of local variable is limited to the function. Global variable is defined outside the function block. The scope of global variable is throughout the program. The life of global variable is throughout the program.
Question : 22
What do you mean by function prototyping? What are its advantages?
A function prototyping is a declaration of a function that tells the program about the type of the value returned by the function and the number and type of each argument. The advantage of function prototyping is that it enables a compiler to compare each use of function with the prototype to determine whether the function is invoked properly or not. The number and types of arguments can be easily compared and any wrong number or type of the argument is reported.
Question : 23
What is the role of Serial.begin()?
Everything begins with the Serial.begin() function. This function in the setup() routine is executed only once, that is, when the Arduino is starting.
Question : 24
What is the purpose of crystal oscillator?
The crystal oscillator helps Arduino in dealing with time issues. On each tick, the microcontroller performs one operation, for example, addition, subtraction, etc. the clock is controlled by an external 16MHZ Crystal Oscillator.
Question : 25
What is SPI (Serial Peripheral Interface) Pins?
The SPI pins are 10, 11, 12, 13 namely SS, MOSI, MISO, SCK. These pins support SPI communication using the SPI library. SPI bus is a system for serial communication, which uses up to four conductors. One conductor is used for data receiving, one for data sending, one for synchronization and one alternatively for selecting a device to communicate with. It is a full duplex connection, which means that the data is sent and received simultaneously. SPI uses the following four wires:
Question : 26
What is the use of Serial Pins?
Serial Pins are the pins have special functions like pins 0 & 1, which acts as a transmitter and receiver respectively. TX and RX indicates the data being transmitted or received the data being transmitted or received over the USB communication.
Question : 27
What is difference between tone() and no Tone()?
tone() sends a square wave on a pin, used for buzzers / speakers to play tones. You can specify the pin, and the frequency. It works on both digital and analog pins.
no Tone() stops the tone() generated wave on a pin.
Question : 28
What is an HC-05 Bluetooth Module? What are its advantages.
HC-05 Bluetooth is a wireless communication protocol; it is used in two devices as a sending and receiving the information. The HC-05 Bluetooth modules are easy to use and simple, its price is low and these types of modules are interfaced with the Arduino, Rasberry Pi, and Microcontroller through the serial UART interface.
Question : 29
What is the SI Unit of Resistor?
The SI unit of resistor is Ohm.
Question : 30
What is the use of delay() function?
It accepts a single integer (or number) argument. This number represents the time (measured in milliseconds).
Question : 31
What is the use of micros() function?
The micros() function returns the number of microseconds from the time, the Arduino board begins running the current program.
Question : 32
What is difference between entry controlled loop and exit controlled loop?
In an entry-controlled loop, the loop control condition is evaluated at the entry point of the loop. However, in an exit-controlled loop, the loop control condition is evaluated at the exit point of the loop.
If the loop control condition is false in the beginning, the entry-controlled loop is never executed, however, the exit-controlled loop would be executed at least once.
Question : 33
What is ISR? Can we pass any parameter and return a value from the ISR?
ISR refers to the Interrupt Service Routines. These are procedures stored at specific memory addresses which are called when a certain type of interrupt occurs.
ISR returns nothing and not allow to pass any parameter. An ISR is called when a hardware or software event occurs, it is not called by the code, so that's the reason no parameters are passed into an ISR.
Question : 34
Write short note on Global Variables and Local Variables.
Global variables: Global Variables, as the name suggests, are Global to the program i.e. they can be accessed anywhere in the program.
Local Variables: Local Variables, in contrast to Global Variables, are confined to their respective function.
Question : 35
What is Main Function ?
Every C or Embedded C program has one main function, from where the execution of the program begins.
Question : 36
What is the difference between unsigned int and signed int in C?
A signed integer can store both the positive and negative values. An unsigned integer can only store the positive value.
Assuming the size of the integer is 2 bytes.
signed int- 32768 to +32767
unsigned int 0 to 65535
Question : 37
When does the keyword const mean?
A const is only a qualifier, it changes the behavior of a variable and makes an object read-only type. When we want to make an object re ad-only type, then we have to declare it as const.
const int iData = 0
Question : 38
Discuss Arduino Uno Board Power Supply.
The Arduino Uno power supply can be done with the help of a USB cable or an external power supply. The external power supplies mainly include AC to DC adapter otherwise a battery. The adapter can be connected to the Arduino Uno by plugging into the power jack of the Arduino board. Similarly, the battery leads can be connected to the Vin pin and the GND pin of the POWER connector. The suggested voltage range will be 7 volts to 12 volts.