Skip to content

Commit a6d344b

Browse files
committed
Added E31
1 parent a6c6725 commit a6d344b

File tree

5 files changed

+71
-0
lines changed

5 files changed

+71
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Bas on Tech - Capacitive Soil Moisture Sensor
3+
Deze les is onderdeel van de lessen op https://arduino-lessen.nl
4+
5+
(c) Copyright 2020 - Bas van Dijk / Bas on Tech
6+
Deze code en inhoud van de lessen mag zonder schriftelijke toestemming
7+
niet voor commerciele doeleinden worden gebruikt
8+
9+
YouTube: https://www.youtube.com/c/BasOnTechNL
10+
Facebook: https://www.facebook.com/BasOnTechChannel
11+
Instagram: https://www.instagram.com/BasOnTech
12+
Twitter: https://twitter.com/BasOnTech
13+
14+
---------------------------------------------------------------------------
15+
*/
16+
17+
void setup()
18+
{
19+
Serial.begin(9600);
20+
}
21+
22+
void loop()
23+
{
24+
Serial.println(analogRead(A0));
25+
delay(100);
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
Bas on Tech - Capacitive Soil Moisture Sensor 2.0
3+
Deze les is onderdeel van de lessen op https://arduino-lessen.nl
4+
5+
(c) Copyright 2020 - Bas van Dijk / Bas on Tech
6+
Deze code en inhoud van de lessen mag zonder schriftelijke toestemming
7+
niet voor commerciele doeleinden worden gebruikt
8+
9+
YouTube: https://www.youtube.com/c/BasOnTechNL
10+
Facebook: https://www.facebook.com/BasOnTechChannel
11+
Instagram: https://www.instagram.com/BasOnTech
12+
Twitter: https://twitter.com/BasOnTech
13+
14+
---------------------------------------------------------------------------
15+
*/
16+
17+
const int dry = 583; // waarde bij droge sensor
18+
const int wet = 239; // waarde bij sensor in water
19+
20+
void setup()
21+
{
22+
Serial.begin(9600);
23+
}
24+
25+
void loop()
26+
{
27+
int sensorVal = analogRead(A0);
28+
29+
// Sensor loopt van 239 tot 583
30+
// Dit willen we omzetten naar een schaal van 0% tot 100%
31+
// Meer info op: https://www.arduino.cc/reference/en/language/functions/math/map/
32+
int percentageHumididy = map(sensorVal, wet, dry, 100, 0);
33+
34+
Serial.print(percentageHumididy);
35+
Serial.println("%");
36+
37+
delay(100);
38+
}
Binary file not shown.
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Arduino capacitive vochtsensor
2+
Onderdeel van Bas on Tech Nederlandstalige Arduino lessen - Zie https://arduino-lessen.nl
3+
4+
Abonneer je direct op het Bas on Tech YouTube kanaal via http://www.youtube.com/c/BasOnTechNL?sub_confirmation=1
5+
6+
## De schakeling
7+
![alt text](./E31-capacitive-soil-moisture-sensor.png "schakel schema")

0 commit comments

Comments
 (0)