Air Purifiers - Arduino: Speed Control a 4pin Fan
by nilnull in Circuits > Arduino
4179 Views, 7 Favorites, 0 Comments
Air Purifiers - Arduino: Speed Control a 4pin Fan
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.
- Arctic 120mm P12 PWM - ACFAN00119A - 5 €
- Alfawise P1 Filter Element for P1 HEPA Desktop Air Purifier - Gray Goose - 11.57€ https://www.gearbest.com/air-purifier/pp_00950328...
- 3.3V 5V 12V Multi Output Voltage - 0.50€ https://www.gearbest.com/air-purifier/pp_00950328...
- NodeMCU V3 Lua - 3€ https://www.gearbest.com/air-purifier/pp_00950328...
- DHT22/DHT11 Digital Temperature and Humidity - 2€
- Rresistor pack - 0.0001€ок
- 12V 2A Power Adapter, for Router (dead router ) - free
- Wood Glue - 2.5€
- Wooden profile - 2/0.5 - 1m X 9prce -6€
- Wooden profile - 4/1- 2m X1prce - 2€
I made a wooden box of wooden profiles. It seemed to me easy and beautiful.
In the end, it was not very accurate. I did it on the kitchen counter. I am not very good with the saw.
I also put paddles on it to take the vibrations and not scratch the furniture.
Way of Connection
Arduin Code
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();
}
Sources
Sources:
https://handyman.dulare.com/client-server-communic...
https://codebender.cc/sketch:177208#PWM_Fan.ino
http://forum.arduino.cc/index.php?topic=18742.15
http://www.beefrankly.org/blog/2011/12/21/read-out...
https://www.picmicrolab.com/arduino-pwm-fan-contro...
http://www.theorycircuit.com/reading-dc-fan-rpm-ar...
https://www.avrfreaks.net/forum/control-pwm-pc-12v...
https://www.instructables.com/id/OPEN-SOURCE-AIR-PURIFIER/