Trybotics Logo

Air Purifiers - Arduino: Speed Control a 4pin Fan

DESCRIPTION

I decided to make my own Air Purifiers.

The project is a basic idea, what can be done with hand tools and as cheap as possible. This is a single-fan filter, in the stores the prices of these devices are very high. I looked at several projects until I make my idea. I decided to buy a filter, not to make a filter (maybe I will make a filter in the next version). I'm using a P1 HEPA system filter. For the fan I use - Arctic 120mm PWM. I decided to do a control with NodeMCU - Arduino. My idea was to make an hourly schedule, when to blow strong and weak. I also added a temperature sensor, as there were free pins on the board. I am also waiting for a Dust Sensor PPD42NJ to see if there is a result of everything I did. The biggest problem is the management of the PWM FAN. It took me a long time to make it work and and also a long time to make it work hard.

Materials used:
Prices are approximate and by memory.

Description:

I made a wooden box of wooden profiles. It seemed to me easy and beautiful.

Description:

3 More Images

In the end, it was not very accurate. I did it on the kitchen counter. I am not very good with the saw.

Description:

I also put paddles on it to take the vibrations and not scratch the furniture.

Description:

Description:

This is the Arduin code

https://github.com/jasenpashov/Arduino-read-out-an...

What I understood based on my practices and on of many attempts

  • The NodeMCU and the fan must have a common GND.
  • I can not achieve the maximum fan speed.
  • The system operates unstable without a 560R resistor. I am not sure whether it is OK with other values.

TEST CODE:


int fanPulse = D3;

int fanControl = D2;

unsigned long pulseDuration;

int p = 0;

void setup() {

Serial.begin(9600);

pinMode(fanPulse, INPUT);

digitalWrite(fanPulse,HIGH);

pinMode(fanControl, OUTPUT); }

void readPulse() {

pulseDuration = pulseIn(fanPulse, LOW);

double frequency = 1000000/pulseDuration;

Serial.print("pulse duration:");

Serial.println(pulseDuration);

Serial.print("time for full rev. (microsec.):");

Serial.println(pulseDuration*2);

Serial.print("freq. (Hz):");

Serial.println(frequency/2);

Serial.print("RPM:");

Serial.println(frequency/2*60);

}

void loop() { analogWrite(fanControl,1200);

delay(5000);

readPulse();

analogWrite(fanControl,200);

delay(5000);

readPulse();

}


YOU MIGHT ALSO LIKE