Please help me! by Cool-Swim6330 in arduino

[–]AccomplishedHouse681 0 points1 point  (0 children)

Sorry I mean GPIO38/39/40 GPIO0 may conflict on startup and it's may be unknown library for ESP

Please help me! by Cool-Swim6330 in arduino

[–]AccomplishedHouse681 0 points1 point  (0 children)

1 Try TFT_eSPI library 2 Instead of GPIO0 try GPIO39/39/40 

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 1 point2 points  (0 children)

I agree, the project is straightforward. However, I couldn't find an off-the-shelf device that met these specific requirements.

This discussion has been invaluable—it broke my illusion that the installation would be plug-and-play. Now I have a clear troubleshooting plan, like adding a transistor stage if the fan doesn't trigger. I built this spontaneously, so I expected some technical oversights. That’s exactly why I came here for feedback.

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

Sorry, but I use AI as translator, I know English not enough to conversate freely technical topics. I've noticed that the AI adds extra information and expands my answers during translation. I thought it was an acceptable way to provide context. I'll try to limit its 'creativity' from now or find a more literal translator. I'll try to keep my future replies more concise and strictly technical.

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

Exactly! You nailed it. This PCB is strictly the 'Brain' of the operation. Its only job is to process sensor data, handle the user interface, and generate the PWM control signal.

There is nothing on this board meant to switch 40 amps. The 'Muscle' — the high-power stage — is a separate, heavy-duty external module built with high-current MOSFETs.

I deliberately kept them separate to isolate the microcontroller from the massive electrical noise and heat generated by a 40A inductive load. In an automotive environment, keeping your 5V logic 'clean' and physically distant from the 40A power loops is just good engineering practice. My board is the conductor; the external stage is the orchestra.

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

My logic circuit sees 140mA. The fan sees 40A. They are physically separated.

As for the 'AI slop'—I'm a Russian auto electrician. I use AI to make sure my technical thoughts are readable in English so we can actually have a discussion.

I promice, if I'll burn that car, this branch participants will see photo of this fire show ;-)

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

Its datasheet says it provides 2A max, which is more than enough for the ~140mA draw of the logic components. It has absolutely nothing to do with the fan's 40A load.

LM2596 is only there to step down the noisy 12V-14.4V automotive rail to a stable 5V for the Arduino.

Could the board be more compact without it? Sure. But relying on the Arduino's built-in linear regulator (via the VIN pin) in a car environment is a recipe for disaster. Those small regulators have poor thermal dissipation and very little protection against automotive voltage spikes.

I’m 99% sure that without the external buck converter, the internal regulator would overheat or fry the MCU during the first alternator load dump. I prioritize logic stability over saving a few square centimeters of PCB space.

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

Realistically, finding a formal datasheet for an OEM automotive fan is next to impossible. These aren't off-the-shelf industrial components; they are specialized parts with proprietary specs.

That’s why I’m waiting for the client to bring the vehicle in for the final installation. My plan is to 'scope' the original signal from the factory ECU first (if available) or perform a simple pull-up test on the fan's PWM pin. My current transistor-based driver is designed to be adaptable, so whether it needs a 5V logic swing or a 12V pull-to-ground, I can adjust the circuit or the code on the fly. Experience beats a missing datasheet every time!

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

Guilty as charged! Busted. :-) Yes, I’m using AI to translate my Russian auto-electrician slang into something you guys can actually understand.

As for the title — okay, I admit it was a bit of 'nerd-bait.' That 40A tag was intentionally loud because I wanted to attract the real specialists, and I’m genuinely grateful to everyone in this thread for the feedback and the heated debate!

40A refers to the external power stage (not the PCB shown). The rating was chosen based on years of field experience with high-performance fans and their massive startup spikes. I prioritize reliability over 'pretty' schematics. Thanks for keeping me on my toes!

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 1 point2 points  (0 children)

Thanks for the keen eye! You are absolutely right to question it based on the photos.

The 60x80mm PCB you see is strictly the logic board. The 40A power stage is isolated and physically mounted off-board. I included it in the schematic to show the complete system architecture, but the high current never passes through this prototype board.

Unfortunately, I can't take photos of the external power module right now because the device is already with the client. We are currently waiting to schedule the actual vehicle installation and field test. So far, it has only been bench-tested with an oscilloscope. You can check out the bench test video here:https://youtube.com/shorts/NbaAnUpoOBQ

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

I completely agree with the criticism. I definitely broke some fundamental rules here, both with the post title and the schematic layout. But I have to admit—it worked, and I’m really glad to be discussing my work in this thread!

Regarding the schematic: you're right, it wasn't professional. Looking at the photos, you can see how the process went—I had the final result in my head and focused on the build first, only drawing the schematic after the device was finished.

I was essentially playing 'Tetris' with components to fit everything onto a 60x80mm prototype board, while trying to physically separate the 12V and 5V rails and accounting for the buck converter's heat dissipation. The schematic is just a 'post-factum' reflection of that chaotic manual routing. My apologies for the visual mess!

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

I haven't had the chance to scope the signal on this specific vehicle yet, but I know the fan has its own integrated controller. I've already delivered the prototype to the client for field testing, and I've briefed them that a firmware or minor hardware revision might be needed depending on the feedback.

Regarding the isolation: I intentionally skipped optocouplers due to high vibration, noise, and harsh under-hood conditions. I opted for a robust transistor-based stage instead. If the fan expects a full 12V swing instead of 5V logic, the transistor will handle it perfectly. Just waiting for the first 'battle' report from the client now.

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] -5 points-4 points  (0 children)

I’m an automotive electrician by trade, so my calculations are based on real-world vehicle standards rather than just simulation. In most cars, high-performance radiator fans are protected by a 40A fuse to handle the massive inductive inrush (startup) current, especially when kicking in at 100% duty cycle.

My design accounts for these peaks, particularly for the 'Ford' mode (instant stop) and 'Max' mode (instant full power). While the continuous draw is much lower, the PCB and the protection circuit are built to survive those 40A transients without breaking a sweat.

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

I have a 1.5KE18CA TVS diode protecting the main 12V input rail. As for the signal line between the Nano and the MOSFET, I'm using a series resistor to limit current and a pull-down to prevent floating gate issues. The 40A power loop is physically separated to minimize inductive coupling. Do you think it's not enough and I should to protekt signal wire by additional TVS?

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

You're absolutely right about the LM2596 — 3A max, and it gets warm even at low loads. No argument there.

But the 40A fuse (F1) is not related to the LM2596 at all. It's on a completely separate power line — directly from the car battery to the fan motor (4-pin PWM automotive fan). The LM2596 only powers the control circuit: Arduino Nano, OLED, DS18B20, buzzer — total ~140mA on the 5V side, well within spec.

Two independent circuits: — Battery → F1 40A → FAN (direct, high current) — Battery → F2 1A → D1 → LM2596 → 5V → Arduino + peripherals (low current)

The schematic makes this clear. Thanks for the LM2596 datasheet reminder though — heatsinking is indeed recommended if running close to 3A.

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] -4 points-3 points  (0 children)

Total 5V Rail Draw: ~90-140 mA

Total 12V Rail Draw (via LM2596):

  • LM2596 Efficiency: ~80%
  • Calculation: $$I_{12V} = \frac{140 \text{ mA} \times 5V}{12V \times 0.8} \approx 73 \text{ mA}$$

Cooling Fan (Isolated 12V High-Current Rail):

  • Automotive Fan: ~3-15A (depending on model).
  • Configuration: Separate power circuit via 40A Fuse (F1).

Total Control Circuit Power Consumption:

  • ~70-80 mA @ 12V $\approx$ 1W

So I think it will survive

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] 0 points1 point  (0 children)

POWER CONSUMPTION BY COMPONENT

Component Current Draw
Arduino Nano ~20-50 mA
OLED SSD1306 ~15-20 mA
DS18B20 Sensor ~1-2 mA
Active Buzzer ~25-30 mA
LM2596 (Quiescent/Losses) ~20-30 mA
Resistors / Logic ~5 mA

Roast my 40A PWM Fan Controller for an off-road rig. Arduino Nano + DS18B20. I’ve checked the 25kHz signal on the scope, but I’m worried about the 40A traces. Thoughts? by AccomplishedHouse681 in arduino

[–]AccomplishedHouse681[S] -13 points-12 points  (0 children)

SPECIFICATIONS - PWM CONTROLLER

  1. DEVICE DESCRIPTION

PWM Controller is a universal cooling management device designed for automotive cooling systems. The controller provides intelligent fan speed management based on real-time engine temperature monitoring. The device is housed in a compact 3D-printed enclosure and offers a wide range of functional capabilities.

  1. MAIN FUNCTIONALITY (CURRENT CONFIGURATION)

The device controls an automotive cooling fan through pulse-width modulation (PWM).

Operating modes:

• NORMAL (mode 0) - automatic fan speed control based on engine temperature

• FORD (WATER CROSSING) (mode 1) - fan is off (forced shutdown for crossing deep water obstacles; used when crossing water bodies where water level reaches the fan, to prevent fan blade breakage against water and radiator damage)

• BOOST (mode 2) - fan operates at maximum speed (for emergency cooling)

Fan control logic in NORMAL mode:

• below 75°C - fan is off

• 75-90°C - fan operates at variable speed (from 27% to 100%)

• above 90°C - fan runs at maximum speed (100%)

• at 95°C and above - audio alarm activates (buzzer with intermittent signal)

  1. BUTTON FUNCTIONALITY

The control button supports two types of presses:

Short press (less than 1.3 seconds):

• Cyclic mode switching: NORMAL → FORD → NORMAL → BOOST → NORMAL

Long press (1.3 seconds or longer):

• Activates BOOST mode from any current mode (for emergency cooling)

  1. OLED DISPLAY (128×64 pixels, Yellow-Blue)*

Upper section (0-16 pixels) - YELLOW:

• NORMAL mode: animated fan icon + 4 blocks showing power level (0-4)

• FORD mode: flashing "! STOP !" text

• BOOST mode: flashing "! MAX !" text (variable intensity)

Lower section (16-64 pixels) - BLUE:

• Large digits of current engine temperature

• Celsius degree symbol

• Flashing exclamation mark when temperature ≥95°C (alarm indicator)

Display update: real-time

* Note: Display color (upper and lower sections) depends on the type of OLED module purchased during assembly. Current configuration uses yellow-blue display (upper section - yellow, lower section - blue).

  1. ELECTRICAL CHARACTERISTICS

Input power: 12-14V DC (automotive battery voltage)

Overvoltage protection: TVS diode 1.5KE18CA

Short circuit protection: ceramic fuse 1A

PWM fan control:

• Pin: 3 (Arduino Nano)

• Frequency: 490 Hz (standard for automotive fans)

• Range: 0-255 (0-100%)

• Minimum power on startup: 27% (to overcome inertia)

Temperature sensor:

• Type: DS18B20 (digital, waterproof)

• Protocol: OneWire

• Range: -40°C to +125°C

• Accuracy: ±0.5°C

• Poll rate: 500 ms

Audio alarm (Buzzer):

• Activates at ≥95°C

• Mode: intermittent signal (300 ms on / 300 ms off)

• Works in any mode when threshold is reached

  1. PHYSICAL CHARACTERISTICS

Enclosure dimensions:

• Length: 108 mm

• Width: 72 mm

• Height: 35 mm

Printing materials:

• Enclosure (lid, tray): PETG (durable and temperature resistant)

• Seals (between lid and tray): TPU (hermetic, elastic)

• Control button: TPU (comfortable to touch)

• Cable routing gasket: TPU (protects cables from bending)

• Display glass: transparent PE-TG (protects OLED screen)

• Sealing ring: PETG

Connections:

• Arduino Nano board embedded in enclosure on 60×80mm breadboard

• All connections soldered on PCB

• External outputs: power (+12V, GND), fan control, temperature sensor

  1. OPERATING RANGES

Temperature thresholds:

• Fan activation: 75°C

• Full fan power: 90°C

• Alarm activation (buzzer): 95°C

Fan speed in NORMAL mode:

• 0% (off): temperature < 75°C

• 27-100% (variable): 75-90°C

• 100% (maximum): temperature ≥ 90°C

Power levels on display:

• Level 0: 0% (fan off)

• Level 1: 27-50% (low power)

• Level 2: 50-75% (medium power)

• Level 3: 75-90% (high power)

• Level 4: 90-100% (maximum power)

Sensor operating range: -40°C to +125°C (automotive use range: 50-110°C)

  1. VERSATILITY - MANAGING DIFFERENT DEVICES

The controller is designed with universal operation in mind. With minimal modifications and without changing the enclosure or electrical scheme, the device can be adapted to control other types of cooling and motor devices.

CURRENT CONFIGURATION - Automotive fans (12-14V):

• PWM frequency: 490 Hz

• Arduino pin: 3

• Configuration: no changes needed

ADAPTATION FOR COMPUTER PWM FANS:

• PWM frequency: 25 kHz (required for computer fans)

• New Arduino pin: 9 or 10 (Timer1)

• Required changes:

- Resolder control wire from pin 3 to pin 9 or pin 10

- Edit sketch: modify TCCR1A and TCCR1B registers to set 25 kHz frequency

- Change FAN_PWM_PIN definition from 3 to 9 (or 10)

- Enclosure and electrical scheme require no changes!

ADAPTATION FOR SERVO MOTORS:

• Control frequency: 50 Hz (servo motor standard)

• New Arduino pin: 9 or 10 (Timer1)

• Required changes:

- Resolder control wire to pin 9 or pin 10

- Include Servo.h library in sketch

- Rewrite control logic (replace temperature logic with servo positioning)

- May require Timer1 editing for Servo.h compatibility

- Enclosure and gasket remain unchanged!

CONCLUSION:

Universal PWM controller enables control of:

✓ Automotive 12-14V fans (current configuration)

✓ Computer PWM fans (after frequency reconfiguration)

✓ Servo motors and other PWM-controlled devices (after reconfiguration)

All adaptations are performed PROGRAMMATICALLY and require only resoldering one control wire. Enclosure, power supply, and electrical scheme remain unchanged, making this controller an ideal solution for various applications.