Dual fan controller with temperature monitoring and WiFi.

It all started with the humidity issues that I have behind the furniture. This can be improved by bringing in fresh dry air from outside... so I decided to plug in 2 old case fans and a humidity/temperature sensor. The idea is to monitor the ambient conditions and when the air is dry/warm enough,  ventilate the space behind the furniture.

As I started having fan with the Espressif devices (esp8266 and the newer esp32) I decided to base my board on the esp32 - a dual core cpu. The system shall also be controllable from outside over internet and it should log the measurements performed periodically. I left some options for a RGB status LED and a I2C display.

First things first, the HW I designed in KiCad and ordered in China. Together with the HW design I performed basic tests and simulations in order to validate my chosen design for the fans MOSFET drivers, tacho measurements and the power supply.

KiCad design

After 2-3 iterations I managed to achieve a stable system. One of the main challenges was the tacho measurement where the levels are dependent on the MOSFET drivers output. I finally went with a P-MOSFET solution as the current that the transistors would need to control was quite small. I also chosen to power the DHT sensor and RGB LED with 5V resulting in 3 different voltages on the board.

On the breadboard

The ESP32 is a 3.3V device so all input voltages from the sensors need to be shifted down to this value. I chosen a very simple design based on a signal N-MOSFET. I did perform a series of detailed tast using my oscilloscope for confirming the accuracy of the level shifters.

MOSFET Driver
Output of the TACHO level shifter (3V-12V to 3.3V) 

The quality of the boards I think is ok... although I did find a issue in the layout of the RGB LED. This is not a big problem as I can rework the connection very easily but brings up the need for a second loop in the design process.

JLCPCB board (2$/10 pieces + 23$ DHL)

The assembly part was a little bit difficult because of two problems that I did not expect. The BC5xx transistors have a very small pitch and I put them all the way through the plated through holes. This was a mistake since the solder bridged the pins under the transistor. The other issue is the ESP32 GND pins soldering... they sink a lot of heat! I tried first with a very thin soldering tip but this will not work properly. Using a bigger tip and a little more heat for the GND pins will do the job perfectly.

After assembly I programmed the ESP with a small "Production SW" that allows me to control and measure each device independently. A simple web interface is perfect for the job!

One fan setup
SW Development using VS Code

To be continued...