Power & control
- Power electronics
- Control systems / PID
- Power systems & protection
- PLC · IEC 61131-3
- Ladder logic
- Renewables / MPPT
- Transmission & distribution
Open to internships & collaborations
I study electrical engineering, and I build power electronics and the firmware that runs them.
I'm in my fourth year at MUST, working on converters, motor control on STM32 and PLC logic. On the software side I write Python tools, and lately I've been building a full Android app in Kotlin.
Banha, Egypt · UTC+2
I'm an electrical engineering student at Misr University for Science and Technology (MUST). In 2022–23 I studied abroad at Istanbul University and Sakarya University in Turkey. That year pushed me to be a lot more independent, and it showed me how differently people learn and work.
I've always wanted to know how things actually work, from a circuit on a breadboard to the code running on a microcontroller to what a computer is doing underneath. Along the way I picked up circuit design, embedded C and some full-stack development. The part I enjoy most is where hardware and software meet, and I pick projects that make me learn something new.
Long term, I just want to keep learning until I can leave a positive mark on the world.
What I use, and how often. The highlighted ones I use every week.
MUST Electronics Lab · 6th of October, Egypt
Independent · Remote
Obsidian Codex · programming collective
Some of these started as coursework, and some I made just because I wanted them. The previews are rebuilt in HTML and SVG, so they run right here in your browser. Open a project for the details, and a few of them you can play with.
An offline-first Islamic companion for Android: prayer times with the adhan, the 604-page Madani Mushaf with 34 reciters, Qibla, azkar, fasting and Zakat. It has no ads or accounts and never uploads anything.






Siraj (سِراج, "lamp") is by far the largest project on this page. It's an Islamic companion app for Android: prayer times with a proper adhan, the 15-line Madani Mushaf with recitation, a Qibla compass, azkar, tasbih, and fasting and Zakat tools. It runs in English, Arabic, Turkish and Urdu, with right-to-left layouts for Arabic and Urdu.
It's built to work offline. Prayer times and the Qibla are calculated on the phone from your coordinates, and every network request the app makes is a download. There's no upload code at all, so bookmarks, notes and the prayer log stay on the device.
The hardest problem was size. With the Mushaf database and the page fonts for all 604 pages bundled, the release build came out at 126 MB. I moved that content to release assets that the app downloads once on first launch, with resumable downloads, which brought the APK down to 32 MB.
The other one was getting the adhan to fire on time while the phone is asleep. It's scheduled as an alarm clock, which survives Doze and Do Not Disturb, and falls back to an exact alarm. The whole schedule is rebuilt after a reboot, a time or timezone change, or an app update.
It's now in production for Android and available on Google Play.
object QiblaCalculator {
private const val MECCA_LAT = 21.4225
private const val MECCA_LON = 39.8262
/**
* Calculates the Qibla bearing from the given location.
* @return Bearing in degrees (0 to 360)
*/
fun calculateQibla(latitude: Double, longitude: Double): Double {
val phi1 = Math.toRadians(latitude)
val lambda1 = Math.toRadians(longitude)
val phi2 = Math.toRadians(MECCA_LAT)
val lambda2 = Math.toRadians(MECCA_LON)
val deltaLambda = lambda2 - lambda1
val y = sin(deltaLambda)
val x = cos(phi1) * tan(phi2) - sin(phi1) * cos(deltaLambda)
val qiblaRad = atan2(y, x)
return (Math.toDegrees(qiblaRad) + 360.0) % 360.0
}
}
A 50 W converter in continuous conduction mode, simulated in Simulink with a PI voltage loop, then built and checked on a real prototype.
I needed a regulated 24 V rail from a 12 V source at 50 W. I sized the inductor for about 20 % current ripple and the output capacitor for under 2 % voltage ripple, then closed the loop with a voltage-mode PI controller in Simulink and tuned it against load steps.
Once the model behaved, I built a prototype and compared the real waveforms against the simulation.
Vin = 12; % V
Vout = 24; % V
Pout = 50; % W
fsw = 100e3; % Hz
D = 1 - Vin/Vout; % 0.5
Iin = Pout/Vin; % 4.17 A
Iout = Pout/Vout; % 2.08 A
dIL = 0.20 * Iin; % 20 % inductor ripple
L = Vin*D / (fsw*dIL); % ~144 uH, rounded up to 150 uH
C = Iout*D / (fsw * 0.02*Vout); % ~21.7 uF for 2 % ripple
Closed-loop speed control of a brushed DC motor on an STM32F103, with encoder feedback, a discrete PID with anti-windup, and PWM into an L298N.
Speed comes from an optical quadrature encoder, and the controller runs at a fixed rate from a timer interrupt. The integrator is clamped so it doesn't wind up while the output is saturated, and the derivative acts on the measurement rather than the error, so setpoint changes don't cause a kick.
The result settles in under 280 ms with no steady-state error.
typedef struct {
float kp, ki, kd;
float integral, i_limit;
float prev_meas;
float out_min, out_max;
} pid_t;
float pid_update(pid_t *c, float setpoint, float meas, float dt)
{
float err = setpoint - meas;
c->integral += err * dt;
if (c->integral > c->i_limit) c->integral = c->i_limit; /* anti-windup */
if (c->integral < -c->i_limit) c->integral = -c->i_limit;
/* derivative on measurement: no kick on setpoint steps */
float d = -(meas - c->prev_meas) / dt;
c->prev_meas = meas;
float out = c->kp * err + c->ki * c->integral + c->kd * d;
if (out > c->out_max) out = c->out_max;
if (out < c->out_min) out = c->out_min;
return out; /* duty cycle, % */
}
An STM32 samples mains voltage and current, works out RMS values and power factor, and streams them over UART to a Flask dashboard on a Raspberry Pi.
Voltage and current are sampled as interleaved pairs by the ADC. For each block of samples the firmware computes RMS voltage, RMS current and real power, and from those the power factor. It sends a compact frame over UART, and a Raspberry Pi reads the serial stream and serves a small Flask dashboard.
This one is still in progress.
#define N_SAMPLES 1000
/* interleaved: [v0, i0, v1, i1, ...] filled by DMA */
extern volatile uint16_t adc_buf[2 * N_SAMPLES];
void power_metrics(float *vrms, float *irms, float *p, float *pf)
{
float sv2 = 0, si2 = 0, svi = 0;
for (int n = 0; n < N_SAMPLES; n++) {
float v = (adc_buf[2*n] - 2048) * V_SCALE;
float i = (adc_buf[2*n + 1] - 2048) * I_SCALE;
sv2 += v * v;
si2 += i * i;
svi += v * i;
}
*vrms = sqrtf(sv2 / N_SAMPLES);
*irms = sqrtf(si2 / N_SAMPLES);
*p = svi / N_SAMPLES;
*pf = *p / (*vrms * *irms);
}
A journaling app for iOS and Android that tracks your mood and daily activities, gives you insights over time, and keeps your tasks in one place.
My Journal is a place to write about your day, log how you feel, and see patterns in your mood over time. It also has a simple task list, so your to-dos and your notes on the day are in one place.
It's available on iOS and Android, and the landing page is live.
PV panel and buck converter with a perturb-and-observe tracker, compared against incremental conductance under changing irradiance.
A PV panel feeds a buck converter, and an MPPT controller adjusts the duty cycle to keep the panel at its maximum power point. I implemented perturb and observe, then compared it with incremental conductance as irradiance changed.
P&O reached roughly 98.5 % tracking efficiency in simulation.
function D = mppt_po(V, I, Vprev, Iprev, Dprev)
step = 0.005;
dP = V*I - Vprev*Iprev;
dV = V - Vprev;
if dP == 0
D = Dprev; % at the peak, hold
elseif (dP > 0) == (dV > 0)
D = Dprev - step; % keep raising panel voltage
else
D = Dprev + step; % went past the peak, back off
end
end
Overcurrent relay coordination for a 3-bus radial network, with TCC curves set for selective fault isolation.
A coordination study for a 3-bus radial network in ETAP. I set the time–current characteristic curves of the overcurrent relays so the relay closest to a fault trips first, with enough margin between each primary relay and its backup.
I verified the settings with short-circuit analysis.
A 400 V, 50 Hz voltage-source inverter with sinusoidal PWM, and THD compared across modulation indices using FFT.
A three-phase voltage-source inverter in Simulink, driven by sinusoidal PWM. I swept the modulation index and tried different switching schemes, using FFT analysis on the output to see how total harmonic distortion changed.
f = 50; % fundamental, Hz
fc = 5e3; % carrier, Hz
ma = 0.85; % modulation index
t = 0:1e-5:0.04;
ref = ma * [sin(2*pi*f*t); sin(2*pi*f*t - 2*pi/3); sin(2*pi*f*t + 2*pi/3)];
carrier = sawtooth(2*pi*fc*t, 0.5); % triangle
gates = ref > carrier; % one row per phase leg
ADC captures from an STM32, analysed in MATLAB to measure THD and pick out the harmonics non-linear loads inject.
The STM32 captures waveforms with its ADC and exports them to MATLAB, where I run an FFT to compute total harmonic distortion. With non-linear loads connected, the 3rd and 5th harmonics show up clearly.
Still in progress.
A conveyor that routes each item to the right bin based on sensor input, with an emergency stop and fault indication.
A sorting conveyor written in CODESYS. Sensors detect each item and the logic fires the right diverter to send it to its bin. The emergency stop latches the line off until it's reset, and fault lamps show what went wrong.
IF xEStop OR xFault THEN
xMotor := FALSE;
xFaultLamp := TRUE;
ELSIF xStart THEN
xMotor := TRUE;
xFaultLamp := FALSE;
END_IF;
(* divert metal parts to bin 1 *)
xPusher1 := xMotor AND xSensorMetal;
IR sensor array and a PD controller on an ATmega328P, tuned for sharp corners, on a PCB I designed in KiCad and soldered by hand.
An IR sensor array reads the line position and a PD controller on an ATmega328P steers with differential drive. Most of the tuning went into holding the line through sharp corners without oscillating on straights.
I designed the board in KiCad and soldered it by hand.
static int last_err;
void steer(void)
{
int err = line_position(); /* negative = line is left */
int corr = KP * err + KD * (err - last_err);
last_err = err;
set_motors(BASE_SPEED + corr, BASE_SPEED - corr);
}
Moderation, levelling, mini-games and a small economy, running on live community servers.
A set of bots I built for communities I'm part of: moderation tools, a levelling system, mini-games and a custom economy. They run on live servers, which means real users finding every edge case I missed.
A small browser on PyQt5 and QtWebEngine with tabs, cookies and a basic DOM inspector.
I wanted to understand what a browser does beyond rendering, so I built one around QtWebEngine. It handles tabs, navigation, HTTP requests and cookie management, and has a simple DOM inspector.
A MATLAB app with 6 signal types, 6 modulation schemes and an SNR slider, plus a built-in assistant called Aura.
A MATLAB GUI for exploring analog communication systems. You pick one of six signal types and one of six modulation schemes (AM, FM, PM, DSB, SSB, VSB), then drag the SNR slider to see how noise affects the result.
It includes Aura, an assistant built on my DARK system. Aura explains what you're seeing in Arabic or English, reads answers aloud, and can generate the MATLAB code for a setup in one tap.
My own take on Flappy Bird, with custom graphics, simple physics and difficulty that ramps up.
A remake of Flappy Bird in PyGame with my own graphics, gravity and collision detection, and a difficulty curve that tightens the gaps as your score goes up.
A 2D adventure with hand-drawn pixel art, made with my friend Omar Hossam.
A 2D pixel art adventure in Godot that I'm making with my friend Omar Hossam (attackermr.xyz). All the assets are hand-drawn. A playable demo is on the way.
A general-purpose assistant that runs entirely on local models through Ollama.
DARK is my long-running AI project: a general-purpose assistant built on local LLM inference with Ollama instead of a hosted API. Most of the work is in the pipeline around the model, such as retrieval (RAG) and the reasoning steps, rather than the model itself.
Aura, the assistant inside my communication simulator, is a specialised DARK instance. It streams answers in Arabic and English and falls back to an offline mode when the model isn't available.
Pulls posts from Twitter and Instagram through their REST APIs and shows engagement numbers in one place.
A dashboard that aggregates feeds from Twitter and Instagram and puts post analytics and engagement side by side. React on the front end, a Node.js service on the back end that talks to the platform APIs.
A Forge mod that adds NPCs with branching dialogue and simple quests.
A Forge mod that adds NPCs with branching dialogue trees and quest logic. I built it mostly to understand how a game's event loop works and how the Forge API hooks into it.
Warps, a simple economy and event-based rewards for a live Paper server.
A Paper plugin for a live server: player warps, a simple economy and rewards triggered by in-game events. It's how I learned Bukkit's event system.
Nothing here yet.
Small tools I made for this site. Two of them are the maths behind my own projects: the boost converter and the motor's PID loop. They all run in your browser.
D = 1 − Vin/Vout · ΔIL = Vin·D / (L·fs) · ΔV = Iout·D / (C·fs) · ideal parts
duty = Kp·e + Ki·∫e dt − Kd·dω/dt, clamped to 0–100 %, with the integrator held while it's clamped. Same as the firmware.
My home university. One more year to go after this one.
Took advanced engineering courses there.
Focused on computer engineering. Honestly some of the best courses I've taken.
Where the maths and science foundation came from.
Sitting around 1900 Elo and still climbing. Yes, I will sacrifice the rook.
Minecraft is my main creative outlet, and I've written mods and plugins for it. I love RPGs, and lately I've been enjoying a bit of Fortnite.
Formal or colloquial, I'm honestly in love with it.
There's always something half-built on my breadboard.
Blender for fun: game assets, mechanical parts I want to see before I build them, random objects.
Studying in Turkey gave me a taste for new places. Also, soğuk baklava has a special place in my heart.
I'm looking for internships in power electronics and embedded systems. If you're working on something interesting, I'd like to hear about it. Email is the quickest way to reach me.