TOP Contributors

  1. MIKROE (2781 codes)
  2. Alcides Ramos (377 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139584 times)
  2. FAT32 Library (72044 times)
  3. Network Ethernet Library (57269 times)
  4. USB Device Library (47633 times)
  5. Network WiFi Library (43231 times)
  6. FT800 Library (42569 times)
  7. GSM click (29933 times)
  8. mikroSDK (28313 times)
  9. PID Library (26934 times)
  10. microSD click (26309 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

EZO Carrier EC Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: Environmental

Downloaded: 60 times

Not followed.

License: MIT license  

EZO Carrier Click - Conductivity is a compact add-on board for measuring conductivity, salinity, and Total Dissolved Solids (TDS) in various applications from chemical production to hydroponics. This board features the EZO-EC™, an ISO 7888 compliant embedded conductivity circuit board from Atlas Scientific.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "EZO Carrier EC Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "EZO Carrier EC Click" changes.

Do you want to report abuse regarding "EZO Carrier EC Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


EZO Carrier EC Click

EZO Carrier Click - Conductivity is a compact add-on board for measuring conductivity, salinity, and Total Dissolved Solids (TDS) in various applications from chemical production to hydroponics. This board features the EZO-EC™, an ISO 7888 compliant embedded conductivity circuit board from Atlas Scientific.

ezocarrierec_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Oct 2023.
  • Type : UART type

Software Support

We provide a library for the EZO Carrier EC Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for EZO Carrier EC Click driver.

Standard key functions :

  • ezocarrierec_cfg_setup Config Object Initialization function.

    void ezocarrierec_cfg_setup ( ezocarrierec_cfg_t *cfg );
  • ezocarrierec_init Initialization function.

    err_t ezocarrierec_init ( ezocarrierec_t *ctx, ezocarrierec_cfg_t *cfg );

Example key functions :

  • ezocarrierec_send_cmd Send command function.

    void ezocarrierec_send_cmd ( ezocarrierec_t *ctx, uint8_t *cmd );
  • ezocarrierec_send_cmd_with_par Send command function with parameter.

    void ezocarrierec_send_cmd_with_par ( ezocarrierec_t *ctx, uint8_t *cmd, uint8_t *param_buf );
  • ezocarrierec_send_cmd_check Check the sent command.

    void ezocarrierec_send_cmd_check ( ezocarrierec_t *ctx, uint8_t *cmd );

Example Description

This example demonstrates the use of EZO Carrier EC Click board by processing the incoming data and displaying them on the USB UART.

The demo application is composed of two sections :

Application Init

Initializes the driver, performs the Click default factory reset, and single point calibration.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    ezocarrierec_cfg_t ezocarrierec_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    ezocarrierec_cfg_setup( &ezocarrierec_cfg );
    EZOCARRIEREC_MAP_MIKROBUS( ezocarrierec_cfg, MIKROBUS_1 );
    if ( UART_ERROR == ezocarrierec_init( &ezocarrierec, &ezocarrierec_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    log_printf( &logger, "Device status \r\n" );
    ezocarrierec_send_cmd( &ezocarrierec, EZOCARRIEREC_CMD_STATUS );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_OK );
    ezocarrierec_error_check( error_flag );

    log_printf( &logger, "Factory reset \r\n" );
    ezocarrierec_send_cmd( &ezocarrierec, EZOCARRIEREC_CMD_FACTORY );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_READY );
    ezocarrierec_error_check( error_flag );

    #define PROBE_TYPE   "1.0"
    log_printf( &logger, "Seting Probe type \r\n" );
    ezocarrierec_send_cmd_with_par( &ezocarrierec, EZOCARRIEREC_CMD_SET_PROBE_TYPE, PROBE_TYPE );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_OK );
    ezocarrierec_error_check( error_flag );

    log_printf( &logger, "Device info \r\n" );
    ezocarrierec_send_cmd( &ezocarrierec, EZOCARRIEREC_CMD_DEV_INFO );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_OK );
    ezocarrierec_error_check( error_flag );

    #define DRY_CALIBRATION   "dry"
    log_printf( &logger, "Dry calibration \r\n" );
    ezocarrierec_send_cmd_with_par( &ezocarrierec, EZOCARRIEREC_CMD_CAL, DRY_CALIBRATION );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_OK );
    ezocarrierec_error_check( error_flag );

    uint8_t n_cnt = 0;
    uint8_t last_reading[ APP_BUFFER_SIZE ] = { 0 };
    ezocarrierec_clear_app_buf( );
    ezocarrierec_send_cmd( &ezocarrierec, EZOCARRIEREC_CMD_SINGLE_READ );
    ezocarrierec_process ( &ezocarrierec );
    strcpy( last_reading, app_buf );
    log_printf( &logger, "Single point calibration \r\n" );
    log_printf( &logger, "Waiting for stable readings \r\n" );
    while ( n_cnt <= 5 )
    {
        if ( EZOCARRIEREC_OK == ezocarrierec_process ( &ezocarrierec ) )
        {  
            if ( 0 == strstr( app_buf, last_reading ) )
            {
                n_cnt++;
            }
            else
            {
                strcpy( last_reading, app_buf );
                n_cnt = 0;
            }
        }
        log_printf( &logger, "- " );
        Delay_ms ( 1000 );
        ezocarrierec_clear_app_buf( );
    }
    #define CALIBRATION_VALUE   "80"
    log_printf( &logger, "Calibration \r\n" );
    ezocarrierec_send_cmd_with_par( &ezocarrierec, EZOCARRIEREC_CMD_CAL, CALIBRATION_VALUE );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_OK );
    ezocarrierec_error_check( error_flag );

    #define DISABLE_CONT_READ   "0"
    log_printf( &logger, "Disable continuous reading mode \r\n" );
    ezocarrierec_send_cmd_with_par( &ezocarrierec, EZOCARRIEREC_CMD_CONT_READ, DISABLE_CONT_READ );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_OK );
    ezocarrierec_error_check( error_flag );

    log_info( &logger, " Application Task " );
}

Application Task

Reads and processes all incoming conductivity data from the probe, and displays them on the USB UART in uS.

void application_task ( void ) 
{
    log_printf( &logger, "Reading... \r\n" );
    ezocarrierec_send_cmd( &ezocarrierec, EZOCARRIEREC_CMD_SINGLE_READ );
    error_flag = ezocarrierec_rsp_check( &ezocarrierec, EZOCARRIEREC_RSP_OK );
    ezocarrierec_error_check( error_flag );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.EZOCarrierEC

Additional notes and informations

Depending on the development board you are using, you may need USB UART Click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

RNG click

5

RNG Click is a random number generator is a device that generates a sequence of numbers or symbols that cannot be reasonably predicted better than by a random chance. This Click board is true hardware random-number generator , which generate genuinely random numbers.

[Learn More]

Voltmeter click

2

Voltmeter click is a mikroBUS add-on board for measuring voltage in an external electric circuit. The board is designed to measure Direct Current only, and has a measurement range is from 0 to 24V (it’s possible to measure both positive and negative charges).

[Learn More]

IoT ExpressLink 2 Click

0

IoT ExpressLink 2 Click is a compact add-on board that allows users to connect to IoT ExpressLink services easily and securely interact with cloud applications and other services. This board features the SARA-R510AWS, an LTE-M AWS IoT EsxpressLink module from u-blox. It supports a comprehensive set of 3GPP Rel. 14 features that are relevant for IoT applications, like improvements to power consumption, coverage, data rate, mobility, and positioning. They are 5G-ready, meaning customers will be able to (software) upgrade their deployed devices once 5G LTE has been fully rolled out by mobile operators, greatly improving end-product scalability and lifetime.

[Learn More]