Project the circuit for a fan controller

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Hello again.

Ok, so I need to start getting some ideas for the small project, which is big to me due to my inexperience.
The goal is to project and build a small fan controller, using any STM31L0 chip.
It will be used with a RockPro64 board.

The idea is to cool down a NVMe drive I'm using on the RockPro64 board, by monitoring it's surface temperature with an IR temp sensor.

To summarize things, I'll state the parts I have (and want) to work with.

Temp Sensor: GY-906 (MLX90614)
uC: any STM32L0
Fan: Revoltec Air Guard

Initial limitations:
The fan ratings are 12V, 70mA
MLX90614 is 3V or 5V.
The STM32L0 is 1.8V up to 3.6V

So, to start, I want to put this on a small PCB or at least solder all components by hand on a through-hole board.
This said, I think the first thing I think I need to think about is that I need to lower the voltage from 5V or 12V of the RockPro64 to the required voltage for this STM32L0 chip.

What else I should be thinking about?
(maybe I don't need an voltage amplifiers or current amplifers, etc, but we'll see later).

PS:
Maybe this should be moved to the projects section
 
Last edited:

wayneh

Joined Sep 9, 2010
17,496
Seems like a lot horsepower to just control a fan.
Some questions:
Can your fan speed be controlled by PWM? That simplifies things.
Could you possibly provide a PWM signal directly from your RockPro64? Then you wouldn't need the STM31L0.
Are you married to the IR detector? There are many other options that may be less fussy.
 

AnalogKid

Joined Aug 1, 2013
10,987
If all you want is an on-off controller with a little hysteresis, that can be done with one phototransistor and one regular transistor.

ak
 
Last edited:

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Seems like a lot horsepower to just control a fan.
Some questions:
Can your fan speed be controlled by PWM? That simplifies things.
Could you possibly provide a PWM signal directly from your RockPro64? Then you wouldn't need the STM31L0.
Are you married to the IR detector? There are many other options that may be less fussy.
I think it can be PWM controlled. But I'm not 100% sure. But that was my first idea. Control the on time of the fan with a pulse with modulation. That's why I posted the fan brand and model, in case I'm wrong about the possibility of controlling it with PWM.

I'm not married with this IR sensor, but I'm not going to spend more if I have a couple of those here at home.

About the STM32, I know it's too much for the task but it was a way for me to learn a bit about th3 STM32s.

If all you want is an on-off controller with a little hysteresis, that can be done with one phototransistor and one regular transistor.

ak
No, I want to control it depending on temperature. I want to keep the speed of the fan at different levels for different temps.
 

BobaMosfet

Joined Jul 1, 2009
2,110
Hello again.

Ok, so I need to start getting some ideas for the small project, which is big to me due to my inexperience.
The goal is to project and build a small fan controller, using any STM31L0 chip.
It will be used with a RockPro64 board.

The idea is to cool down a NVMe drive I'm using on the RockPro64 board, by monitoring it's surface temperature with an IR temp sensor.

To summarize things, I'll state the parts I have (and want) to work with.

Temp Sensor: GY-906 (MLX90614)
uC: any STM32L0
Fan: Revoltec Air Guard

Initial limitations:
The fan ratings are 12V, 70mA
MLX90614 is 3V or 5V.
The STM32L0 is 1.8V up to 3.6V

So, to start, I want to put this on a small PCB or at least solder all components by hand on a through-hole board.
This said, I think the first thing I think I need to think about is that I need to lower the voltage from 5V or 12V of the RockPro64 to the required voltage for this STM32L0 chip.

What else I should be thinking about?
(maybe I don't need an voltage amplifiers or current amplifers, etc, but we'll see later).

PS:
Maybe this should be moved to the projects section
Title: Understanding Basic Electronics, 1st Ed.
Publisher: The American Radio Relay League
ISBN: 0-87259-398-3
 

wayneh

Joined Sep 9, 2010
17,496
I think it can be PWM controlled. But I'm not 100% sure. But that was my first idea. Control the on time of the fan with a pulse with modulation. That's why I posted the fan brand and model, in case I'm wrong about the possibility of controlling it with PWM.
It appears to be a 3-pin fan and can be PWM controlled.
Related example: https://www.baldengineer.com/pwm-3-pin-pc-fan-arduino.html

I second the suggestion for a contact-based temperature sensor. Save your IR sensors for another project where you actually need them.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Why a non-contact sensor? That introduces problems for no (apparent) benefit. A thermistor attached to the surface would provide a simpler and more reliable temperature.

Here’s a helpful tech note from TI: https://www.ti.com/lit/an/sbaa338/sbaa338.pdf

You can ignore their external ADC bits.
Non-contact? These MLX90614 are non-contact. They are IR.
And I was trying to save the money on more harwdare when I have sensors here I can use. I have no other usage for them.

Title: Understanding Basic Electronics, 1st Ed.
Publisher: The American Radio Relay League
ISBN: 0-87259-398-3
Not sure that helps me to build what I want with the specifications and limitations I have. I'm not going to read an entire book for a tiny project. lol. But thank you for the suggestion.

It appears to be a 3-pin fan and can be PWM controlled.
Related example: https://www.baldengineer.com/pwm-3-pin-pc-fan-arduino.html

I second the suggestion for a contact-based temperature sensor. Save your IR sensors for another project where you actually need them.
Yes, fans are 3 pin. Unfortunately the RockPro64 board doesn't have a header for fans with 3 pins. 2 pins only.

The example you mention uses transistors and an Arduino. I'm not going to use an Arduino for this. If a STM32 chip is overpowered, an Arduino is even more.

In my case, I have a 12V output from RockPro64 board (2 pin fan header) I can use to power my project or I can also use another connection on the board which output 5V. So, this is what I have to start.

If possible, I would like help with what I have. If we start trying to deviate in very different direction, I know this will end in nothing.
I can consider the possibility of using a different sensor, but I don't want to buy too much hardware if I have stuff at home that I can use. The STM32 choice purpose, is to learn. So, let's stick to it. If choosing a different temperature sensor will make huge difference, ok, I can change and buy a new one, but knowing that I don't need big precision, probably this MLX90614 is ok to use. Also, the temperature I want to measure is the temperature of an NVMe drive, so, making contact with the drive which has many live contacts on plain sight, might not be a good idea. That's why I thought about these IR sensors. I can put the sensor like 1cm away and still have good temperature measurement. I don't need precision of 1/10 or 1/100 of a degree celsius. Precision at the unit level is suffice.
 

Ya’akov

Joined Jan 27, 2019
9,072
Non-contact? These MLX90614 are non-contact. They are IR.
And I was trying to save the money on more harwdare when I have sensors here I can use. I have no other usage for them.
A non-contact sensor is not suitable for this application, that's what I was saying. You will not get reliable readings from an IR sensor on a metal drive unless you put something like black tape on the spot. In any case it is the wrong part for the job. A thermistor is dirt cheap and the right part.
 

MisterBill2

Joined Jan 23, 2018
18,177
Right now I am wondering why speed control such a small fan? Unless the system is running on batteries it makes a lot more sense to run the small cooling fan constantly. How much power do the two items being cooled dissipate? AND, what is an NVMe drive that it needs forced air cooling?
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
A non-contact sensor is not suitable for this application, that's what I was saying. You will not get reliable readings from an IR sensor on a metal drive unless you put something like black tape on the spot. In any case it is the wrong part for the job. A thermistor is dirt cheap and the right part.
Ok, I'll buy a thermistor when I buy the microcontroller

Right now I am wondering why speed control such a small fan? Unless the system is running on batteries it makes a lot more sense to run the small cooling fan constantly. How much power do the two items being cooled dissipate? AND, what is an NVMe drive that it needs forced air cooling?
Don't wonder please. It's just because I want to do this and I have the feeling that if we keep questioning my wish, my parts, my goal and everything else, I'm not gonna get anywhere.
I came here to ask help to get in the right direction but instead I get questioned about the choices, the need of doing this, the need of doing that, the reasoning behind this or that, and what really matters is getting behind.

So, at this point, and trying to get back to the post, I'll buy any STM32L0 chip and the thermistor mentioned. This is what I would like to keep the focus on, instead of questioning why to control such small fans, if they need/worth to be controlled, if the drive even needs to be cooled, etc, etc. I can answer this later. But for now, please let's keep the focus on my goal.

So, knowing that I only have the choice of 12V and 5V to power this controller, and that the STM32 can only be powered from 1.8V up to 3.6V, what options do I have to step down the voltage to anything between the require voltages? Would an OpAmp in non-inverting mode with Rf lower than R? be suitable for this?
 

Ya’akov

Joined Jan 27, 2019
9,072

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
Using that part I have forcibly to choose the 5V option to power the controller, right?


Edited:
Are these parts the ones you mentioned:
1619467405521.png

Problem is that I'm not sure I can deal with those in terms of soldering them. I only have a small Ersa iCon Pico station. Not no hot air gun or anything like that!


Edited 2;

I just notice this is a tiny part. 1.5mm X 2mm. I can't use this at home. :0
 
Last edited:

Ya’akov

Joined Jan 27, 2019
9,072
Using that part I have forcibly to choose the 5V option to power the controller, right?


Edited:
Are these parts the ones you mentioned:
View attachment 236865

Problem is that I'm not sure I can deal with those in terms of soldering them. I only have a small Ersa iCon Pico station. Not no hot air gun or anything like that!


Edited 2;

I just notice this is a tiny part. 1.5mm X 2mm. I can't use this at home. :0
There are many equivalent parts. Or, you can just buy a board that already has one on it. Like: this one as an example.
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
There are many equivalent parts. Or, you can just buy a board that already has one on it. Like: this one as an example.

Can you please state the references of the parts you mention? I struggle sometimes to identify the part reference that allow sites (like digikey, for instance) searches to find the part.

Thanks

Edited:
I searched for AMS1117 but nothing relevant came up in Mouser and in Digikey.
I searched for ADS7142 for the thermistor but also this returns single chip results.
 
Last edited:

Ya’akov

Joined Jan 27, 2019
9,072
I don't know all packaging types and their sizes, but something lie 8-MSOP, TO-252, TO-263. Bare with me, if I just said some non-sense!
You can probably handle an SOT223, so I would suggest the AMS1117-3.3V 1619473667261.png
https://components101.com/asset/sites/default/files/component_datasheet/AMS1117 LDO Regulator.pdf

It's not a switching regulator, but you aren't going to be using much current and you are only dropping 1.7V. It's easy to use and cheapish.

On the other hand, given that you aren't so cramped for space, this package: v\https://www.sparkfun.com/products/526 would be fine.

You can get 50 of the SOT223 packages on Amazon for under 8 bucks....
 

Thread Starter

PsySc0rpi0n

Joined Mar 4, 2014
1,755
You can probably handle an SOT223, so I would suggest the AMS1117-3.3V View attachment 236870
https://components101.com/asset/sites/default/files/component_datasheet/AMS1117 LDO Regulator.pdf

It's not a switching regulator, but you aren't going to be using much current and you are only dropping 1.7V. It's easy to use and cheapish.

On the other hand, given that you aren't so cramped for space, this package: v\https://www.sparkfun.com/products/526 would be fine.

You can get 50 of the SOT223 packages on Amazon for under 8 bucks....

The AMS1117 3.3V would be fine if I could find a couple of them in any online shop.
When I search for it in Sparkfun, this is what I get:
https://www.sparkfun.com/search/results?term=ams1117+3.3v

It would be way better than the 3-pin option, yeah, it's quite big and to avoid if possible.
Aren't we supposed to find that AM1117 3.3V on any online shop other than Amazon, ebay, etc, which will take like a month or s to get to me?
 

Ya’akov

Joined Jan 27, 2019
9,072
The AMS1117 3.3V would be fine if I could find a couple of them in any online shop.
When I search for it in Sparkfun, this is what I get:
https://www.sparkfun.com/search/results?term=ams1117+3.3v

It would be way better than the 3-pin option, yeah, it's quite big and to avoid if possible.
Aren't we supposed to find that AM1117 3.3V on any online shop other than Amazon, ebay, etc, which will take like a month or s to get to me?
https://www.amazon.com/AMS1117-3-3V-Voltage-Regulator-AMS1117-3-3V/dp/B00898P4T2/
 
Top