Categories
Hardware

Water level sensor

The Grove Water Level Sensor is a very accurate sensor that can be helpful in water level sensing applications. It is completely waterproof and uses capacitive pads to detect water levels up to 10cm.

  • Easy to use (Use Grove Connector without soldering)
  • Based on capacitive sensing
  • Waterproof
  • Conformal Coating
  • Corrosion Resistant
  • Detect up to 10cm water levels
  • I2C Interface

More information:
https://www.seeedstudio.com/Grove-Water-Level-Sensor-10CM-p-4443.html

Categories
Hardware

Capacitive fingerprint scanner

The Capacitive Fingerprint Scanner is a small size, low power consumption, high-reliability Arduino fingerprint sensor.

  • Built-in 2KByte storage: support up to 100 fingerprints
  • Powerful self-learning function: the more you use, the more accurate the recognition
  • Selectable security level
  • Small size, low power consumption,10uA for standby mode

More information:
https://www.seeedstudio.com/Grove-Capacitive-Fingerprint-Scanner-p-4363.html

Categories
Tutorial

Remote relay switch

We are creating a simple system that can switch a relay from everywhere, based on a WEMOS D1 mini and a relay shield.

With cloud integration the switch of the relay controlled by the IoT Guru Cloud library, where we will use a simple HTML & JavaScript page with two buttons.

Supplies

WEMOS D1 mini or any other ESP based MCU

WEMOS relay shield or relay

Step 1

Solder and stack the WEMOS D1 mini and the relay shield together like this:

Alternatively you can use any ESP based MCU and relay.

Step 2

If you don’t have already, you need to create a device, a node and a field in our cloud, follow this articles:

If you haven’t installed it yet, install our official Arduino library:

Step 3

To connect with our cloud, you need to gather six identifier:

  • userShortId: the short identifier of you
  • deviceShortId: the short identifier of your device
  • deviceKey: the secret key of your device
  • nodeShortId: the short identifier of your node
  • nodeKey: the secret key of your node
  • fieldName: the name of the field

Step 4

Create a new Arduino sketch, copy-paste the following code and replace the ssid, the password, the userShortId, the deviceShortId, the deviceKey , the nodeShortId and the fieldName with your Wifi credentials and with your gathered values:

#include <IoTGuru.h>

#ifdef ESP8266
  #include <ESP8266WiFi.h>
#endif
#ifdef ESP32
  #include <WiFi.h>
#endif

#define RELAY_PIN         5

/**
 * WiFi parameters.
 */
const char* ssid        = "ssid";
const char* password    = "password";
WiFiClient client;

/**
 * Initialize the connection with the cloud.
 */
String userShortId      = "xxxxxxxxxxxxxxxxxxxxxx";
String deviceShortId    = "yyyyyyyyyyyyyyyyyyyyyy";
String deviceKey        = "zzzzzzzzzzzzzzzzzzzzzz";
IoTGuru iotGuru         = IoTGuru(userShortId, deviceShortId, deviceKey);

/**
 * Constants of the MQTT channel check.
 */
String nodeShortId      = "nnnnnnnnnnnnnnnnnnnnnn";
String fieldName        = "relay";

void setup() {
    Serial.begin(115200);
    delay(10);

    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(50);
        Serial.print(".");
    }
    Serial.println("");

    /**
     * Set the relay pin.
     */
    pinMode(RELAY_PIN, OUTPUT);

    iotGuru.setCallback(&callback);
    iotGuru.setDebugPrinter(&Serial);
    iotGuru.setNetworkClient(&client);
}

void loop() {
    iotGuru.loop();
    delay(10);
}

void callback(const char* cbNodeShortId, const char* cbFieldName, const char* message) {
    Serial.print(cbNodeShortId);Serial.print(" - ");Serial.print(cbFieldName);Serial.print(": ");Serial.println(message);

    if (strcmp(cbNodeShortId, nodeShortId.c_str()) == 0) {
        if (strcmp(cbFieldName, fieldName.c_str()) == 0) {
            if (strcmp(message, "0") == 0) {
                Serial.println("Switch relay to LOW");
                digitalWrite(RELAY_PIN, LOW);
            } else {
                Serial.println("Switch relay to HIGH");
                digitalWrite(RELAY_PIN, HIGH);
            }
        }
    }
}

Step 5

Plug your WEMOS D1 mini to your computer with an USB cable, compile the code you’ve edited above and upload it to your WEMOS D1 mini. Check the Serial console about the connection messages.

Step 6

Create a HTML page on your computer or your webserver and copy-paste the following snippet into the body tag; replace the nnn..nnn with your nodeKey value:

<center>
  <button id="mqttOn" name="mqttOn" value="ON">ON</button>
  <button id="mqttOff" name="mqttOff" value="OFF">OFF</button>
  <hr/>
</center>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<script>
    $("#mqttOn").click(function(){
        $.ajax({url: "https://api.iotguru.live/mqtt/send/nnnnnnnnnnnnnnnnnnnnnn/relay/1"});
    });
    $("#mqttOff").click(function(){
        $.ajax({url: "https://api.iotguru.live/mqtt/send/nnnnnnnnnnnnnnnnnnnnnn/relay/0"});
    });
</script>

If you have reached this point, pressing the ON and OFF buttons will turn the relay on and off.

Categories
Hardware

Doppler Radar Motion Sensor

MW0582TR11 – 5.8GHz Microwave Doppler Radar Motion Sensor is a microwave Doppler radar that has a frequency of 5.8GHz. This microwave sensor has high sensitivity and precision and it can be used in some industrial and light controlling applications. 

  • Power supply: 5V
  • Current consumption: 40~70mA
  • Radiated Power: -30~7dBm(Adjustable by software)
  • Frequency Setting: 5.725~5.875GHz(Adjustable by software)
  • Receive Sensitivity: -60dBm
  • Dimension: 39×22.5×1(mm)

More information:
https://www.seeedstudio.com/MW0581TR11-5-8GHz-Microwave-Doppler-Radar-Motion-Sensor-p-4366.html

Categories
Hardware

PIR Motion Sensor

PIR(Passive Infrared Detection)are used to detect motion of human movement.

  • Long-range
  • Wide-angle
  • Low consumption
  • DC 3.0-5.5V power supplier

More information:
https://www.seeedstudio.com/PIR-Motion-Sensor-Large-Lens-version.html

Categories
Hardware

Wio Terminal

Compatible with Arduino and MicroPython, Wio Terminal is an ATSAMD51-based microcontroller with wireless connectivity supported by Realtek RTL8720DN.

  • Powerful MCU: Microchip ATSAMD51P19 with ARM Cortex-M4F core running at 120MHz
  • Reliable Wireless Connectivity: Equipped with Realtek RTL8720DN, dual-band 2.4Ghz / 5Ghz Wi-Fi
  • Highly Integrated Design: 2.4” LCD Screen, IMU and more practical add-ons housed in a compact enclosure with built-in magnets & mounting holes
  • Raspberry Pi 40-pin Compatible GPIO
  • Compatible with over 300 plug&play Grove modules to explore with IoT
  • USB OTG Support
  • Support Arduino, CircuitPython, Micropython, ArduPy, AT Firmware, Visual Studio Code
  • TELEC certificated

More information:
https://www.seeedstudio.com/Wio-Terminal-p-4509.html

Categories
Hardware

4.2inch e-Ink display

This is an E-Ink raw display, 4.2inch, 400×300 resolution, with embedded controller, communicating via SPI interface, supports red, black, and white three-color display.

Due to the advantages like ultra low power consumption, wide viewing angle, clear display without electricity, it is an ideal choice for applications such as shelf label, industrial instrument, and so on.

  • No backlight, keeps displaying last content for a long time even when power down
  • Ultra low power consumption, basically power is only required for refreshing
  • Comes with development resources and manual (driver board schematic, examples for Raspberry Pi/Arduino/STM32)

More information:
https://www.seeedstudio.com/4-2inch-E-Ink-raw-display-three-color-e-paper-black-white-red.html

Categories
Example Tutorial

OTA firmware update

Simple and easy Over-The-Air firmware update for any ESP8266/ESP32 MCU with cloud storage? This is it! 🙂

Step 1

If you don’t have already a device, you need to create a device in our cloud, follow this article: tutorials/devices

Install our official Arduino library: ArduinoIDE integration

Step 2

To connect with the cloud, you need to gather three identifier:

  • userShortId: the short identifier of you
  • deviceShortId: the short identifier of your device
  • deviceKey: the secret key of your device

Step 3

Create a new Arduino sketch, copy-paste the following code and replace the ssid, the password, the userShortId, the deviceShortId and the deviceKey with your Wifi credentials and your device’s values:

#include <IoTGuru.h>

#ifdef ESP8266
  #include <ESP8266WiFi.h>
#endif
#ifdef ESP32
  #include <WiFi.h>
#endif

const char* ssid        = "ssid";
const char* password    = "password";

const char* ota_version = "example-1.0.0";

String userShortId      = "xxxxxxxxxxxxxxxxxxxxxx";
String deviceShortId    = "yyyyyyyyyyyyyyyyyyyyyy";
String deviceKey        = "zzzzzzzzzzzzzzzzzzzzzz";
IoTGuru iotGuru         = IoTGuru(userShortId, deviceShortId, deviceKey);

WiFiClient client;

void setup() {
    Serial.begin(115200);
    delay(10);

    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(50);
        Serial.print(".");
    }
    Serial.println("");

    iotGuru.setCheckDuration(60000);
    iotGuru.setDebugPrinter(&Serial);
    iotGuru.setNetworkClient(&client);

    iotGuru.firmwareUpdate(ota_version);
}

void loop() {
    if (iotGuru.check(ota_version)) {
        ESP.restart();
    }
}

Step 4

Compile the sketch and put it to the device with the old common way., the first firmware installation is inevitable. Also, you need to find the compiled firmware binary, but it is an easy task:

  1. Sketch - Export compiled Binary (Ctrl-Alt-S)
  2. Sketch - Show Sketch Folder (Ctrl-K)

Step 5

Upload the firmware binary to your Firmware storage:

Step 6

Set the Device firmware version field of your device:

Step 7

Your device will periodically check to see if its own version and the set version match; if so, then nothing will happen. If the two versions are different, it will reboot and update itself to what you specified in the Device firmware version field.

6288: {check(ota_version):72} - ENTRY
6292: {check(ota_version):75} - Send request to the cloud: http://api.iotguru.live/firmware/check/xxxxxxxxxxxxxxxxxxxxxx/example-1.0.0
6402: {check(ota_version):84} - Response received from the cloud (status code 304)
6402: {check(ota_version):86} - EXIT

Categories
Hardware

3D Gesture Shield

This shield is based on Microchip MGC3130 chip, which enables the Raspberry Pi with 3D gesture recognition and motion tracking function.

  • Recognition of 3D Hand Gestures and x, y, z Positional Data
  • Proximity and Touch Sensing
  • Built-in Colibri Gesture Suite (running on chip)
  • Advanced 3D Signal Processing Unit
  • Detection Range: 0 to 10 cm
  • On-chip Auto Calibration
  • Compatible with various models of Raspberry Pi 2,3,4

More information:
https://www.seeedstudio.com/3D-Gesture-Tracking-Shield-for-Raspberry-Pi-MGC3130-p-4073.html

Categories
Hardware

Raspberry Pi Wide Angle Camera Module

Raspberry Pi Wide Angle Camera Module is a low-cost Fisheye Lens, wider Field View,Camera module, designed for Raspberry Pi.

  • Fisheye Lens, offers wider field of view
  • 5 megapixel OV5647 sensor
  • Aperture (F) : 2.35
  • Diagonal angle : 160 degree
  • Horizontal angle : 132 degree
  • Sensor best resolution : 1080p

More information:
https://www.seeedstudio.com/Raspberry-Pi-Wide-Angle-Camera-Module.html