Bird
Raised Fist0
Arduinoprogramming~10 mins

Arduino hardware architecture overview - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the microcontroller type used in Arduino Uno.

Arduino
#define MICROCONTROLLER [1]
Drag options to blanks, or click blank then click option'
AESP8266
BPIC16F877A
CATmega328P
DSTM32F103
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing microcontrollers from other platforms like PIC or ESP.
2fill in blank
medium

Complete the code to set the clock speed of Arduino Uno in Hertz.

Arduino
const unsigned long CLOCK_SPEED = [1]; // in Hz
Drag options to blanks, or click blank then click option'
A16000000
B8000000
C72000000
D1000000
Attempts:
3 left
💡 Hint
Common Mistakes
Using 8 MHz or other clock speeds from different Arduino boards.
3fill in blank
hard

Fix the error in the code to correctly initialize the digital pin mode for an LED.

Arduino
pinMode([1], OUTPUT);
Drag options to blanks, or click blank then click option'
AINPUT
BLOW
CHIGH
D13
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'INPUT' or 'HIGH' instead of a pin number.
4fill in blank
hard

Fill both blanks to create a dictionary mapping Arduino pins to their functions.

Arduino
const char* pinFunctions[] = { [1], [2] };
Drag options to blanks, or click blank then click option'
A"13_LED"
B"A0_ANALOG"
C"DIGITAL"
D"ANALOG"
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic terms like DIGITAL or ANALOG instead of specific pin-function strings.
5fill in blank
hard

Fill all three blanks to define a struct representing Arduino pin configuration.

Arduino
struct PinConfig {
  int pinNumber;
  const char* [1];
  bool [2];
};

PinConfig ledPin = {13, [3], true};
Drag options to blanks, or click blank then click option'
Afunction
BisOutput
C"LED"
D"INPUT"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'INPUT' string instead of 'LED' for the function.
Confusing the boolean field name.

Practice

(1/5)
1. Which component in an Arduino board acts as the brain that runs your code?
easy
A. Power supply
B. Microcontroller
C. Input pins
D. Clock

Solution

  1. Step 1: Understand the role of each component

    The microcontroller is the main chip that executes the program. The power supply provides energy, input pins receive signals, and the clock controls timing.
  2. Step 2: Identify the 'brain' of the Arduino

    The microcontroller processes instructions and controls other parts, acting as the brain.
  3. Final Answer:

    Microcontroller -> Option B
  4. Quick Check:

    Brain of Arduino = Microcontroller [OK]
Hint: The brain runs code, so pick microcontroller [OK]
Common Mistakes:
  • Confusing power supply with brain
  • Thinking input pins run code
  • Choosing clock as main processor
2. Which of the following is the correct way to describe the Arduino clock's function?
easy
A. It supplies power to the board
B. It receives input signals
C. It stores the program code
D. It controls the timing of operations

Solution

  1. Step 1: Review the function of the clock

    The clock generates regular pulses that synchronize the microcontroller's operations.
  2. Step 2: Match the function to the options

    Only It controls the timing of operations correctly states that the clock controls timing.
  3. Final Answer:

    It controls the timing of operations -> Option D
  4. Quick Check:

    Clock = timing control [OK]
Hint: Clock controls timing, not power or storage [OK]
Common Mistakes:
  • Thinking clock supplies power
  • Confusing clock with memory
  • Assuming clock receives inputs
3. What will happen if you connect a sensor to an Arduino input pin and run a program that reads the pin value?
medium
A. The clock changes the sensor's output
B. The power supply sends data to the sensor
C. The microcontroller reads the sensor signal through the input pin
D. The output pins receive the sensor data

Solution

  1. Step 1: Understand input pins role

    Input pins receive signals from sensors and send them to the microcontroller.
  2. Step 2: Analyze each option

    The microcontroller reads the sensor signal through the input pin correctly states the microcontroller reads sensor data via input pins. Other options confuse power, clock, or output pins roles.
  3. Final Answer:

    The microcontroller reads the sensor signal through the input pin -> Option C
  4. Quick Check:

    Sensor data read via input pin = The microcontroller reads the sensor signal through the input pin [OK]
Hint: Input pins receive signals; microcontroller reads them [OK]
Common Mistakes:
  • Mixing input and output pins
  • Thinking power supply sends data
  • Assuming clock modifies sensor output
4. You wrote a program to blink an LED using an output pin, but the LED never lights up. Which hardware issue is most likely the cause?
medium
A. The input pin is connected instead of output pin
B. The microcontroller is not powered
C. The clock is running too fast
D. The power supply voltage is too high

Solution

  1. Step 1: Understand LED blinking setup

    LEDs must be connected to output pins to receive signals from the microcontroller.
  2. Step 2: Identify the hardware mistake

    If an input pin is used instead, the LED won't get the signal to turn on, causing it to stay off.
  3. Final Answer:

    The input pin is connected instead of output pin -> Option A
  4. Quick Check:

    LED needs output pin, not input pin [OK]
Hint: LEDs need output pins; check pin type [OK]
Common Mistakes:
  • Assuming power issues without checking pins
  • Ignoring pin direction (input vs output)
  • Blaming clock speed for LED not lighting
5. You want to design a project where an Arduino reads temperature data and controls a fan. Which hardware components must you use together?
hard
A. Microcontroller, input pins, output pins, power supply, clock
B. Microcontroller, output pins only, power supply
C. Input pins, clock, power supply only
D. Power supply, clock, output pins only

Solution

  1. Step 1: Identify components needed for sensing and control

    Reading temperature requires input pins; controlling a fan requires output pins. The microcontroller runs the program, power supply powers the board, and clock manages timing.
  2. Step 2: Match components to options

    Only Microcontroller, input pins, output pins, power supply, clock includes all necessary parts: microcontroller, input and output pins, power supply, and clock.
  3. Final Answer:

    Microcontroller, input pins, output pins, power supply, clock -> Option A
  4. Quick Check:

    All hardware parts needed = Microcontroller, input pins, output pins, power supply, clock [OK]
Hint: Use all parts: brain, inputs, outputs, power, clock [OK]
Common Mistakes:
  • Forgetting input pins for sensors
  • Ignoring clock's role in timing
  • Leaving out power supply