
- ACE-Lab
- ACE-CORE
- …
- ACE-Lab
- ACE-CORE
- ACE-Lab
- ACE-CORE
- …
- ACE-Lab
- ACE-CORE
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
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.
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 1 Microcontroller ATmega328P 2 Power supply pins 5 V and 3.3 V regulated outputs 3 Voltage in (VIN) 7–12 V recommended external input 4 External power supply DC barrel jack or VIN pin 5 USB connection USB Type-B for power and programming 6 Digital input/output (I/O) pins 14 digital pins; 6 support PWM output 7 Digital ground Common ground (GND) 8 Analogue reference pin AREF 9 Analogue input pins 6 inputs (A0–A5) 10 Ground pins (GND) Multiple GND connections 11 Reset pin Active-low reset 12 Reset button On-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 VInput voltage (recommended) 7–12 VInput voltage (limits) 6–20 VDigital I/O pins 14PWM-capable digital pins 6Analogue input pins 6Recommended current per I/O pin 20 mA3.3 V pin current 50 mA max.Flash memory 32 KBSRAM 2 KBEEPROM 1 KBClock speed 16 MHzACE-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.
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.
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
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
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
Preliminary Learning Simulink Onramp
Learn Simulink basics for model-based workflows: blocks, signals, scopes and simulation.
Estimated time: 2 hours
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
Interesting Resources
The following resources provide useful support for exploring the Arduino Uno, microcontroller I/O and model-based implementation in more detail.
UNO Explore resource ↗UNO R3 Documentation
Arduino. Official board documentation with the pinout, datasheet, schematics and technical information for the Uno R3.
IDE Explore resource ↗Built-in Examples
Arduino. Introductory examples covering digital input/output, analogue measurement, buttons, LEDs, PWM and serial communication.
MW Explore resource ↗Arduino Hardware
MathWorks. Simulink support for creating, running and deploying models on Arduino hardware, including sensor and actuator I/O.
µC Explore resource ↗ATmega328P
Microchip. Technical information for the microcontroller used on the Uno R3, including memory, I/O, ADC and peripheral capabilities.
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.

