Components and supplies
Grove - Water Atomization v1.0
Seeeduino Nano
Adafruit OLED 128x32
Grove - Temperature & Humidity Sensor (DHT11)
Project description
Code
Grove_Atomizer_direct_test.ino
arduino
1/* This code works with Grove Water Atomization module 2 * It activate the atomizer for 3 seconds and turn it off with a message shown of the statut 3 * Refer to http://Surtrtech.com for more details 4 */ 5 6#define Atomizer A5 //Atomizer EN pin 7 8void setup() { 9 10 Serial.begin(9600); 11 pinMode(Atomizer, OUTPUT); 12 13} 14 15void loop() { 16 17Serial.println("Atomization !!!!"); 18digitalWrite(Atomizer,HIGH); 19delay(3000); 20 21Serial.println("Atomization OFF"); 22digitalWrite(Atomizer,LOW); 23delay(3000); 24 25} 26
Humidifier_Grove_Atomizer_DHT11_OLED.ino
arduino
1/* This code works with Grove Atomizer, DHT11 and OLED ic display 2 * It shows the current temperature and humidity alongside the humidifier statut 3 * It constantly read the ambient humidity and try to keep it at a defined humidity level (here is 70%) 4 * and it activate the humidifer/atomizer everytime it's necessary to do so 5 * Please refer to http://SurtrTech.com for more details 6 */ 7 8#include "DHT.h" //Required libraries for DHT and OLED 9#include <Adafruit_GFX.h> 10#include <Adafruit_SSD1306.h> 11 12#define Atomizer 3 //Atomizer EN pin 13#define DHTpin 2 //DHT signal pin 14#define DHTTYPE DHT11 //you can use DHT 22... 15#define SCREEN_WIDTH 128 // OLED display width, in pixels 16#define SCREEN_HEIGHT 32 // OLED display height, in pixels 17#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) 18 19Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); //Declaring the display name (display) 20 21DHT dht(DHTpin, DHTTYPE); 22 23void setup() { 24 25 Serial.begin(9600); 26 dht.begin(); 27 display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Start the OLED display 28 display.clearDisplay(); 29 display.display(); 30 pinMode(Atomizer, OUTPUT); 31 32} 33 34void loop() { 35 36 float h = dht.readHumidity(); //Reading the humidity/Temperature values, you can calibrate them if you want 37 float t = dht.readTemperature(); //You can add true between those brackets to make it Fahrenheit instead of Celsius 38 39 if(h>=70){ //if the humidity % is equal or above the setpoint (70) the atomizer stops 40 digitalWrite(Atomizer,LOW); 41 42 } 43 44 display.clearDisplay(); 45 display.setTextSize(2); 46 display.setTextColor(WHITE); 47 display.setCursor(0,0); 48 display.print("H "); 49 display.print(h,1); 50 display.print(" %"); 51 52 if(h<70){ //Otherwise it will be on and it will show "On" on the display alongside the current temperature and humidity 53 digitalWrite(Atomizer,HIGH); 54 display.print("On"); 55 } 56 57 display.setCursor(0,19); 58 display.print("T "); 59 display.print(t,1); 60 display.print(" C"); 61 display.display(); 62 delay(1000); 63 64} 65
Grove_Atomizer_direct_test.ino
arduino
1/* This code works with Grove Water Atomization module 2 * It activate the atomizer for 3 seconds and turn it off with a message shown of the statut 3 * Refer to http://Surtrtech.com for more details 4 */ 5 6#define Atomizer A5 //Atomizer EN pin 7 8void setup() { 9 10 Serial.begin(9600); 11 pinMode(Atomizer, OUTPUT); 12 13} 14 15void loop() { 16 17Serial.println("Atomization !!!!"); 18digitalWrite(Atomizer,HIGH); 19delay(3000); 20 21Serial.println("Atomization OFF"); 22digitalWrite(Atomizer,LOW); 23delay(3000); 24 25} 26
Humidifier_Grove_Atomizer_DHT11_OLED.ino
arduino
1/* This code works with Grove Atomizer, DHT11 and OLED ic display 2 * It shows the current temperature and humidity alongside the humidifier statut 3 * It constantly read the ambient humidity and try to keep it at a defined humidity level (here is 70%) 4 * and it activate the humidifer/atomizer everytime it's necessary to do so 5 * Please refer to http://SurtrTech.com for more details 6 */ 7 8#include "DHT.h" //Required libraries for DHT and OLED 9#include <Adafruit_GFX.h> 10#include <Adafruit_SSD1306.h> 11 12#define Atomizer 3 //Atomizer EN pin 13#define DHTpin 2 //DHT signal pin 14#define DHTTYPE DHT11 //you can use DHT 22... 15#define SCREEN_WIDTH 128 // OLED display width, in pixels 16#define SCREEN_HEIGHT 32 // OLED display height, in pixels 17#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) 18 19Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); //Declaring the display name (display) 20 21DHT dht(DHTpin, DHTTYPE); 22 23void setup() { 24 25 Serial.begin(9600); 26 dht.begin(); 27 display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Start the OLED display 28 display.clearDisplay(); 29 display.display(); 30 pinMode(Atomizer, OUTPUT); 31 32} 33 34void loop() { 35 36 float h = dht.readHumidity(); //Reading the humidity/Temperature values, you can calibrate them if you want 37 float t = dht.readTemperature(); //You can add true between those brackets to make it Fahrenheit instead of Celsius 38 39 if(h>=70){ //if the humidity % is equal or above the setpoint (70) the atomizer stops 40 digitalWrite(Atomizer,LOW); 41 42 } 43 44 display.clearDisplay(); 45 display.setTextSize(2); 46 display.setTextColor(WHITE); 47 display.setCursor(0,0); 48 display.print("H "); 49 display.print(h,1); 50 display.print(" %"); 51 52 if(h<70){ //Otherwise it will be on and it will show "On" on the display alongside the current temperature and humidity 53 digitalWrite(Atomizer,HIGH); 54 display.print("On"); 55 } 56 57 display.setCursor(0,19); 58 display.print("T "); 59 display.print(t,1); 60 display.print(" C"); 61 display.display(); 62 delay(1000); 63 64} 65
Downloadable files
Wiring_2
Humidifier wiring
Wiring_2
Wiring_1
Direct Test
Wiring_1
Wiring_2
Humidifier wiring
Wiring_2
Comments
Only logged in users can leave comments
SurtrTech
0 Followers
•0 Projects
0