Skip to article frontmatterSkip to article content

Digiten Water Flow Sensor FL408 with Particle Photons

This the sensor we are going to build in this exercise.

We will need the following hardwares:

  1. Connect the Photon and FL408 Sensor onto the breadboard as shown in the figures.

    • Connect the FL408 sensor as follows.

      FL408 <---> Photon  
      Red    <--------> Vin
      Black  <--------> GND
      Yellow <--------> D2         
  2. Refer to to register the Photon Device with our Particle account.

  3. Flash the script ‘STAPI_1_FL408’ to the Photon. Fill in the mandatory parameters accordingly. You can choose to leave the optional parameters to their default values.

    /*=============================================================================================================================================
    !!! MANDATORY PARAMETERS
    =============================================================================================================================================*/
    // Water sensor digital pin
    String thingDesc = "flow"; //DESCRIBE THE DEPLOYMENT
    int sample_rate = 10 * 1000; // how often you want device to publish where the number in front of a thousand is the seconds you want
    /*=============================================================================================================================================
    OPTIONAL PARAMETERS
    (this parameters only works when it is the first time registration of the device)
    (if the device is already registered, these options are ignored)
    =============================================================================================================================================*/
    //Description of the location
    String foiName = "na"; //THE LOCATION NAME
    String foiDesc = "na";
    //Define the geometry of the location. Geometry types from geojson is accepted. Refer to https://tools.ietf.org/html/rfc7946 for geometry types.
    String locType = "Point";
    String enType = "application/vnd.geo+json";
    //Define the location of the thing. If location is not impt, use [0,0,0] the null island position.
    float coordx = 0.0; //lon/x
    float coordy = 0.0; //lat/y
    float coordz = 0.0; //elv/z
    /*=============================================================================================================================================
    END
    =============================================================================================================================================*/
  4. Refer to to visualize the data on Grafana.