Module information on this degree can be found below, separated by year of study.

The module information below applies for the current academic year. The academic year runs from August to July; the 'current year' switches over at the end of July.

Students select optional courses subject to rules specified in the Mechanical Engineering Student Handbook,  for example at most three Design and Business courses. Please note that numbers are limited on some optional courses and selection criteria will apply.

Embedded C for Microcontrollers

Module aims

  • To introduce students who are proficient in MATLAB to C:  amongst the most widely-used ever amongst programming languages, and one which provides an excellent foundation for learning others (e.g. C++ and JavaScript).
  • To develop, from the basic knowledge of microcontrollers provided in ME2 Mechatronics, an ability to program, in C, mechatronic systems containing typical sensors and actuators.

ECTS units:    5    

Learning outcomes

On successfully completing this module, students will be able to:

  • Recall the principal terminology of stored-program computer hardware and software
  • Write simple C programs manipulating text, numerical bit-pattern data
  • Design, make, test and document a functional mechatronic system containing an embedded microcontroller
  • Assemble a working microcontroller-based mechatronic system on a prototype board

Module syllabus

Introduction to C language: structure, types and variables, arrays, assignment operations, conditional expressions, flow control, switch.
Advanced C language: structures, functions, recursions, pointers.
Introduction to microcontrollers:  architecture, PIC18FXXX examples, the PICKit Programming Device, programming, debugging.
Bit operations: inputs and outputs: digital IO, analog IO.
Application: time-based interrupts.
Time measurement: oscillators, timers;  application to servo motors.
Further applications: recap of the material, LCD, ultrasonic distance measurement
Motor control:  stepper motors, DC motors, PWM, optical encoders.
Communication (master): Serial Protocol Interface, SPI-master, I2C.
Communication (slave): SPI-slave, RS232 to PC.


In order to gain the maximum benefit from ECM, students are expected to have a good understanding of ME1 and ME2 mechatronics as well as ME1 computing, including:

  • Use of oscilloscope
  • Assembling simple circuits (breadboard)
  • Standard programming structures: conditional statements (if…  then… else), loops (e.g. for… next)
  • Binary and hexadecimal number bases.
  • Resistor network analysis
  • Pulse width modulation
  • Sampling
  • Data acquisition

Teaching methods

  • Duration: Spring term (10 weeks)
  • One 3-hour lab-based tutorial per week, supported by in-situ lectures.
  • Non-assessed hands-on system construction and programming exercises supported by tutor feedback.
  • Individual system construction and programming project chosen from a closed list.

Summary of student timetabled hours:
Lectures: 10
Tutorials:  20
Total:  30
Expected private study time:  5hr per week on individual project.


No examination.

Individual project:  200 marks.

Module leaders

Professor Ravi Vaidyanathan