UPC EETAC Bachelor's Degree in Telecommunications Systems and in Network Engineering EEL
Cross-curricular competences: 1 Cooperative learning; 2 Writing and speaking; 3 Projects; 4 English; 5 Self-directed learning


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 the general dynamics of Chapter 1 and 2 on FSM and dedicated processors.

General conception: This project P_Ch3 must be orchestrated as if it had to be a kind of P8B and P12B. You have to try to copy and adapt tutorials and projects from P6-P7-P8 to become the P8B, and from P10-P11-P12 to become the 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: 3 files to be uploaded to Atenea task P_Ch3 before the deadline:

Some ideas on how to organise and assess the oral presentation and the written report for the project P_Ch3.

The current project proposal can be found in this planning schedule.


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


Design of a programmable time

 S, P, D & T. 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.

S, P, D & T. This is an analysis problem, because it is completelly solved in this old link. Dedicated processor: FSM + datapath for multiplying sequentially using only adders and data shift registers. 


Serial data transmitter and receiver.

S, P, D & T. Subsystem in VHDL. 9200 b/s, parity odd, 1 bit stop. Basically, the analysis of this problem already solved, tested and mounted in a FPGA training board.


Tachometer up to 200 km/h.

S & P. 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 starting problem solved using classic chips  (1) - (2) to examine. Hall effect sensors.


Bicycle taillights LED sequencer.

S & P. Links of interest (1), (2). This project is like the Johnson Counter in P10, but designed in VHDL. A FSM is required. A ST/SP button click to begin the sequence generation (you can have other input switches to select different LED sequences) and then, clicking again the same ST/SP button the sequence stops when it finishes.


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

S & P (or S, P, D & T if you like it). Study the tutorial P8 and attach to it the Hours_Counter tutorial in P7 to be able to enhance the counter up to a modulo 86400.  Which buttons are required to set time?


A stepper motor controller (FSM approach).

S & P. This project, in its first design phase, is practicaly a FSM similar to the ones developed in P6.


LED dimmer.

S & P. 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 an 8-bit vector input can program up to 256 different PWM values. 


TV remote control. PWM generator.

S & P. Very similar to the PWM generator from the LED dimmer. The difference now is that you have for instance 16-key to detect as in P6 registered, and thus, 16 different PWM wave can be generated. for instance, typical blocks that can be used to design this circuit are the FSM and the datapath: (Counter_mod16, Quad_MUX2, Adder_subtractor_4bit, Comp_4bit). This is an initial 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 a PIC16F or PIC18F  µC.

Examples ideas and projects from former CSD courses based on microcontrollers

µC projects will be based on a PIC18F4520 or other devices like PIC16F877A or the Atmege8535. Chips. Some projects are basically based on the analysis of a project already funcioning in CSD, this means that the project must contain all the four design sections (S, P, D & T). Other project are new ideas or applications that has to be designed following the usual planning and organitzation in CSD (S & P) and so they do not include code development and test.



Description and details


Example tutorial. 6-bit Johnson counter.  

S, P, D & T. Using the TMR2 to generate the CLK signal and a switch to select between internal or external CLK. This is approximately the continuation of 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.

S & P. The idea is to study the 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) that later on has to be translated into C.

These are the sample schematic (1) and the C code (2)  to develop the phase 1. This is an example schematic to start planning the next design step (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.

S & P (because the D & T is already completed as an example in P12). Dedicated processor, FSM + Datapath in C language.

This project can be organised in two phases: A) Analyse the Timer_MMSS in P8 which is completelly solved using VHDL and a FPGA; B) analyse the code and the Proteus project given in P12 (timer MMSS), so that you can infer how the plan based on hardware/software diagrams and datapath routines can be deduced. Furthermore, you better start studying a simple 1-digit BCD counter as in P11 and continue chaining them to get a 2-digit BCD module 60 counter, and so on. In the end,  define the FSM which acts as a control unit.



Serial data transmitter and receiver.

S & P.Microcontroller peripheral. 9200 b/s, parity odd, 1 bit stop. A very interesting material to start learning about serial communications is this problem solved using VHDL.


Temperature acquisition  system based on a µC. A thermometer from -10 °C to +40 °C. A/D.

S & P. The key point, in order to plan it as if it had to be the P13 or P14 in CSD, which is what we have in mind, you have to study previously the new peripherals and the new sensor.

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

- A/D converter, to be able to convert 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 this Var_meas_Temp. Indeed, you can deduce two formulas, one to obtain the temperature in °C and another formula for calculating the temperature in Fahrenheit.

- The sensor and its signal conditioner or amplifier. Technology, calibration curves, precision, range, resolution, etc. And, once all these notions are clear, you can prepare the project in similar section as in P12 to obtain a FSM. 


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

S & P. 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.

Example project to study from a former course. 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.

Some ideas on how to start.


Digital altimeter based on an absolute pressure sensor.

S & P. Possibly, this transducer already contains the sensor, the signal conditioner (the resistor's bridge), the amplifiers, the A/D and the 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. And study how this bus works and how it is implemented in the uC peripheral, and where to find a XC8 library to talk to the sensor and etc. with the FSM. The sensor variables, for instance: Var_meas_Temp and Var_meas_Pressure will be read in the ISR() function at a given sampling rate provided by a timer interrupts.


Digital compass.

S & P. Very similar to the digital altimeter. The sensor required (based on a MEMS magnetometer) probably will have a I2C interface.


16-key matrix keyboard based on μC.

S & P.Study the new peripheral or mechanism associated with detecting the pushing of multiple keys. In Microchip PIC, this port is the PB, its Pull-Up resistors, and the interrupt flag RBIF (The interrupt-on-change feature is recommended for wake-up on key depression operation and operations where PORTB is only used for the interrupt-on-change feature.) 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. For instance, use the data from the keyboard to turn on a DC motor or to open a door when a 4-digit pin matches an internal password.


Bathroom or kitchen electronic scale.

S & P. Comercial scale. Pressure sensors or load cells. Signal conditioners, Whetstone bridges, OpAmps. A/D converter for 1 or 4 legs, sampling frequency, using a timer and the ISR(), FSM, RAM variables, weight or mass calculation from preasure measurements, etc.


Dot-matrix driver.

S & P. An starting problem to organise this dot-matrix driver is here.


A stepper motor controller (FSM approach or dedicated processor in a second desigh phase).

S & P. The basics of this problem is basically a FSM like in P6 which here has to be adapted for a uC. This final bachelor degree thesis is a good starting point. Some ideas: specify and planning firstly as a FSM (P6) and later in a phase#2 as a dedicated processor (P8). Then, adapt each design phase to uC.

- 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 determine/measure which is the axis position (if position instead of speed is what is required to be controlled), and whatever else you may find in a data-sheet or commercial product such as steeper motor driver/controller.

- Which elements will contain a basic controlled based on a FSM?

- Which is the datapath for, which blocks does it may include, which is the control unit for, how many CLK signal will be required in this application, does it have sense to use a programmable CLK generator? Sketch a general plan and hardware schematic.

- How to adapt it to a uC and C language, Which may be the first design phase? Hardware circuit, software organisation, inputs, outputs, interrupts, hardware-software diagram, RAM variables, functions, etc.

Because it is S & P you should prepare about 10 slides and a document to be able to present it in about 10 min. and write a report.


LED dimmer.

S & P. 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 PIC Timer2 and the PWM module has to be studied.


Even/odd modulo 50 counter

S, P, D & T. The problem 8.4 adapted to the PIC18F4520. 

Here you have the advantage of having solved completely the project in VHDL as a PLA, thus, it means that you have to focus your attention on how to adapt it to a microcontroller and C.

- Which is the general software-hardware diagram? What are going to become now in C such entities as the code converter in ROM? How a hardware device such as the JK_FF can be replaced by a var type flag generated in a ISR() ?, etc.

- How many inputs to read, how many interrupts? Where to connect I/O?, How many RAM variables? Functions like datapath(), are going to run all the time or called only in some specific states' (examine the example Timer_LCD), etc. Before attempting any C code translation, be sure that it is organised completely, or at least the phase#1, because a phase #2 may be the code translation truth table from binary to BCD units and tens. Are you going to use 7-segment digits or an LCD instead? 


A data acquisition system for inertial navigation.

S & P. The project consists in the specification and planning of an Inertial Navigation System, designed to be on board of a sounding rocket. The system is based on an analog 3-axis accelerometer (such as, for example: KX220-1071), which takes samples, at a certain rate, of the accelerations that the rocket does experience 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. 


Pulse-width modulation (PWM) generator.

S, P, D & T. Prob 3, EXA2 1718Q1. Use the draft solution to get ideas on how to proceed. Add variations and new features when necessary.


DC motor rotation speed controller.

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


Programmable delay generator.

S, P, D & T. Prob 2, exam 1819Q1. Use the draft solution to get ideas on how to proceed. Add variations and new features when necessary.


LED rotator.

  S, P, D & T. Prob 5, exam 1920Q1. Use the draft solution to get ideas on how to proceed. Add variations and new features when necessary.


Water tank controller.

S, P, D & T. This problem is presented in this P2 unit as an example of combinational circuit with an 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.

S, P, D & T. The problem 6.8 adapted to the 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.

For example, this is another tutorial on the design of a bicycle speed meter (20" tyre) using 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, the TMR0  has been interfaced at bit level programming 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 al this highly specific hardware was abstracted. We recommend you to study some of them because as projects grow they become indispensable.  

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

Those below are 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, (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, (1)


Some 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.