YG

Youssef Gaied

Embedded systems and IoT

Third-year Licence student in Computer Systems Engineering.

Projects

Smart Irrigation

Connected irrigation with an AI decision step

ESP32, C/C++, MQTT, Firebase, Android (Java), n8n, Ollama

  • ESP32 board with a calibrated soil-moisture sensor, a DHT22 for temperature and humidity, a light sensor, and a relay-driven pump.
  • Firmware sends readings to Firebase every hour over HTTPS and takes pump commands in real time over MQTT.
  • A native Android app shows live readings and starts watering remotely.
  • A daily n8n workflow asks a local Mistral model whether to irrigate and publishes the answer to the device.

How a watering command travels

Every morning an n8n workflow asks a local language model whether the soil needs water. Press the button to replay that decision.

  1. n8n + MistralReads sensor data, decides at 08:00
  2. MQTT brokerHiveMQ, topic irrigation/command
  3. ESP32C/C++ firmware, subscribed to the topic
  4. Pump relaySwitches on for 30 seconds

Waiting for a command.

The assembled Smart Irrigation board: pump, relay, DHT22, ESP32 and soil sensor on a mouse pad12345
  1. 1
    Soil sensorCapacitive, calibrated with dry (2615) and wet (926) readings
  2. 2
    DHT22Temperature and humidity
  3. 3
    ESP32Wi-Fi, MQTT subscribe, HTTPS uploads to Firebase
  4. 4
    Relay2-channel, active LOW, held off at boot
  5. 5
    PumpMini submersible, runs 30 s per command

See it work

App → MQTT → ESP32 → relay → pump. The captions in the video are in English.

Pin by pin

Every wired signal and power pin on the ESP32, and where it goes.

Soil sensor AOUTanalog inputLDR junctionwith the 10 kΩ resistorRelay IN1pump control, active LOW5 V to the relayVCC and the NO terminalDHT22 DATAtemperature, humidity3.3 V railsoil sensor, DHT22, LDR

Code and docs

Firmware, Android app, n8n workflow and setup guide.

github.com/YoussefGaied/smart-irrigation

What I would fix

  • Private MQTT broker with credentials and TLS
  • On-device moisture rule as an offline fallback
  • Authenticated Firebase access

Tested end to end

App tap, MQTT message, relay, pump. The serial log confirms it: command received, pump on, watering done.

IIoT Predictive Maintenance Rig

Motor condition monitoring from sensor to dashboard

ESP32, C/C++, MQTT, Python, FastAPI, SQLite, React, TypeScript

  • A physical rig: an ESP32 drives a small 6 V DC motor through an L298N driver and measures its speed (slot sensor and a disc on the shaft), vibration (MPU6050 IMU) and current (ACS712).
  • The firmware publishes JSON telemetry every 500 ms over Wi-Fi to a password-protected Mosquitto broker. A Python consumer stores it in SQLite and a read-only FastAPI serves it.
  • A React and TypeScript dashboard with Recharts shows live speed, vibration and device status. A reading that is not valid is labelled as such instead of being hidden.
  • Four transparent threshold rules flag stale data, no speed while the motor is commanded to run, speed while it is stopped, and vibration at rest. No machine learning, and no failure prediction: there is no labelled failure data.
  • Built in ten phases, one subsystem at a time, with an engineering log that records every correction I had to make.

From the sensor to the screen

Every 500 ms the same chain runs end to end on my laptop and the bench rig.

  1. ESP32Speed, vibration, current, motor state
  2. MQTT brokerMosquitto, password, home network only
  3. Python + SQLiteConsumer stores every window
  4. FastAPI + rulesRead-only API, four threshold rules
  5. DashboardReact, TypeScript, Recharts
The motor rig: a small DC motor with a disc on its shaft, taped to a mouse pad, wired to an ESP32 on a breadboard
  • ESP32 DevKit V1Firmware, Wi-Fi, MQTT, PWM motor control, 3 s auto-stop
  • L298N and 6 V motorDirection and speed by PWM, six AA cells as supply
  • Slot sensor and discSpeed as pulses per second, about 200 at the duty I tested
  • MPU6050 IMUSix-position calibration, vibration RMS
  • ACS712 20 AMotor current, uncalibrated

The dashboard

Live test with the motor stopped: device online, no active alerts, vibration flagged as not valid.

Dashboard: cards for API, device, rules and motor, then charts of speed, vibration and current

Code and docs

Firmware, backend, dashboard, phase write-ups and the engineering log.

github.com/YoussefGaied/iiot-predictive-maintenance

What does not work yet

  • RPM assumes 2 pulses per revolution, never verified
  • Vibration is valid only with the motor off
  • Current is uncalibrated and too noisy with Wi-Fi on
  • The temperature sensor broke and is left out

What I would fix

  • Measure the battery and calibrate current with a multimeter
  • Count real turns to verify pulses per revolution
  • Cut motor noise on the IMU: capacitor, distance, wiring
  • TLS on the broker

EdgeCardio

12-lead ECG classifier shrunk for edge devices

Python, PyTorch, ONNX Runtime, scikit-learn, PTB-XL

  • A small 1D CNN that reads a 10-second, 12-lead ECG and predicts which of five diagnostic classes apply: normal, myocardial infarction, ST/T change, conduction disturbance and hypertrophy. A record can have several at once.
  • Trained on PTB-XL, about 21,000 clinical ECG records, then exported to ONNX and quantized to int8 so it runs on a small CPU.
  • Started at the AI Night Challenge hackathon with a team of 5. The first version used a random split, which can put one patient in both train and test, so I reworked it on the official PTB-XL folds, which keep each patient in one fold.
  • A research and learning prototype. It is not a medical device and has not been validated clinically.

From raw ECG to edge model

One script per step, with shared settings in a single config file so input length and class names cannot drift apart.

  1. PTB-XL10 s records at 100 Hz, five superclasses
  2. preprocess.pyOfficial folds, normalization
  3. 1D CNNPyTorch, four conv blocks, early stopping
  4. ONNX fp32Exported from PyTorch
  5. ONNX int8Dynamic weight quantization

fp32 against int8

AUC on the 1,246-record held-out set in the repo, thresholds tuned on validation data. Model size is the ONNX file.

ModelMacro-AUCNORMMISTTCCDHYPSize
fp320.8780.9170.8580.9320.9090.7750.427 MB
int80.8780.9170.8580.9320.9080.7750.117 MB

Code and docs

Training, quantization, evaluation and inference scripts, with a demo video in the repo.

github.com/YoussefGaied/ai-night-challenge-EdgeCardio

What it shows

  • int8 is about 73 % smaller than fp32
  • Same macro-AUC to three decimals on this set
  • Hypertrophy is the weakest class (AUC 0.775)

Limits

  • One dataset, so other hospitals and devices are unknown
  • Latency not yet measured on a Raspberry Pi
  • Held-out split to be re-checked against official fold 10

Ludus

Social app for people who train

React Native, Expo, TypeScript, Supabase

  • Share workouts, follow other athletes, comment in nested threads, and keep a profile with training stats, achievements and personal records.
  • Private accounts with follow requests, plus a real-time feed and notifications through Supabase subscriptions.
  • Supabase backend: authentication with persistent sessions, PostgreSQL, storage, realtime and server functions.
  • Built in TypeScript with Expo, React Navigation and Zustand for state, and packaged as an Android APK.
  • tested and used by me and my local gym freinds.
Ludus feed screen with a sample post, sample data
Feed, sample data
Ludus profile screen with training stats and achievements
Profile and records
Ludus comment thread screen, sample data
Comment threads, sample data

Contact me if you want an APK demo.

AR Dish Scanning

A restaurant menu you can see on your table

Next.js, TypeScript, Supabase, Three.js (WebXR), Polycam, Meshy.ai

  • Built with a friend for the restaurant Per Voi, who asked for a QR menu where tapping a dish shows it on the table.
  • The 3D dishes are made with Polycam scans and Meshy.ai generation, then cleaned of mesh artifacts and compressed (WebP textures) into light GLB files.
  • A guest scans the QR code, browses the menu, taps “Voir en AR”, and the dish appears on their table through the phone camera. On Android, Chrome runs a real WebXR AR session with ARCore, on iPhone it opens AR Quick Look, and other devices get an interactive 3D viewer.
  • A full-stack web app: Next.js and TypeScript front end, Supabase for PostgreSQL, authentication, file storage and an admin area for uploading dishes, in French, English and Arabic (right-to-left).
  • Feedback from the restaurant: they want the 3D dishes to look more realistic, which what we are working on right now.

Try it on your phone(demo)

Scan the code, open any dish and tap “Voir en AR”. Tested on Android (Chrome) and iPhone.

pervoi.vercel.app

How it works

A mobile-first Next.js app. Dishes are GLB models loaded with Three.js, which starts a WebXR AR session with ARCore hit-testing on Android. On iPhone it opens AR Quick Look with a USDZ file.

Resume

Preview of Youssef Gaied's CV, page 1

A one-page summary of my education, projects and skills.

PDF, 1 page, in English.

Contact

I’m happy to talk about a project, an opportunity, or how any of the above works.