thumbnail image

  • Home
  • About
  • ACE-Lab 
    • Simulink-Based Labs
  • ACE-CORE 
    • Simulink-Based Learning
  • …  
    • Home
    • About
    • ACE-Lab 
      • Simulink-Based Labs
    • ACE-CORE 
      • Simulink-Based Learning
Contact

  • Home
  • About
  • ACE-Lab 
    • Simulink-Based Labs
  • ACE-CORE 
    • Simulink-Based Learning
  • …  
    • Home
    • About
    • ACE-Lab 
      • Simulink-Based Labs
    • ACE-CORE 
      • Simulink-Based Learning
Contact
  • Operate · Embedded Control

    Introduction to Microcontrollers

    Introducing the programmable hardware used to connect sensors, execute control algorithms and generate outputs for physical actuators.

    Contents

    Key Learning Outcomes Introduction to Microcontrollers Arduino Uno Hardware Overview Operating and Electrical Characteristics ACE-Lab Overview & Access Simulink Code Generation Preliminary Learning Interesting Resources Concluding Remarks

    Key Learning Outcomes

    By the end of this section, you should be able to:

    01

    Describe the structure of the ACE-Lab, including the Base + Sense and Actuate elements, and identify the equipment access needed for the practical activities.

    02

    Explain the role of a microcontroller within an embedded control system.

    03

    Identify the principal hardware features of the Arduino Uno R3, including its processor, memory and I/O connections.

    04

    Distinguish between digital input/output, analogue input and pulse-width modulation (PWM).

    05

    Explain how sensors, control algorithms and actuators can be connected through a microcontroller.

    06

    Explain how Simulink models can be converted into C++ code and deployed to Arduino hardware for real-time control.

    Introduction to Microcontrollers

    A microcontroller is a compact programmable computing device designed to interact directly with physical hardware. It combines a processor, memory and input/output interfaces so that measurements can be acquired, processed and used to generate output signals.

    Within a control system, the microcontroller can provide the link between the measurement devices, control algorithm and actuators introduced previously. Sensor measurements are received as inputs, the programmed algorithm processes this information, and output signals are generated to influence the physical system.

    A simple embedded-control sequence is: measure → process → decide → actuate.

    The objective at this stage is not to study microcontroller architecture in detail, but to understand how a programmable device can connect the sensing and actuation elements of a practical control system.

    Arduino Uno

    The Arduino Uno R3 is used here to demonstrate the application of a microcontroller board. It provides a low-cost platform for connecting inputs and outputs, such as sensors and actuators, and for executing a control algorithm on embedded hardware.

    The board is based on the ATmega328P microcontroller, which executes the user program and manages the board's input/output operations. The Uno operates at 5 V and can be powered through its USB connection or from an external supply through the VIN pin or barrel jack.

    The board provides 14 digital input/output pins, six of which support pulse-width modulation (PWM), together with six analogue inputs. These interfaces allow a range of sensors and actuators to be connected for embedded measurement and control activities.

    Labelled Arduino Uno R3 showing the ATmega328P microcontroller, USB connector, power connector, digital I/O, analogue inputs, power and ground pins, AREF and reset controls.
    Figure 1: Key Components of the Arduino Uno Microcontroller.

    Hardware Overview

    The numbered labels in Figure 1 identify the main connections and hardware features used throughout the practical activities.

    ID Component Properties
    1MicrocontrollerATmega328P
    2Power supply pins5 V and 3.3 V regulated outputs
    3Voltage in (VIN)7–12 V recommended external input
    4External power supplyDC barrel jack or VIN pin
    5USB connectionUSB Type-B for power and programming
    6Digital input/output (I/O) pins14 digital pins; 6 support PWM output
    7Digital groundCommon ground (GND)
    8Analogue reference pinAREF
    9Analogue input pins6 inputs (A0–A5)
    10Ground pins (GND)Multiple GND connections
    11Reset pinActive-low reset
    12Reset buttonOn-board manual reset

    Operating and Electrical Characteristics

    The Arduino Uno R3 is designed for a 5 V operating voltage. When an external supply is used through VIN or the barrel jack, 7–12 V is the recommended input range. Each digital I/O pin should normally be designed around a recommended operating current of 20 mA.

    Program code is stored in 32 KB of Flash memory, 2 KB of SRAM is available for variables during execution, and 1 KB of EEPROM provides non-volatile storage. The ATmega328P on the Uno R3 operates at 16 MHz.

    Operating voltage 5 V
    Input voltage (recommended) 7–12 V
    Input voltage (limits) 6–20 V
    Digital I/O pins 14
    PWM-capable digital pins 6
    Analogue input pins 6
    Recommended current per I/O pin 20 mA
    3.3 V pin current 50 mA max.
    Flash memory 32 KB
    SRAM 2 KB
    EEPROM 1 KB
    Clock speed 16 MHz

    ACE-Lab Overview & Access

    Before beginning the hardware-based activities, which start in the next section of the learning sequence, it is useful to understand how the ACE-Lab is structured and to make sure that you have access to the required equipment.

    ACE-Lab · Platform overview

    What is the ACE-Lab?

    Understand how the ACE-Lab is structured (Base + Sense and Actuate), why it is portable and practical for teaching and learning, and how it supports control engineering workflows in MATLAB & Simulink.

    View Details ↗
    Access required

    Need an ACE-Lab? Start Here

    Access to an ACE-Lab is required for the hardware-based exercises. Use the ACE-Lab access page to view the available Base + Sense and Actuate options.

    Access an ACE-Lab ↗

    Simulink Code Generation for Arduino-Based Control Systems

    Modern real-time control systems are commonly implemented using C++ due to its efficiency and suitability for embedded hardware. Simulink supports a model-based design approach, allowing control algorithms to be developed using block diagrams that closely mirror classical control-system representations.

    Using the Simulink Arduino Support Package, these block-based models can be automatically converted into C++ code and uploaded directly to an Arduino microcontroller. This enables control algorithms designed and tested in simulation to be executed in real time on physical hardware without manual coding.

    Before using this workflow, MATLAB and Simulink should be installed and configured, together with the Arduino support package required for code generation and deployment.

    Installing and Setting up MATLAB and Simulink

    Install MATLAB and Simulink

    Install and verify MATLAB/Simulink for ACE-Lab activities, including licensing and the key software packages used throughout the exercises.

    Estimated time: 0.5 hours

    Follow Steps ↗
    Installing and Setting up MATLAB and Simulink

    Install Simulink Code Generation

    Install the Arduino support package so that Simulink models can generate code and be deployed directly to Arduino hardware.

    Estimated time: 0.5 hours

    Follow Steps ↗

    The Arduino library in Simulink provides preconfigured blocks for sensors (inputs) and actuators (outputs), including digital inputs/outputs, analogue inputs and PWM interfaces. This abstraction allows users to focus on control logic rather than low-level microcontroller programming.

    Automatic code generation offers several advantages, including rapid prototyping, consistency between simulation and implementation, cost efficiency, platform independence, and integrated verification and validation. This workflow provides a direct and practical link between control theory, simulation and embedded implementation. These topics will be introduced and covered in later chapters.

    Preliminary Learning

    If MATLAB or Simulink is new to you, complete the following introductory learning activities before progressing to the embedded-control exercises.

    Preliminary Learning

    MATLAB Onramp

    Build core MATLAB skills for engineering work: commands, scripts, arrays, plotting and basic programming.

    Estimated time: 2 hours

    Open Course ↗
    Preliminary Learning

    Simulink Onramp

    Learn Simulink basics for model-based workflows: blocks, signals, scopes and simulation.

    Estimated time: 2 hours

    Open Course ↗
    Preliminary Learning

    Additional Exercises

    Quick refreshers on the MATLAB and Simulink interfaces to help you become familiar with the software workflow.

    Estimated time: 1 hour

    View Exercises ↗

    Interesting Resources

    The following resources provide useful support for exploring the Arduino Uno, microcontroller I/O and model-based implementation in more detail.

    UNO

    UNO R3 Documentation

    Arduino. Official board documentation with the pinout, datasheet, schematics and technical information for the Uno R3.

    Explore resource ↗
    IDE

    Built-in Examples

    Arduino. Introductory examples covering digital input/output, analogue measurement, buttons, LEDs, PWM and serial communication.

    Explore resource ↗
    MW

    Arduino Hardware

    MathWorks. Simulink support for creating, running and deploying models on Arduino hardware, including sensor and actuator I/O.

    Explore resource ↗
    µC

    ATmega328P

    Microchip. Technical information for the microcontroller used on the Uno R3, including memory, I/O, ADC and peripheral capabilities.

    Explore resource ↗

    Concluding Remarks

    Microcontrollers provide an important connection between control-system theory and physical implementation. They allow information from sensors to be acquired and processed before generating output signals that can influence actuators and the physical process.

    The Arduino Uno R3 provides an accessible platform for introducing these ideas. Its ATmega328P microcontroller, digital I/O, analogue inputs and PWM-capable outputs allow a range of sensors and actuators to be connected to a programmable controller.

    At this stage, the important idea is to recognise the microcontroller as the hardware on which the measurement, decision-making and control functions of an embedded control system can be implemented. Simulink provides a model-based route from control-system design and simulation to automatically generated code that can execute on this hardware in real time.

Terms and Conditions Returns & Refunds Privacy Policy

Cookie Use
We use cookies to ensure a smooth browsing experience. By continuing we assume you accept the use of cookies.
Learn More