2014年1月12日 星期日

Measuring Soil Moisture

Soil Moisture Sensor can be used to detect the moisture of soil if there is water around the sensor, let the plants in your garden reach out for human help. They can be very easy to use, just insert it into the soil and then read it. With the help of this sensor, we will know soil state.

Soil Moisture Sensor
Reference : Grove Moisture Sensor

Compare of adding the water before and after
 
Dry soil                  Humid soil

Changes in the soil moisture during a three day period
Sensor A : Value from 480 to 310 (-35%)
Sensor B : Value from 380 to 280 (-26%)
Sensor C : Value from 500 to 440 (-12%)

Compare of adding the 100ml water before and after
Sensor A : Value from 310 to 700 (+126%)
Sensor B : Value from 280 to 520 (+86%)
Sensor C : Value from 440 to 700 (+59%)
Add water tool

2014年1月2日 星期四

Arduino UNO + CC3000 WiFi Module

This demo is CC3000 module for the WiFi communication, uses the examples code "EchoServer.ino", it connects to the access point, get a connection with DHCP.

Board : Arduino Uno
Module : CC3000 WiFi Module
On the CC3000 shield, I use the following pin connections.
  • PIN 1 - GD to Arduino GND
  • PIN 2 - VD to Arduino 3.3V
  • PIN 3 - CS to Digital 10
  • PIN 4 - DO(MISO) to Digital 12
  • PIN 5 - DI(MOSI) to Digital 11
  • PIN 6 - CK(CLK) to Digital 13
  • PIN 7 - IQ(IRQ) to Digital 3
  • PIN 8 - EN(VBEN) to Digital 5
Library & Examples code : Adafruit_CC3000 librar

Demo : 

To run the sample sketches, you'll have to edit them to include the SSID and password of your access point.
#define WLAN_SSID     "myNetwork"      // cannot be longer than 32 characters!
#define WLAN_PASS     "myPassword"

Also, make sure that the right wireless security scheme is selected (unsecured, WEP, WPA, or WPA2).
// Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2
#define WLAN_SECURITY   WLAN_SEC_WPA2

Here's a sample of the Serial Monitor output of buildtest.
Hello, CC3000!

Free RAM: 1059

Initializing...
Started AP/SSID scan



Connecting to Steve_AP...Waiting to connect...Connected!
Request DHCP

IP Addr: 192.168.0.109
Netmask: 255.255.255.0
Gateway: 192.168.0.1
DHCPsrv: 192.168.0.1
DNSserv: 168.95.1.1

NOTE: This sketch may cause problems with other sketches
since the .disconnect() function is never called, so the
AP may refuse connection requests from the CC3000 until a
timeout period passes.  This is normal behaviour since
there isn't an obvious moment to disconnect with a server.

Listening for connections...