Fan at 100% if Arduino fails?

Hello Is it possible to run a 40mm fan at 100% if the arduino fails in anyway? I have a 3 pin fan here. I'm using a 2n2222 transistor to control it. But I notice one time The arduino which is a 328p uno has locked up on me. I'm looking over the code to see why. But I need some type of measure so if the arduino locks up the fan can run at 100% to keep the small motherboard cool. Not sure how to do something like that. Can someone please help me out?

Joseph

Some kind of watchdog mechanism?

Hi
Do you use this arduino only to control this fan?

It controls the fans and has eithernet for monitoring as well as temperature I'm using a couple of thermistors 10k on them.

Joseph

AWOL what happen to your name man? I did another test. When I powered down the Arduino the fan went to zero speed.

Joseph

So presumably you are driving the 2N2222 from one of the Arduino pins?

The problem is, it's hard to guarantee that the Arduino will crash in a particular way - it could crash with the pin high or low. There are various approaches to doing what you want, but I think it might be better to restart the Arduino automatically after a crash. Look into using the inbuilt watchdog.

It will kind of be hard when This will be over 700 miles away and no one there barely.

Joseph

Hi
Why not supply the fan with the same power supply as the motherboard?

I wanted to have more control over the temperature then what the motherboard has. And Sense I can not change it when I'm not there I can change it remotely. Or let it change itself on it's own. Useally Motherboard doesn't have that much control. It has some but not a lot.

Joseph

Sorry, I'm not following you. Why does that invalidate using the watchdog to restart the crashed Arduino?

I had twice where the Arduino itself froze up on me and couldn't do nothing but hard reset it.

Joseph

What I'm saying is that the Arduino's internal watchdog could have reset it for you:

https://create.arduino.cc/projecthub/rafitc/what-is-watchdog-timer-fffe20

Are we talking at cross-purposes? I'm sorry if I'm failing to express myself clearly.

Oh I'm sorry, I miss understood that. I thought It was a external thing. I have never used a Watchdog before. Thank you I will look into that.

Joseph