This project demonstrates a two-part approach to DC motor control, using two separate microcontrollers (MCUs) to handle both speed regulation and measurement.
The first MCU controls the motor speed through Pulse Width Modulation (PWM), adjusting it as needed. The second MCU measures the resulting speed. What makes this setup interesting is that the MCUs communicate without any direct electrical connection.
This is achieved using a custom optical sensing system: an infrared (IR) LED on one side and a phototransistor on the other, with a rotating CD in between. The CD has four evenly spaced holes. As it spins, each hole allows IR light to pass from the LED to the phototransistor, triggering an interrupt on the measuring MCU.

This design eliminates the need for physical wiring between the MCUs, improving system flexibility and reducing potential interference.
Both MCU applications are written in C, ensuring tight integration between hardware and software for accurate motor control.
A video of this project is available, though it was recorded some time ago, so the quality may not be perfect.
Gallery
Here are some pictures taken at the time of project realization.