Moisture Sensor example for WIZwiki-W7500

Dependencies:   mbed

Prerequisite

WIZwiki-W7500 have a SD card slot that can operate in its SPI interface.

This example is to allow SD card File System on WIZwiki-W7500 and updating MP3 files from server to SD card via FTP protocol.

To implement this function, you need a Platform board and Moisture Sensor Module Below are what we used.

  • WIZwiki-W7500 from WIZnet (Platform board and Ethernet I/F board)
  • Mosisture sensor module

Hardware Configuration

WIZwiki-W7500 Pin map

pin map

Moisture Sensor module

VCC, GND, (Analog or Digital pin)

To get sensing data of moisture sensor all you will need is to connect the VCC and GND pins to WIZwiki W7500. Then an Analog pin or a Digital pin of WIZwiki W7500 will receive sensing data from each pin on Moisture sensor module.

moisture sensor module

Analog pin on WIZwiki-W7100 is for reading from Moisture sensor module. This example is using A0 pin.


Software

Analog Pin Initialization

main.cpp

AnalogIn moisture(A0);

Read Moisture sensing data using Analog Read

main.cpp

value = moisture.read();
pc.printf("Moisture reading is %2.2f\n", value);

Caution

This example can read Moisture sensing data//

Files at this revision

API Documentation at this revision

Comitter:
jehoon
Date:
Tue Apr 11 04:50:44 2017 +0000
Parent:
0:b1e8ef4ab78b
Commit message:
use analog read() function

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r b1e8ef4ab78b -r fb003ee6ea2b main.cpp
--- a/main.cpp	Tue Jun 23 06:35:32 2015 +0000
+++ b/main.cpp	Tue Apr 11 04:50:44 2017 +0000
@@ -7,7 +7,7 @@
     float value = 0.0f;
 
     while(1) {
-        value = moisture;
+        value = moisture.read();
         pc.printf("Moisture reading is %2.2f\n", value);
         wait(1.0f);
     }
diff -r b1e8ef4ab78b -r fb003ee6ea2b mbed.bld
--- a/mbed.bld	Tue Jun 23 06:35:32 2015 +0000
+++ b/mbed.bld	Tue Apr 11 04:50:44 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/7cff1c4259d7
\ No newline at end of file
+https://mbed.org/users/mbed_official/code/mbed/builds/856d2700e60b
\ No newline at end of file