I have an ESP32 microcontroller that controls a power relay connected to a 12V, 42W fan. The ESP32 itself is 3.3V but the dev board I'm using has an onboard regulator that takes a 5V input.
The fan has a separate wire that will accept a PWM signal in order to control the fan speed. According to the datasheet, it should work with a 3.3V signal directly from the ESP32.
My question is: what do I do about the ground? The ESP32 and the fan are on completely different circuits. Won't I need to connect the fan and microcontroller grounds together for the PWM function to work? If so, do I really want a noisy motor on the same circuit as a microcontroller?