Controlling fan speed with raspberry pi (or similar)

Thread Starter

daddlylonglegs

Joined Jul 15, 2020
4
Hi all,

For some days now I have been searching for a solution for this problem with no avail. It makes it tricky when I am not exactly sure what I am after, so I am hoping some of you fine folk can point me in the right direction.

I am hoping to control a mains powered fan (230V, 0.3A, 63W) that according to the manufacturer can be speed controlled (I have attached a wiring diagram below from the manufacturer). Now the problem is, I would like fan speed to be controlled by a raspberry pi (or some similar device, any suggestions?) as part as an environmental control system. Now I understand it would be simple to use a relay to have the fan turn on and off when need be. However, I need the fan to be constantly running at say 20% capacity and then when needed it would ramp up to say 80% to correct a rise in temperature. It doesn't have to ramp up and down, it could simply jump from 20% to 80% and vice versa.

This signalling would come from the raspberry pi (or similar device) which would be monitoring the environmental condition. So when the pi is told that the temperature has risen above a threshold a signal is produced to ramp up the fan until normal temperature is again met. Once normal is met and we are back within the 'normal' temperature range the fan returns back to 20% speed.

From my limited knowledge, I am guessing the controller need to be the sort that could accept a low voltage input from the pi and then the controller would need to be able to give a high voltage output to control the fan speed.

A guess on how it might work with my limited knowledge: The pi signals and a switch moves to a circuit which allows for 80% fan speed via variable voltage. Then the pi signals again (or stops signalling) and a the switch returns to the normal lower voltage output to achieve 20% speed control.

Does anyone know of any kind of circuitry that could achieve this? Or such a way to achieve such a thing?

Thanks
 

Attachments

Last edited:

Alec_t

Joined Sep 17, 2013
11,739
This article is worth a read. A phase-control method may work for you, but getting down below 30% speed may be a problem. A multi-speed fan motor with a separate winding for each speed might be a better option. Each winding could be selectively switched with a solid-state relay.
 

Thread Starter

daddlylonglegs

Joined Jul 15, 2020
4
Hi Alec,

Thanks for the reply and the information.
After some research I have been thinking of using 2x 2amp variac controllers with a relay swinging between the two. Each can be set to their own speed and can control the fan based on which leg the relay is at.

Now I need to do more research on the raspberry pi to see if they are able to switch a mains relay.

I imagine the circuit running through a DPDT relay to a the first variac which is set to low speed and back to the fan. Then when the pi signals it switches the relay to the other variac which is set to high. Like the attached diagram
 

Attachments

BobTPH

Joined Jun 5, 2013
2,584
Varying the voltage is not the best way to control the speed. You know the light dimmers that go in the wall box to dim your dining room light? That is what Alec is talking About. The active device used is called a triac.. There are optically coupled triacs that can be controlled by a micro. Do some searches and you will find circuits for that.

Bob
 

Thread Starter

daddlylonglegs

Joined Jul 15, 2020
4
Varying the voltage is not the best way to control the speed. You know the light dimmers that go in the wall box to dim your dining room light? That is what Alec is talking About. The active device used is called a triac.. There are optically coupled triacs that can be controlled by a micro. Do some searches and you will find circuits for that.

Bob
I was under the impression that using something like a light dimmer or PWM would lead to the fan humming and eventual motor damage. I may very well be mistaken as I have been literally learning this stuff over the last few days and maybe this humming occurrence doesn't apply to a triac. Ill look into them and read the document supplied by Alec in full when I got time. Thanks!
 

Thread Starter

daddlylonglegs

Joined Jul 15, 2020
4
Alec, thanks for that paper. It was really interesting. I don't understand all the theory presented in the paper. Does it boil down to the fact that my fan is a newer style (bearings) that can handle phase shifting from a triac and the 'pitting' that comes? Whereas others had trouble handing this? Is the humming experienced by others caused by the motor axel being damaged over time and coming of axis?
Will this not happen on my motor?

If so, I suppose it is totally ok to control the speed this way? Pitfalls, however, are the inability to gain a linear change in speed unless a micro is used and that they are slightly less efficient (both totally fine as triacs are inexpensive).

I went ahead and gave it a try, as you suggested Bob, and all went well. On first test, it seems that triacs can indeed control my fan. No humming or disturbance in the fan housing.
Is this completely safe for my fan then? I would hate to go ahead with the triac and find that my motor burns out over time. Especially, since the majority of the time the fan will be sitting at reduced speed.

If all is good, I suppose I now look for a 'smart' triac or whether it is possible for the raspberry pi to control a triac.

Thanks!
 
Last edited:

Alec_t

Joined Sep 17, 2013
11,739
Does it boil down to the fact that my fan is a newer style (bearings) that can handle phase shifting from a triac and the 'pitting' that comes? Whereas others had trouble handing this? Is the humming experienced by others caused by the motor axel being damaged over time and coming of axis?
The fan manufacturer is likely the only one who can answer those questions with certainty.
 

BobTPH

Joined Jun 5, 2013
2,584
I went ahead and gave it a try, as you suggested Bob, and all went well. On first test, it seems that triacs can indeed control my fan. No humming or disturbance in the fan housing.
I expect this is what the manufacturer meant when they said it was speed controllable, but you might want to check with them.

Bob
 
Top