89d447_a74e41d3281c70bd74cd994a9da6efc4.jpg_srz_125_125_75_22_0.50_1.20_0.00_jpg_srz

BLEBee and SODAQ: The perfect fit!

Hello everyone,

this weekend I received a SODAQ beta board for some testing with the BLEBee and just grabbed some parts from my electronic boxes to create a “Plant Moisture Sensor”.

The part list for this little project is:

  • 1 SODAQ Moja Board
  • 1 BLEBee (http://www.seeedstudio.com/depot/blebee-v100-p-1632.html)
  • 1 Groove Moisture Sensor (http://www.seeedstudio.com/depot/grove-moisture-sensor-p-955.html)
  • 1 Groove Cable (http://www.seeedstudio.com/depot/grove-universal-4-pin-20cm-unbuckled-cable-5-pcs-pack-p-749.html)
  • 1 Lipo Battery
  • 1 Mini USB Cable

The parts are shown in the picture below:

MoistureSensor

I wrote a very little sketch to read the data from the grove moisture sensor and print it out over Serial. Connect the SODAQ board to the PC/MAC and program it using the settings:

  • Board: Arduino Pro or Pro Mini (3.3V 8MHz) w/ ATmega328
  • Serial: The port where the board is attached to 🙂

and program the following sketch to it:

/*
 * BLE SODAQ Moja Moisture Sensor Demo for Arduino 1.0.5
 * v1.0.0 2013-11-17
 * 
 * Copyright (c) 2012-2013 Dr. Michael Kroll
 *
 * Permission is hereby granted, free of charge, to any 
 * person obtaining a copy of this software and associated 
 * documentation files (the "Software"), to deal in the 
 * Software without restriction, including without limitation 
 * the rights to use, copy, modify, merge, publish, distribute, 
 * sublicense, and/or sell copies of the Software, and to 
 * permit persons to whom the Software is furnished to do so, 
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall 
 * be included in all copies or substantial portions of the 
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 
 * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
 * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 
 * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
 * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH 
 * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * http://www.mkroll.mobi
 * http://forum.mkroll.mobi
 */

int sensorPin = A0; // select the input pin sensor
int sensorValue = 0; // variable to store the sensor value
void setup() {
 // Set the BLEBee Baudrate here 
 Serial.begin(9600); 
 Serial.print("Setup... done.");
}
void loop() {
 // read the value from the sensor:
 sensorValue = analogRead(sensorPin); 
 Serial.print("Grove - Moisture Sensor = "); 
 Serial.println(sensorValue);
 delay(2500);
}

After doing so, plug the parts together and turn the SODAQ on and illustrated in the picture below:

MoistureSensorPluggedTogether

Now you can connect to the Moisture Sensor using an iPhone where BLExplr installed on to connect to it. Select the BLEBee:

MS1

MS2

Once connected navigate to the BLEBee service, select the RX characteristic and enable notifications and you will see the text that is sent from the moisture sensor:

MS3

MS4

MS5

 

Since the sensor is measuring the “Air” the data transferred is: “Grove – Moisture Sensor = 0” once you put it into water, the value changed as shown in the picture below. I just put the sensor in a small plastic tray of water to show the difference in the reading.

The first picture shows the reading in air and the second in water:

MS6

MS7

Of course this is a very easy example on how to use the SODAQ Moja together with the BLEBee. I have chosen this example to show the simplicity of using both together (I don’t have any other Groove sensors around, to be honest 😉 ). Setting up the hardware, writing the sketch and even writing this blogpost including taking the photos took me around an hour. Take a look at the SODAQ Kickstarter pages in order to get more information about this nice board: http://www.kickstarter.com/projects/386717175/sodaq-a-lego-like-plug-in-rapid-prototyping-board?ref=live

Have fun,

Michael.

3 Responses to BLEBee and SODAQ: The perfect fit!

  1. Frank Cohen December 30, 2013 at 15:49 #

    Looks like a great project. Thanks for writing this in such an understandable way. -Frank

  2. Teach Grap April 6, 2014 at 13:54 #

    I still do not quite understand how to connect and transmit data information from phone tools to my iphone? Can you help me understand it?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Powered by WordPress. Designed by WooThemes