Mechatronics Engineering · GUC Cairo

Mohamed
Belal

Embedded Systems · Control Theory · Hardware Prototyping

I build things that sit at the boundary of software and hardware — PID controllers tuned to 17-count Hall sensor windows, circuits debugged at the register level, simulations that predict what the breadboard will do before I touch a wire. Currently a Mechatronics Engineering student at the German University in Cairo, working from simulation to reality, one project at a time.

Mohamed Belal
5+
Projects
3
Platforms
2
Years in
STM32F103C8T6Arduino NanoPID ControlFreeRTOSProteus ISISMATLAB / SimulinkSolidWorksLTspiceEmbedded CJava · PythonISO 16A-1 Chain DriveBJT Amplifier Design STM32F103C8T6Arduino NanoPID ControlFreeRTOSProteus ISISMATLAB / SimulinkSolidWorksLTspiceEmbedded CJava · PythonISO 16A-1 Chain DriveBJT Amplifier Design

About

Who I Am

I'm Mohamed Belal — a Mechatronics Engineering student at the German University in Cairo (GUC), expected to graduate in 2028. My work lives at the intersection of electronics, software, and mechanical systems. I don't just simulate — I build, break, debug, and rebuild until it works.

The thread connecting all my projects is the feedback loop. Whether it's a PID controller catching a levitating magnet at a 17-count Hall sensor window, or an NTC thermistor triggering a relay at exactly the right temperature — I care about making systems that respond, adapt, and behave predictably under real-world conditions.

I work bare-metal where it matters (register-level C on STM32), reach for the right abstraction when it doesn't (Arduino, FreeRTOS), and validate everything in simulation before soldering a single component.

Microcontrollers
STM32F103 · Arduino Nano
RTOS
FreeRTOS · Bare-metal C
Control
PID · Feedforward · LPF
Simulation
Proteus ISIS · LTspice
Computation
MATLAB · Simulink
Mechanical
SolidWorks · WinNC
Programming
C/C++ · Java · Python
Circuit Design
BJT · Op-Amp · H-Bridge

Experience

Internship

SolidWorks KiCad Gearbox Design Planetary Gears Mechanical Design

Mechanical & Electrical Engineering Intern

ARAtronics Research Centre  ·  Summer 2025

Supervisor: Amir Roushdy — Associate Professor of Mechatronics & Robotics, GUC · Director, ARAtronics Research Centre

ARAtronics Research Centre is a research-driven institution focused on electromechanical systems, robotics, automation, and advanced gear mechanisms. During the internship I was embedded in the mechanical design and research unit while also contributing to the electronics section.

▸ What I Did

Designed a four-stage spur gear joint gearbox (1:20 reduction ratio) and a two-stage planetary gearbox (compound + simple, 1:40 ratio, outer diameter ≤ 120 mm) — both in SolidWorks with full gear tooth calculations, pitch diameter sizing, and factor of safety ≥ 3. Sourced and integrated standard bearing assemblies from McMaster-Carr. Coupled both designs to a stepper motor and optical encoder. Contributed to the electronics section by studying sensors and designing schematics in KiCad.

Spur gearbox assembly — SolidWorks Planetary gearbox — SolidWorks Spur gearbox internal view — 4 stages Planetary gearbox — compound stage detail
gearbox_specs.txt
// Project 1: Spur Gear Joint Gearbox
Stages     : 4
Ratio      : 1:20
Safety FoS : > 3.0
Coupling   : Stepper motor + encoder
Bearings   : McMaster-Carr ABEC-1 standard

// Project 2: Planetary Gearbox
Stages     : 2 (compound + simple)
Ratio      : 1:40
OD limit   : < 120 mm
Stage 1    : Compound planetary
Stage 2    : Simple planetary
Coupling   : Stepper motor + encoder

// Electronics (KiCad)
Tasks      : Sensor study
Tool       : KiCad schematic capture
Output     : Sensor circuit design

Work

Projects.

01
STM32F103C8T6FreeRTOSPID ControlMATLABSolidWorks

Electromagnetic Levitation System

Design, fabricate, and experimentally validate a closed-loop electromagnetic levitation system that stably suspends a neodymium magnet in mid-air. The system integrates a custom-wound electromagnet, dual KY-024 Hall-effect differential sensing, MOSFET power electronics, FreeRTOS firmware on STM32, and a full MATLAB simulation pipeline — all modelled from first principles using Newton's second law and linearised control theory.

⚠ Key Challenge

The plant has a real positive pole — it is open-loop unstable by physics. The linearised transfer function G(s) = Δx/Δu derived from the dipole force model (F = C·i²/x²) confirmed this. Bridging the gap between the MATLAB simulation gains (Kp=−80, Kd=−5) and the hardware-deployed gains (Kp=9.8, Ki=0.572, Kd=1.83) required understanding that the simplified model does not capture coil inductance dynamics, ADC quantisation noise, or mechanical resonance of the 3D-printed structure. Anti-windup clamping (±3000 counts) and a derivative IIR filter (α=0.85) were essential to prevent integral windup during startup and eliminate sensor noise from the derivative term.

STM32_Firmware.c
/* STM32 FreeRTOS ControlTask 1kHz */
#define SETPOINT    56
#define KP          10.0f
#define KI          0.6f
#define KD          1.7f
#define BASE_PWM    3000
#define DERIV_ALPHA 0.97f

/* differential Hall sensor position */
float input = hallA0F - hallA1F;
float error = SETPOINT - input;

/* IIR derivative + anti-windup */
filteredDeriv = DERIV_ALPHA*filteredDeriv
  + (1.0f-DERIV_ALPHA)*(input-lastInput);
outputSum += ki_scaled * error;
outputSum = CLAMP(outputSum,-3000,3000);

/* gain scheduling */
float kpU=(error<-20)?KP*1.3f
          :(error>10) ?KP*1.2f:KP;

/* PID → TIM1 PWM output */
uint16_t pwm=CLAMP(BASE_PWM
  +kpU*error+outputSum
  -kd_scaled*filteredDeriv,0,3500);
TIM1->CCR1=pwm;
02
Proteus ISISBC547 BJTNTC ThermistorRelay

Automated Thermal Management System

Design a temperature-controlled relay switching circuit that automatically activates a 12V cooling fan once a temperature threshold is crossed — using only passive components and two BJTs, no microcontroller required.

⚠ Key Challenge

Initial simulation failed — D1 (1N4148) was placed in Q2's emitter path as a flyback diode, but the reference design uses it for temperature compensation between the two transistors. Also diagnosed a biasing topology error: Q1's collector was not driving Q2's base. Corrected both and re-verified relay activation by sweeping the NTC temperature in Proteus.

thermal_circuit.net
; Proteus netlist — key nodes
; R1=68k R2=1k R3=1k R4=4.7k
; TH1=10k NTC · RL1=12V/400Ω

V1  VCC 0       DC 12
R1  VCC NTC_TOP 68k
TH1 NTC_TOP 0  NTSA0XH103

; Q1 collector → Q2 base
Q1  Q1C Q1B 0     BC547
R4  VCC Q1C     4.7k
Q2  RL_COIL Q1C 0 BC547

; D1 temp-compensation Q1↔Q2
D1  Q1B Q1C     1N4148

RL1 VCC RL_COIL RELAY_12V
C1  VCC RL_COIL 2.2u
03
MATLABNumerical MethodsENME602

Accelerometer Trajectory Reconstruction

Reconstruct a 2D vehicle trajectory from raw accelerometer CSV data using numerical integration, fit a polynomial model to the path, then use root-finding to determine the exact time the vehicle reaches a target displacement — all without using any MATLAB built-in functions.

⚠ Key Challenge

Implementing polyfit from scratch required building the full Vandermonde matrix and solving the normal equations using column normalisation and Horner's Method — without calling polyfit, polyval, cumtrapz, or roots. The root-finding comparison (Bisection vs Newton-Raphson) revealed how dramatically convergence rates differ: bisection halves the interval each step, Newton-Raphson converges quadratically near the root.

MATLAB — Trajectory Reconstruction Figure 1
0 2 4 6 8s pos (m) trap. integral poly fit
trapezoid_integrate.m
% Composite Trapezoidal — no cumtrapz
function pos = trap_integrate(t, acc)
  n   = length(t);
  vel = zeros(n,1);
  pos = zeros(n,1);
  for i = 2:n
    dt     = t(i) - t(i-1);
    vel(i) = vel(i-1) ...
           + 0.5*(acc(i)+acc(i-1))*dt;
    pos(i) = pos(i-1) ...
           + 0.5*(vel(i)+vel(i-1))*dt;
  end
end

% Newton-Raphson root finder
function t_star = newton(poly, t0)
  t = t0;
  for k = 1:50
    ft  = horner(poly, t);
    dft = horner(poly_deriv(poly), t);
    t   = t - ft/dft;
    if abs(ft) < 1e-8; break; end
  end
  t_star = t;
end
04
JavaOOPGitHub

Jackaroo Board Game

Build a fully playable digital version of the Jackaroo board game in Java — applying object-oriented design from the ground up with inheritance hierarchies for card types, encapsulated game state, and clean separation between game logic and display.

⚠ Key Challenge

Modelling the marble movement rules — Jackaroo has edge cases where cards interact with board positions in non-trivial ways. Implementing clean OOP that made these rules extensible without spaghetti required careful class design and iterative refactoring across multiple inheritance levels.

Jackaroo board game — digital implementation
Marble.java
public class Marble {
  private int     position;
  private Player  owner;
  private boolean safe;
  private boolean inBase;

  public void move(int steps, Board b) {
    if(inBase && steps!=4 && steps!=13)
      throw new InvalidMoveException(
        "Can't leave base with this card");
    int target = b.calcTarget(position,steps);
    Marble blocker = b.getAt(target);
    if(blocker!=null && blocker.safe)
      throw new InvalidMoveException(
        "Target is protected");
    b.move(this, target);
  }
}

Contact

Let's Connect

I'm always open to discussing projects, collaborations, internship opportunities, or just talking mechatronics. Whether you're building something or want to see more of my work — reach out.

The fastest way to reach me is email or LinkedIn. All project code lives on GitHub.