Components and supplies
Breadboard (generic)
Through Hole Resistor, 220 kohm
Cup Blade Anemometer
Jumper wires (generic)
RGB Backlight LCD - 16x2
Diymall Voltage Sensor Dc0-25v
DROK Signal Amplifier AD620
Rotary Potentiometer, 10 kohm
Arduino UNO
Tools and machines
Soldering iron (generic)
Project description
Code
Voltage Sensor Code
c_cpp
This is the code you use to calibrate the Flowmeter yourself.
1#include <LiquidCrystal.h> 2 3LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // These are the pins that will be used 4 5// Below are the values of the resistors in the sensor 6float R1=30000; 7float R2=7500; 8 9void setup() 10{ 11 12// This allows the LCD screen to be used 13Serial.begin (9600); 14lcd.begin(16, 2); 15 16 17} 18 19void loop() 20{ 21 22// Reads the sensor value 23int sensorValue = analogRead(A0); 24 25// Equation for the real voltage 26float voltage = ((5*sensorValue*(R1+R2))/(1024*R2)); 27 28 29// Shows voltage on the LCD screen 30Serial.println(voltage); 31lcd.print("V = "); 32lcd.setCursor(0, 1); 33lcd.print(voltage); 34delay(1000); 35lcd.clear(); 36delay(1000); 37 38 39}
Flowmeter Code
c_cpp
11. #include <LiquidCrystal.h> 22. 33. LiquidCrystal lcd(12, 11, 5, 4, 3, 2); 44. // These are the pins that will be used 55. 66. // Below are the values of the resistors in the sensor 77. float R1=30000; 88. 99. float R2=7500; 1010. 1111. void setup() 1212. { 1313. 1414. Serial.begin (9600); 1515. lcd.begin(16, 2); 1616. // This allows the LCD screen to be used 1717. 1818. 1919. } 2020. 2121. void loop() 2222. // Beginning of the loop 2323. { 2424. 2525. int sensorValue = analogRead(A0); 2626. // Reads the sensor value 2727. 2828. float voltage = ((5*sensorValue*(R1+R2))/(1024*R2)); 2929. // Equation for the real voltage 3030. 3131. 3232. //*********************************************************// 3333. // The equation for CFM is a piecewise function of voltage, 3434. // so if statements were used to divide the functions into 3535. // their respective regions below 3636. //*********************************************************// 3737. 3838. 3939. if (voltage > 1) 4040. // First region of the function for large CFM 4141. { 4242. 4343. float cfm = (1.1409*(voltage))*((voltage))+44.258*(voltage); 4444. 4545. Serial.println(cfm); 4646. // Displays CFM 4747. lcd.print("CFM = "); 4848. lcd.setCursor(0, 1); 4949. lcd.print(cfm); 5050. delay(1000); 5151. // 1000 ms delay 5252. lcd.clear(); 5353. // Clears for repeat 5454. delay(1000); 5555. 5656. } 5757. 5858. else if (.01 < voltage < 1) 5959. // Second region for middle to low CFM 6060. { 6161. 6262. float cfm = (40*(voltage)+20); 6363. 6464. Serial.println(cfm); 6565. // Displays CFM 6666. lcd.print("CFM = "); 6767. lcd.setCursor(0, 1); 6868. lcd.print(cfm); 6969. delay(1000); 7070. // 1000 ms delay 7171. lcd.clear(); 7272. // Clears for repeat 7373. delay(1000); 7474. 7575. } 7676. 7777. else 7878. // If fan is not spinning, the CFM will be zero 7979. { 8080. float cfm = 0; 8181. 8282. Serial.println(cfm); 8383. lcd.print("CFM = "); 8484. lcd.setCursor(0, 1); 8585. lcd.print(cfm); 8686. delay(1000); 8787. lcd.clear(); 8888. delay(1000); 8989. } 9090. 9191. 9292. } 93
Voltage Sensor Code
c_cpp
This is the code you use to calibrate the Flowmeter yourself.
1#include <LiquidCrystal.h> 2 3LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // These are the pins that will be used 4 5// Below are the values of the resistors in the sensor 6float R1=30000; 7float R2=7500; 8 9void setup() 10{ 11 12// This allows the LCD screen to be used 13Serial.begin (9600); 14lcd.begin(16, 2); 15 16 17} 18 19void loop() 20{ 21 22// Reads the sensor value 23int sensorValue = analogRead(A0); 24 25// Equation for the real voltage 26float voltage = ((5*sensorValue*(R1+R2))/(1024*R2)); 27 28 29// Shows voltage on the LCD screen 30Serial.println(voltage); 31lcd.print("V = "); 32lcd.setCursor(0, 1); 33lcd.print(voltage); 34delay(1000); 35lcd.clear(); 36delay(1000); 37 38 39}
Flowmeter Code
c_cpp
11. #include <LiquidCrystal.h> 22. 33. LiquidCrystal lcd(12, 4 11, 5, 4, 3, 2); 54. // These are the 6 pins that will be used 75. 86. // Below are the values of the resistors 9 in the sensor 107. float R1=30000; 118. 129. float 13 R2=7500; 1410. 1511. void setup() 1612. { 1713. 1814. Serial.begin 19 (9600); 2015. lcd.begin(16, 2); 2116. 22 // This allows the LCD screen to be used 2317. 2418. 2519. } 2620. 27 2821. void loop() 2922. // 30 Beginning of the loop 3123. { 3224. 3325. int sensorValue = analogRead(A0); 34 3526. // Reads the sensor value 36 3727. 3828. float voltage = ((5*sensorValue*(R1+R2))/(1024*R2)); 3929. 40 // Equation for the real voltage 4130. 4231. 4332. //*********************************************************// 44 4533. // The equation for CFM is a piecewise function of voltage, 4634. // 47 so if statements were used to divide the functions into 4835. // their respective 49 regions below 5036. //*********************************************************// 51 5237. 5338. 5439. if (voltage > 1) 5540. 56 // First region of the function for large CFM 5741. { 5842. 5943. float 60 cfm = (1.1409*(voltage))*((voltage))+44.258*(voltage); 6144. 6245. Serial.println(cfm); 63 6446. // Displays 65 CFM 6647. lcd.print("CFM = "); 6748. lcd.setCursor(0, 1); 6849. lcd.print(cfm); 69 7050. delay(1000); 7151. 72 // 1000 ms delay 7352. lcd.clear(); 7453. 75 // Clears for repeat 7654. delay(1000); 7755. 7856. } 7957. 8058. else 81 if (.01 < voltage < 1) 8259. 83 // Second region for middle to low CFM 8460. { 8561. 8662. float cfm 87 = (40*(voltage)+20); 8863. 8964. Serial.println(cfm); 9065. // 91 Displays CFM 9266. lcd.print("CFM = "); 9367. lcd.setCursor(0, 1); 9468. lcd.print(cfm); 95 9669. delay(1000); 9770. 98 // 1000 ms delay 9971. lcd.clear(); 10072. 101 // Clears for repeat 10273. delay(1000); 10374. 10475. } 10576. 106 10777. else 10878. 109 // If fan is not spinning, the CFM will be zero 11079. { 11180. float cfm 112 = 0; 11381. 11482. Serial.println(cfm); 11583. lcd.print("CFM = "); 116 11784. lcd.setCursor(0, 1); 11885. lcd.print(cfm); 11986. delay(1000); 120 12187. lcd.clear(); 12288. delay(1000); 12389. } 12490. 12591. 126 12792. } 128
Code for Voltage Sensor
c_cpp
This is the code to read the voltage if you want to calibrate it yourself
1 // Below are the values of the resistors in the sensor 2float R1=30000; 3float R2=7500; 4 5void setup() { 6 7Serial.begin (9600); 8 9} 10 11void loop() { 12 13// Reads the sensor value 14int sensorValue = analogRead(A0); 15 16// Equation for the real voltage 17float voltage = ((5*sensorValue*(R1+R2))/(1024*R2)); 18 19// Prints voltage on computer 20Serial.printIn(voltage); 21delay(1000); 22}
Downloadable files
Wiring Diagram
Wiring Diagram
Wiring Diagram
Wiring Diagram
Documentation
Housing STL File
Housing STL File
Fan Blade STL file
Fan Blade STL file
Fan Blade STL file
Fan Blade STL file
Housing STL File
Housing STL File
Comments
Only logged in users can leave comments
Ardunicko
0 Followers
•0 Projects
Table of contents
Intro
9
0