ESP32 temperature-controlled fan: DS18B20 and a MOSFET
Open in the lab ▸Make my own copy
A DS18B20 probe reads the temperature every 2 s and the ESP32 sets the fan speed with 25 kHz PWM through a logic-level MOSFET: off below 26 °C, rising to full at 34 °C, and full speed if the probe stops answering. A diode across the fan catches its kick when the MOSFET turns off. Open it and press Run: the sketch is inside the board (click the board, then Code). Every part, pin and resistor matches what you would build on a real breadboard; the guided build of the same name has the test sheet and hidden faults.
What is on the bench
11 parts, 19 wires, with a sketch (the program runs in the lab). Boards: ESP32 DevKit.
| Resistor | 3 |
|---|---|
| Bench power supply | 1 |
| ESP32 DevKit | 1 |
| USB charger / port | 1 |
| DS18B20 temperature sensor | 1 |
| N-channel MOSFET | 1 |
| DC motor | 1 |
| Signal diode | 1 |
Put it on your page
The project runs live inside the frame: readers can press buttons, turn knobs and read the meters.
<iframe src="https://zencircuitlab.com/embed/zclcfan" width="100%" height="560" style="border:1px solid #2f363a;border-radius:10px" loading="lazy" title="ESP32 temperature-controlled fan: DS18B20 and a MOSFET on Zen Circuit Lab"></iframe>
Link
https://zencircuitlab.com/p/zclcfan
Published by its author under the lab's community terms: it may be opened, copied and changed by anyone. Simulation results are for learning; check a real build against the parts' datasheets.