tes1 Flashcards

1
Q
  1. Which one of the following statements concerning the ports on an Arduino is incorrect?

(a) The PIN register reads the logic levels at a port’s input pins.
(b) There are four ports on an Arduino Uno, referred to as Port A, Port B, Port C and Port D
(c) Each port is controlled by just three registers
(d) The PORT register is used to set a pin high, or low
(e) The DDR register is used to specify if a pin is to be used as an output, or an input.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. The following section of a sketch contains an error. Which one of the following statements best
    describes what the error is?
void setup()  {  
DDRD = B01101010;  
}  
void loop() {  
PORTD = B10101000;  
}  

(a) Pin 3 in the DDRD is incorrectly specified
(b) Pin 5 in the DDRD is incorrectly specified
(c) Pin 6 in the DDRD is incorrectly specified
(d) Pin 7 in the DDRD is incorrectly specified
(e) None of the above
________________________

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. Which one of the following statements is correct?

(a) Any 8 pins on the digital port can be used by port D apart from pins 0 and 1
(b) The instruction DDRD 01011010; will set some lines as inputs and others as outputs
(c) The DDRD instruction must be placed at the top of a sketch above both setup() and loop()
(d) PIND returns the pin configuration of port D
(e) None of the above

A

E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. Which one of the following statements is incorrect regarding the mapping function map()?

(a) The mapping function requires 5 parameters when it is used.
(b) Only one mapping function can be used in a sketch
(c) The input and output ranges of the function map() can contain both positive and negative numbers.
(d) The mapping function will only return integer numbers.
(e) The mapping function can have an output range that is greater than its input range.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. Which one of the following statements is incorrect regarding the servo motor (SM-S2309S) used
    for the exercise questions?

(a) The servo motor can only rotate through a limited number of degrees.
(b) The fixed angular rotation of a servo motor is typically between 0 and 180 degrees.
(c) The servo motor has a number of wires connected to it. One wire is used to send signals to make it
rotate clockwise, another wire is used to send signals to make the servo motor rotate anti-clockwise
and the remaining 2 wires are used to provide power, to drive the motor.

(d) It is possible to connect more than one servo motor to an Arduino Uno.
(e) The servo motor can be driven directly from the digital port, without the need for any additional driver
chips, or driver boards.

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. Which one of the following statements about the inclusion of functions in a sketch is incorrect?

(a) The keyword return must be used when a function is to return a value.
(b) A function can be passed one, or more parameters when it is called.
(c) All functions must be defined within the setup() section of a sketch.
(d) A function can be made to return a value when it is called.
(e) A function can be written that does not expect parameters to be passed to it when it is called.

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

. Which one of the following statements about driving a servo motor using the sketch below is
incorrect?

#include    
Servo servoMotor;    
void setup()  
{  
       servoMotor.attach(3);   
}  
void loop()  
{  
       servoMotor.write(-10); 
       delay(100);  
       servoMotor.write(0); 
      delay(100);              
} 

(a) #include will import a pre-built servo script from the Arduino library.
(b) Servo servoMotor; creates an instance of the servo object.
(c) servoMotor.attach(3); will inform the servo script that the servo motor is connected to pin 3 of the
digital port.
(d) servoMotor.write(-10); will rotate the servo motor output shaft 10 degrees anticlockwise
(e) A delay of 100ms is used to ensure the servo motor output shaft reaches its destination.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

. Which one of the following statements is incorrect?

(a) A stepper motor can be manufactured to be either unipolar, or bipolar.
(b) Stepper motors can rotate both clockwise and anticlockwise, but only one step at a time.
(c) It is impossible to change the speed at which a stepper motor rotates, since the step angle is fixed.
(d) The three common drive modes for stepper motors are: - Wave Drive, Full Step and Half Step.
(e) With Full Step Drive, 2 of the coils in a stepper motor are always activated, unlike Wave Drive, which
only activates 1 coil.

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

. Given the following correctly written sketch, which one of the following statements is incorrect?

//=========================================

void setup() { 
    Serial.begin(9600); 

}

//========================================= 
void loop() { 
       int  adcValue = analogRead(0);  
       float newNumber = calcAnswer(adcValue);  
       Serial.println(newNumber); 

}

//========================================= 
float calcAnswer(int voltage){ 
           int result; 
           result = map(voltage,0,1023,200,300); 
           return float(result);           

}

(a) Variable result is a local variable.
(b) Variable newNumber will hold an integer number between 0 and 1023.
(c) Numbers between 200 and 300 will be printed in the Serial Monitor window.
(d) Variable voltage is a local variable.
(e) The function calcAnswer will be called more than once when the sketch is running.

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. Which one of the following statements concerning interrupts is incorrect?

(a) The 2 different types of interrupt are external and internal
(b) An interrupt cannot be called by an instruction in setup()
(c) An interrupt cannot be called by an instruction in loop()
(d) Only external interrupts require an interrupt service routine
(e) A timer can be used as an internal interrupt.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. Which one of the following statements concerning interrupts is incorrect?

(a) There is a maximum of 2 external interrupts on the Arduino Uno
(b) Digital lines 2 and 3 can only be used for external interrupts.
(c) External interrupts can be triggered by one of 4 modes
(d) Interrupts can be disabled, or enabled by code in either setup() or loop()
(e) External interrupts can be triggered by the voltage on the interrupt pin going negative, going low, falling,
rising, or changing.

A

E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. Which one of the following statements regarding ultrasonic range detection modules is incorrect?

(a) The module measures distance using the pulse time of flight technique
(b) The emitted pulse is referred to as a chirp and the received pulse the echo
(c) The pulseIn() function can be used to detect the echo pulse
(d) The pulseIn() function will return a long integer number in milliseconds.
(e) The pulseIn() function has an optional parameter called timeout, which stops looking for an echo pulse
after a given time period.

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. Which one of the following statements regarding capacitive inputs is incorrect?
    (a) Charge and discharge times can be measured by code from the library CapacitiveSensor, after it has
    been included in your sketch
    (b) A touch sensor requires the use of 2 digital pins and a resistor
    (c) The sensor works by looking at the time taken to charge and discharge a pin.
    (d) A person touching a specific pin on the port increases the capacitance and hence extends the charge
    and discharge times.
    (e) Only 2 capacitive inputs can be used on an Arduino Uno
A

E

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

6
14. Which one of the following statements regarding interfacing devices to the digital pins of an Arduino
Uno is incorrect?

(a) The largest wattage device the Arduino Uno can directly drive is approximately 1W
(b) A mechanical relay, or solid state relay can be used to control both high current and/or high voltage
devices
(c) Solid state relays operate at much higher frequencies than mechanical types
(d) Some types of solid state relay optically isolate the Arduino from the circuit it is controlling.
(e) When driving a MOSFET from a digital pin it is advisable to put a resistor to ground to ensure the device
is fully switched off when not in use.

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
15. Given that a LCD module is connected to an Arduino with the instance name of myLCD, which of the 
following statements is incorrect? 

(a) myLCD.write() can be used to send text to the display module
(b) myLCD.print() can be used to send text to the display module
(c) myLCD.write() will only send text to the display module
(d) myLCD.print() will only send text to the display module
(e) myLCD.write(“Hello”); will print the text “Hello” on the display module

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. Which one of the following statements regarding the advantages of using port manipulation in a
    sketch is incorrect?

(a) It uses fewer lines of code
(b) It can control a greater variety of external devices
(c) It uses the external library called
(d) It is a much faster way of configuring digital lines and sending/reading port data
(e) Less memory space is needed in the microcontroller to store a sketch

A

C

17
Q

7

  1. Which one of the following statements about using the pins on the digital port as an input, is incorrect?

(a) A push button switch needs either an internal, or external resistor to operate correctly
(b) The instruction pinMode(5 , INPUT_PULLUP); activates the internal pull-up resistor on pin 5
(c) The instruction pinMode(3 , INPUT_PULLDOWN); activates the internal pull-down resistor on pin 3
(d) Pin 13 has a built-in resistor for the onboard LED and so its pull-up resistor will not operate properly
(e) The following diagram is an example of a pull-down resistor being used with a push switch : -

A

C

18
Q
  1. Given the following sketch, which one of the following statements is incorrect?
void setup() {  
 DDRD = B00000010;  
 pinMode(12,OUTPUT); 
 Serial.begin(9600);  
}  
void loop() {  
   byte x = PIND;  
 digitalWrite(12, bitRead(x,3));  
 Serial.println(bitRead(x,3)); 
} 

(a) x is a local variable
(b) x can hold an 8-bit binary number
(c) bitRead(x,3) will read Port D to see if pin 3 is high or low
(d) The logic level on pin 12 will be made the same as that on pin 3 of the digital port
(e) PIND is a register that reads the logic levels at Port D input pins

A

C

19
Q
  1. Which one of the following statements concerning Interrupt Service Routines (ISRs) is incorrect?

(a) Parameters can be passed to an ISR when it is called
(b) No value can be returned by an ISR upon its completion
(c) Interrupts can be enabled by code in either setup() or loop()
(d) Interrupts can be disabled by code in either setup() or loop()
(e) A sketch can contain more than one ISR

A

A

20
Q
  1. Which one of the following statements about the use of the mapping function map() is incorrect?

(a) The function requires 4 parameters in order to work
(b) The function returns integer numbers only
(c) The function requires input and output ranges that contain only integer numbers
(d) The input and output ranges used in the function can contain negative numbers
(e) A sketch can contain more than one map() function

A

A

21
Q
  1. Which one of the following statements regarding the HC-SR04 ultrasonic range detection module is
    incorrect?
    (a) The emitted pulse is called the ‘chirp’
    (b) The received pulse is called the ‘echo’
    (c) The pulseIn() function can be used to detect the echo pulse
    (d) The module can detect objects up to approximately 3 meters away
    (e) The control circuit produces 4 KHz pulses each time a trigger signal is sent to the ultrasonic module
A

E

22
Q
  1. Which one of the following statements regarding functions in a sketch is incorrect?

(a) A function can call another function
(b) When the keyword void is placed in front of the function name when it is being declared, it means that
the function will not require any parameters to be passed to it when it is called
(c) When a function is returning a value, the data type must be placed in front of the function name when
it is being declared
(d) Local variables can be declared in a function
(e) Global variables can be accessed by a function

A

B

23
Q
  1. Which one of the following statements concerning absolute encoders is correct?

(a) Gray coding is used to avoid bit misread errors.
(b) A 4-track binary coded absolute rotary encoder can detect a positional change of 22.50.
(c) Adding more tracks increases the resolution.
(d) All of the above

A

D

24
Q
  1. Consider a 1-byte DAC with analogue output voltage range from 0 - 51V. What will be the smallest
    possible change in voltage it can detect?

(a) 200mV
(b) 0.2mV
(c) 0.02mV
(d) 20mV

A

A

25
Q
  1. Which one of the following statements concerning Lorentz force is incorrect?
    (a) Its direction can be given by Fleming’s left hand rule.
    (b) Its direction can be given by Fleming’s right hand rule.
    (c) It is the force felt by a current carrying conductor in a magnetic field.
    (d) It is the basis of motor effect in an electric motor.
A

B

26
Q
  1. A motor has a back EMF constant of 2 V/(rad/s) and a winding resistance of 0.5. If the motor is
    driving a constant 20Nm load when the supply is 10V, at what speed (approximately) does it
    rotate? Given that 𝑻=𝑲𝑩(𝑽𝒂−𝑲𝑩𝝎
    𝑹a

(a) 2.4 rpm
(b) 24 rpm
(c) 240 rpm
(d) 0.24 rpm

A

B

27
Q
  1. In a mechatronic system, the analogue to digital converter (ADC) usually,

(a) Takes input from microprocessor and gives output to the actuator
(b) Takes input from sensor and gives output to the microprocessor.
(c) Takes input from actuator and gives output to sensor
(d) Takes input from sensor and gives output to actuator

A

B

28
Q
  1. Ideally an ADC must sample at a frequency more than twice the highest frequency present in the
    analogue waveform,

(a) So that the processing speed of the microprocessor is doubled.
(b) To ensure effective reproduction of the analogue signal.
(c) So that the response rate of the system becomes twice as fast.
(d) To ensure that the ADC output matches the DAC output of the system.

A

B

29
Q
  1. Which one of the following statements concerning successive approximation ADC is correct?
    (a) It requires 2n comparators for n-bit resolution
    (b) It requires 4 clock cycles for 4-bit conversion
    (c) It is the fastest ADC hence suitable for most applications
    (d) It does not require an oscillator to operate.
A

B

30
Q
  1. Which one of the following statements concerning a smart sensor is correct?
    (a) It can sense as well as process data.
    (b) It has built in analogue to digital converter.
    (c) It can have a transceiver for wireless communication.
    (d) All of the above
A

D