Before you start, please make sure you have the following components:

  1. Cricket Wi-Fi module (https://www.thingsonedge.com/)
  2. Soil Moisture Sensor
  3. 6-Way Terminal Block
  4. 2xAAA batteries (either AAA or AA)
  5. AAA batteries pack (either AAA or AA)
  6. 3x Female/Female Jumper Wires

If you are ready let's get started!

Assembly

Solder the 6-way terminal block to the Cricket module. The terminal block makes it easier to play around with cables.

Now you need to connect batteries and the moisture sensor to the Cricket module with the following steps:

A complete assembled device

A complete assembled device

Well done you have successfully assembled the device!

Before you start using the device it needs to be configured in Developer Portal. Please go to the next section.

Connect your device to your Wi-Fi network

In a few steps you will connect your device to the internet over your Wi-Fi network. All you need to do is to activate Cricket's private Wi-Fi hotspot and then open a private web page to pass your Wi-Fi network credentials. Please follow the steps below:

Configure your device

NOTE: new Cricket versions 1.0 (with metal cover) can be configured entirely locally or from the cota.thingsonedge.com service. Also please note dev.thingsonedge.com was replaced with cota.thingsonedge.com with this new Cricket versions.


For the moisture sensor it is recommended to set the following configuration:


Set the following configuration:


More information on how to configure Cricket can be found in the documentation here.

Let's now go and configure your phone to receive data from Cricket.

The device is live and connected to the internet! You can start reading the data from the sensor on your smartphone or any other internet services. Please see the next section as an example.

Using MQTT client on mobile

You can use any preferred MQTT client. However for the completeness for this project let's use IoT MQTT Panel application to receive and visualise data. The Cricket module connects through low-latency Things On Edge MQTT broker (mqtt.thingsonedge.com). You just need to do the following steps:

Please see the screenshots from IoT MQTT Panel below how you can configure the app to receive and visualise the data.


The moisture sensor is already working and sending data over the internet to your smartphone.

The battery level can be monitored via MQTT using dedicated topic /your_cricket_serial_number/batt



Optimise your device to run for years on batteries

You can make your device to run for years on these batteries. You just need to make the following changes:

Open the TOE Developer Portal (https://dev.thingsonedge.com) and set the following configuration:



Battery monitor configuration

In principle the less module communicates to the cloud, the better power saving. The Cricket module requires energy only for either sending an update to the cloud or evaluating values of attached sensors. It is true 0A when is in OFF state.

In practice it can send 10k messages to the cloud using 2xAAA alkaline batteries and more than 15k when used lithium batteries.

In this case the battery monitor configuration is also set to update cloud service when the battery level value changes only. Additionally battery consumption can be reduced by lowering resolution of measuring an analog signal.

The battery value can be calculated as follow:

Vbatt = val * (3.5/256) * 2^Battery divider

where val is reported battery level from MQTT service.

In this case 1.4V indicates low level of the alkaline battery and suggests replacing it, the value reported via MQTT is 13

Vbatt (V) = 13*3.5/256 * 8 = 1.42V

Minimum value for the Cricket is 1.1V.

IO2 analog input configuration

These values reduce resolution of the analog signal and significantly reduce battery consumption, module will reduce time sending new updated values to the Cloud.

Likewise, the analog value can be calculated using the following formula:

IO2 (V) = io2_val*3.5/256 * 2^IO2 Analog Divider

Analog divider of 3 provides resolution approx. 0.1V

Receive and visualise even more data

There is much more you can play with your current device such as reading built-in temperature sensor, read the battery level, and more. Please checkout more information on Things On Edge GitHUB (https://github.com/thingsonedge/cricket).

Feedback

Thank you for taking your time! If you enjoyed building this moisture sensor I would really appreciate if you could spread the word among your peers. If you have any feedback or suggestions how to improve it and make easier for other folks, I would be more than happy to do it. I'm opened for your suggestions.

Many thanks & Enjoy!