UPC EETAC Bachelor's Degree in Telecommunications Systems and in Network Engineering EEL


3. Projects: a taste of real-world applications


P_Ch3 consist of designing an application where you have to apply knowledge acquired during the course. It will be based on μC but following general dynamics of Chapter 1 and 2 on FSM and dedicated processors. Some ideas on how to organise and assess the oral presentations and written reports for project P_Ch3.

Conception: This project P_Ch3 must be orchestrated as if it had to be a kind of P8B and P12B. You will try to copy and adapt tutorials and projects from P6-P7-P8 to become P8B, and from P9-P10-P11-P12 to generate a new P12B. Therefore, the project will be organised as dedicated processors composed of a datapath and a FSM control unit.

This is the expected outcome from you as a cooperative group: three files to be uploaded to Atenea task P_Ch3 before the deadline:


Examples ideas and projects from former CSD courses based on PLD and FPGA

VHDL project will be targeted to a Xilinx, Intel or Lattice Semiconductor CPLD or FPGA chips. Some projects are basically based on the analysis of a project already funcioning in CSD. Other project are new developments that has to be designed following the usual planning and organitzation in CSD.



Description and details


Programmable timer

Full project development and testing of the programmable timer already available in P8. It is the analysis of the tutorial circuit.


8-bit hardware series multiplier

Analysis of this circuit. Dedicated processor: FSM + datapath for multiplying sequentially using only adders and data shift registers. 


Serial data transmitter and receiver

Analysis of this USART module circuit: 9200 b/s, parity odd, 1 bit stop.


Tachometer up to 200 km/h

It is a frequency meter. How to measure the frequency of an external signals using a dedicated processor? The pulsed input will be generated bu means of an inductive sensor connected to the car. Speed computation from the measured frequency of pulses. This is an similar problem solved using classic chips  (1) - (2). Hall effect sensors.


Bicycle taillights LED sequencer

This project is like the Johnson Counter in P10 but in VHDL. FSM controlled by an ST/SP button click to begin the sequence generation. A Datapath  includes basically shift registers. Clicking again the same ST/SP button the sequence stops when it finishes.


 HH:MM:SS real-time clock

Study the tutorial P8 and attach to it Hours_Counter tutorial in P7 to be able to enhance the counter up to a modulo 86400. What buttons are required to set time?


A stepper motor controller

This project, in its first design phase, is practicaly a FSM similar to the ones developed in P6. This is a sample circuit proposed by J. C. Arco (download, unzip the file and visualise it as a web page).


LED dimmer

The idea behind a LED dimmer or a DC motor speed controller is the PWM generation. Here there is an example in Arduino to figure out how it works. In this case, the PWM generator must be organised as a dedicated processor. For instance, imagine how an 8-bit vector input can program up to 256 different PWM values. 


TV remote control. PWM generator

Similar to the PWM generator from the LED dimmer. For instance, this encoder circuit 16key_matrix_encoder_reg may be used as input to generate 16 different duty-cycle rectangular waves. This is an initial sketch idea: a FSM will control a datapath (programmable counter) to set the duty cycle of a fixed frequency signal (for instance 1 kHz). Another source for studying how a PWM works is the TMR2-PWM peripheral in PIC18F µC.

What about the receiver end? How to demodulate 16 binary values from an incoming PWM waveform?

Examples ideas and projects from former CSD courses based on microcontrollers

µC projects will be based on PIC18F4520, PIC16F877A or Atmege8535 presented in Chips. Some projects are analysis of circuits already designed in CSD following our organisation: specify, plan, develop and test. Other project are new ideas or applications to be yet specified and planned.



Description and details


Example tutorial. 6-bit Johnson counter.  

Timer TMR2

Using the TMR2 to replace the external time-base CLK signal, like studied in P12. These are the video recording and the project files produced by R. Castro, J. Figueras and C. García: report, video presentation, project development in successive design phases until the final solution.


Design of the HH:MM:SS real-time clock.

The idea is to study P8 programmable timer and organise this real-time clock in the same way: a dedicated processor with a FSM and a datapath (the counter modulo 86400 be translated into C). These are the sample schematic (1) and the C code (2)  to develop design phase #1. This is an example schematic to start planning next design phase #2 (3). This is another multiplexed digit system that can be used after replacing the classic internal design using TTL chips by a microcontroller. 


Design of a programmable timer like the Timer_MMSS.

Timer TMR2, LCD display

Dedicated processor, FSM + Datapath in C language. This project can be organised in two design phases:

A) Analyse Timer_MMSS in P8 already solved using VHDL and a FPGA. Sketch the main blocks and resources for this circuit.

B) Analyse this Timer MMSS so that you can infer how hardware-software diagrams and datapath routines can be planned. For the datapath design, you better start studying a simple 1-digit BCD counter and chain them to get a 2-digit BCD module 60 counter, and so on. Finally, define a FSM to act as control unit.


Serial data transmitter and receiver.

9200 b/s, parity odd, 1 bit stop.

Embedded USART peripheral.

Microcontroller peripheral.  A very interesting material to start learning about serial communications is this USART module solved using VHDL.


Temperature acquisition system based on µC: thermometer from -10 °C to +40 °C.

 A/D embedded peripheral.


- Timer0 (or Timer1 or Timer2) to generate the sampling frequency for the A/D converter, for instance 2 Hz, two temperature samples per second.

- A/D converter to translate an analogue value from 0V to 5V into a digital 12-bit (or 10-bit) vector variable representing the value (Var_meas_Temp). The A/D technology: analogue multiplexer, successive approximations conversion, etc.

- The equations in int-float that has to be implemented in the code, to be able to deduce the temperature (Var_Temp) form Var_meas_Temp. Indeed, you can deduce two formulas, one to obtain the temperature in °C and another formula for calculating temperatures in Fahrenheit.

- The sensor and its signal conditioner or amplifier. Technology, calibration curves, precision, range, resolution, etc.


Bike speed meter and odometer (100 km/h, 1000 km).

Counter TMR0, time-base TMR2.

Idea: solve it as in Chapter II as a dedicated processor and then adapt it to a µC. These are some notes and a Proteus project. It is a frequency meter. How to measure the frequency of an external signals using timer/counter peripherals? The pulsed input will be generated bu means of an inductive sensor (hall effect) attached to the fork of the bike wheel and a magnet on the wheel spoke. Speed computation from the measured frequency of pulses. Riding distance measurement accumulating pulses. For example: 20" tyre, TMR2 as time-base for gate-time counting period and TMR3 for counting external pulses from the magnetic sensor attached to the byke wheel.

In this introductory project TMR2 has been interfaced at low-level programming directly configuration bits in RAM registers. However, as in many other peripherals, all commercial C compilers contain high-level C libraries (drivers) that can be used instead of programming at bit level. These libraries (example from ST)  become a hardware  abstraction layer (HAL) to allow the programmer to control peripherals without having to know specific details of a microcontroller family or vendor. Remember how LCD was programmed in P11, without much attention on Hitachi HD44780 chip or liquid crystal technology because this highly specific hardware was abstracted. As projects grow this hardware abstraction becomes indispensable.  


Digital altimeter based on an absolute pressure sensor.

I2C pressure transducer.

I2C transducer already contains: pressure sensor, signal conditioner (resistor's bridge), amplifiers, A/D and digital circuit to generate a high-level digital output ready for the I2C interface. SCL and SDA outputs is what you must connect to a micro-controller I2C bus.

Study how I2C bus works and how is implemented as a µC peripheral, where to find an XC8 library to talk to the sensor.

 Sensor variables such Var_meas_Temp and Var_meas_Pressure will be read in the ISR() function at a given sampling rate provided by timer interrupts.


Digital compass.

I2C transducer.

Similar to to the digital altimeter. The transducer, based on a MEMS magnetometer, probably will include I2C interface.


16-key matrix keyboard based on μC.

RBIF (interrut-on-change)

How to interface a matrix keyboad at PORTB? Pull-up resistors and interrupt flag RBIF (interrupt-on-change feature recommended for wake-up on key depression operations.

Read the datasheet and find similar applications on books or the web. The objective is to design using a μC the same circuit studied in P6: a matrix key encoder or similar.

Data from keypads may be used to turn on a DC motor or open a door when a 4-digit code matches an internal password.


Bathroom or kitchen electronic scale.


Commercial scale.

Concepts: pressure sensors, load cells, signal conditioners, Wheatstone bridge, amplifiers, signals conditioners, OpAmps. A/D converter, sampling frequency using TMR, ISR(), FSM, RAM variables, weight or mass calculation from pressure measurements, etc.


Dot-matrix driver.

An starting problem to organise a dot-matrix driver is here.


A stepper motor controller.


A dedicated processor to be adapted to μC. This is a sample circuit from J. C. Arco. 

What is a stepper motor, how does it works, which buttons/switches will be used to command it: start/stop, rotation direction, etc., how to control the rotation speed, how to measure axis position or rotation speed, commercial product such as steeper motor driver/controller.


LED dimmer.

TMR2 and PWM peripherals

The idea behind a LED dimmer or a DC motor speed controller is the PWM generation. This is an example in Arduino to figure out how it works. 


A data acquisition system for inertial navigation.

The project consists in the specification and planning of an Inertial Navigation System, designed to be on board of a rocket. The system is based on an analog 3-axis accelerometer (such as, for example: KX220-1071), that takes samples at a certain rate of the accelerations that the rocket is experiencing in-flight.

The output from the sensor must be conditioned and then entered into an A/D converter. The digitalized data will be stored in a memory chip, such as a RAM, for post-flight extraction and analysis. The device will get 'on'; that is, the accelerometer will start to record data; once an input signal 'Start' is equal to a logic '1'. The system will stop after a given timing period programmed by a timer circuit. 


DC motor rotation speed controller.

Prob 3, EXA2 1718Q2. Use the draft solution to get ideas on how to proceed. Add variations and new features when necessary.


Water tank controller.

 This problem is presented in this P2 unit as an example of combinational circuit with incomplete truth table. The idea is to organise a similar design based on microcontrollers. 100 samples/s. Study of sensors involved. LCD display to represent water level. Detector of failure in sensors, etc.


LED sequencer.

Problem 6.8 adapted to PIC18F4520. Add variations and new features when necessary.



Other materials of interest 

A few links on FSM that naturally can be implemented in hardware (VHDL -PLD) or in software (μC): (1) on traffic light controllers; (2) academic; (3) sequence recogniser and vending machines; (4) an excellent table of content and web page of resources (5); (6) academic; (7) a robot that avoid obstacles; (8) hobby robotics; (9) theory from AMD; (10) a complete book; (11) All about circuits FSM & μC (12) Software based FSM using μC (ARM paper); (13) A nuclear reactor shutdown system; (14) stepper motors; (15) Control for mobile robots; etc. etc.

This is a list of very interesting teaching experiments and projects based on platform Digital Systems Development Board (DSDB) also compatible with ELVIS III from National Instruments. A typical FPGA board populated with a Xilinx device. It can be programmed with VIVADO EDA tools.

Research papers 

This is an example of a reseach paper in the area of microcontrollers and peripherals on the topic of low power consumption, leaded by prof. Ferran Reverter of the dept. of Electronic Engineering

Reverter, F., "Toward Non-CPU Activity in Low-Power MCU-Based Measurement Systems", IEEE Transactions on Instrumentation and Measurement ( Volume: 69 , Issue: 1 , Jan. 2020 ). DOI: 10.1109/TIM.2019.2953374.

Abstract: This article evaluates the benefits of having peripheral-triggered peripherals in a microcontroller unit (MCU) intended for low-power sensor applications. In such an architecture, the functionality is moved from the central processing unit (CPU) to the peripherals so that a peripheral is able to trigger another peripheral with non-CPU intervention. For the sensor data logging application under study, both energy consumption and measuring time are reduced by a factor of 2 with respect to the case of applying an interrupt-based approach that requires the CPU intervention.

Download the full paper logging in through UPC intranet.

Bachelor dissertations

A pair of bachelor thesis (TFG) on the subject:

- Alberto Gómez Blázquez, A., "Autonomous low-power wireless sensor for a remote weather monitoring station", 2016. To examine the project documentation, download and unzip these two files: 1, 2.  

Wheater station

Fig 5. Weather station representation and its final prototype.

- García Moreno, A. "Autonomous low-power wireless sensor for greenhouse irrigation, 2016. To examine the project documentation download and unzip these two files: 1, 2.  


Fig 6. Greenhouse irrigation system block diagram.


Remarks on projects in engineering context:

Students design solutions for a problem for which there is no single answer. The problem may require students working in cooperative groups to design a combination of plans, schematics, models, diagrams, simulations, source files and presentations. Going through the design process (specify, plan, develop and test) will require students to constantly adjust and modify their solutions to meet criteria. While designing a solution, it will be important to recognise that the idea of failure in engineering is a sign of growth in the cognitive process. Therefore, students may not get a viable solution on the first try or within the provided time constraints. In that case, the instructor can encourage them to reflect on their solution to identify what they have learned and look back to identify and correct design errors.