Ardumotive Arduino Greek Playground
  • Home
    • About us
    • Contact
    • License
  • Arduino
    • Tutorials
    • Workshop
  • Raspberry Pi
  • DIY 3D Printer
  • News
    • Events >
      • Unboxing & Review
    • Blog
The 1st Arduino Playground in Greece - Open Source Hardware

Αισθητήρας Βροχής

Available Languages
Greek
English

Εισαγωγή

Picture
Σε αυτό το tutorial  θα μάθετε πώς να χρησιμοποιείτε τον αισθητήρα βροχής με το  Arduino uno. Οι αισθητήρες βροχής χρησιμοποιούνται για την ανίχνευση του νερού.

Δυνατότητες :
  • Δυνατότητα ρύθμισης της ευαισθησίας
  • Ψηφιακή TTL ή Αναλογική έξοδο 
  • Μέγιστο ρεύμα στην έξοδο 100mA




Τα υλικά που θα χρειαστούμε

Για το tutorial αυτό θα χρειαστούμε:
  • Arduino uno
  • Breadboard
  • Raindrops Sensor module
Picture

Το κύκλωμα

Picture
Οι συνδέσεις είναι αρκετά εύκολες, δείτε την παραπάνω εικόνα με το σχηματικό του κυκλώματος σε breadboard:
  • Συνδέουμε το Vcc pin στο 5 Volts (5V)  του Arduino
  • Συνδέουμε το A0  pin στο pin A0 του Arduino
  • Συνδέουμε το GND pin στη γείωση (GND) του Arduino
  • Συνδέουμε το + pin του αισθητήρα στο + pin της πλακέτας
  • Συνδέουμε το - pin του αισθητήρα στο - pin της πλακέτας

Ο κώδικας

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* 
To test view the output, point a serial monitor such as Putty at your Arduino. 

  - If the Sensor Board has water droplets on it; "case 0" will be activated and " Rain Warning " will be sent to the serial monitor.
  - If the Sensor Board is dry; "case 1" will be activated and " Not Raining " will be sent to the serial monitor. 

*/

// lowest and highest sensor readings:
const int sensorMin = 0;     // sensor minimum
const int sensorMax = 1024;  // sensor maximum

void setup() {
  // initialize serial communication @ 9600 baud:
  Serial.begin(9600);  
}
void loop() {
  // read the sensor on analog A0:
	int sensorReading = analogRead(A0);
  // map the sensor range (four options):
  // ex: 'long int map(long int, long int, long int, long int, long int)'
	int range = map(sensorReading, sensorMin, sensorMax, 0, 3);
  
  // range value:
  switch (range) {
 
 case 0:    // Sensor getting wet
    Serial.println("Rain Warning");
    break;
 case 1:    // Sensor dry 
    Serial.println("Not Raining");
    break;
  }
  delay(1000);  // delay between reads
}
Κατεβάστε τον κώδικα απ' εδώ και ανοίξτε το αρχείο με το Arduino IDE. 
raindrops_sensor_module.zip
File Size: 0 kb
File Type: zip
Download File

Σειριακή οθόνη

Αν ο αισθητήρας είναι στεγνός τότε μας εμφανίζει το παρακάτω μήνυμα 
Picture
Αν ο αισθητήρας είναι βρεγμένος τότε μας εμφανίζει το παρακάτω μήνυμα 
Picture

Συγχαρητήρια!

Picture
Μόλις ολοκληρώσατε άλλο ένα Arduino "How to" tutorial και μάθατε να χρησιμοποιείτε τον αισθητήρα βροχής μαζί με το Arduino. Ελπίζω να σας άρεσε, αν θέλετε μπορείτε να αφήσετε το σχόλιο σας παρακάτω.
Picture

Search Engine

Picture

Licence 

Picture

Help us to grow up!

Picture


Donate us
About us
License
Cookies policy

Visit the biggest Arduino Shop in Greece!

Picture
find us on dwrean.net
find us on Codebender
find us on Instructables
Developed and designed by Vasilakis Michalis Copyright © 2013 Ardumotive All Rights Reserved
All trademarks referenced herein are properties of their
Powered by Create your own unique website with customizable templates.
Design by DivTag Templates