EZO Carrier ORP click
EZO Carrier Click - ORP is a compact add-on board suitable for determining a liquid's oxidation/reduction potential in your application. This board features the EZO-ORP™, an ISO 11271 compliant embedded ORP circuit board from Atlas Scientific.
click Product page
Click library
- Author : Stefan Ilic
- Date : Nov 2023.
- Type : UART type
Software Support
We provide a library for the EZO Carrier ORP 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 ORP Click driver.
Standard key functions :
ezocarrierorp_cfg_setup
Config Object Initialization function.
void ezocarrierorp_cfg_setup(ezocarrierorp_cfg_t *cfg)
EZO Carrier ORP configuration object setup function.
EZO Carrier ORP Click configuration object.
Definition: ezocarrierorp.h:177
ezocarrierorp_init
Initialization function.
err_t ezocarrierorp_init(ezocarrierorp_t *ctx, ezocarrierorp_cfg_t *cfg)
EZO Carrier ORP initialization function.
EZO Carrier ORP Click context object.
Definition: ezocarrierorp.h:157
Example key functions :
ezocarrierorp_send_cmd
Send command function.
void ezocarrierorp_send_cmd(ezocarrierorp_t *ctx, uint8_t *cmd)
Send command function.
ezocarrierorp_send_cmd_with_par
Send command function with parameter.
void ezocarrierorp_send_cmd_with_par(ezocarrierorp_t *ctx, uint8_t *cmd, uint8_t *param_buf)
Send command function with parameter.
ezocarrierorp_send_cmd_check
Check the sent command.
void ezocarrierorp_send_cmd_check(ezocarrierorp_t *ctx, uint8_t *cmd)
Check the sent command.
Example Description
This example demonstrates the use of EZO Carrier ORP 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
with a calibration solutio with 225 mV ORP value.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_printf( &logger, "Device status \r\n" );
ezocarrierorp_error_check( error_flag );
log_printf( &logger, "Factory reset \r\n" );
ezocarrierorp_error_check( error_flag );
log_printf( &logger, "Device info \r\n" );
ezocarrierorp_error_check( error_flag );
uint8_t n_cnt = 0;
ezocarrierorp_clear_app_buf( );
ezocarrierorp_process ( &ezocarrierorp );
strcpy( last_reading, app_buf );
log_printf( &logger, "Place the probe into the calibration solution,\r\n" );
log_printf( &logger, "for single-point calibration \r\n" );
Delay_ms( 5000 );
log_printf( &logger, "Waiting for stable readings \r\n" );
while ( n_cnt <= 5 )
{
{
if ( 0 == strstr( app_buf, last_reading ) )
{
n_cnt++;
}
else
{
strcpy( last_reading, app_buf );
n_cnt = 0;
}
}
log_printf( &logger, "- " );
Delay_ms( 1000 );
ezocarrierorp_clear_app_buf( );
}
#define CALIBRATION_VALUE "225"
log_printf( &logger, "\r\n Calibration \r\n" );
ezocarrierorp_error_check( error_flag );
#define DISABLE_CONT_READ "0"
log_printf( &logger, "Disable continuous reading mode \r\n" );
ezocarrierorp_error_check( error_flag );
log_info( &logger, " Application Task " );
}
@ EZOCARRIERORP_OK
Definition: ezocarrierorp.h:202
#define EZOCARRIERORP_CMD_SINGLE_READ
Definition: ezocarrierorp.h:82
#define EZOCARRIERORP_CMD_STATUS
Definition: ezocarrierorp.h:84
#define EZOCARRIERORP_CMD_CONT_READ
Definition: ezocarrierorp.h:71
#define EZOCARRIERORP_CMD_CAL
Definition: ezocarrierorp.h:72
#define EZOCARRIERORP_CMD_DEV_INFO
Definition: ezocarrierorp.h:76
#define EZOCARRIERORP_RSP_READY
Definition: ezocarrierorp.h:97
#define EZOCARRIERORP_CMD_FACTORY
Definition: ezocarrierorp.h:74
#define EZOCARRIERORP_RSP_OK
EZO Carrier ORP response codes.
Definition: ezocarrierorp.h:92
#define EZOCARRIERORP_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: ezocarrierorp.h:132
void application_init(void)
Definition: main.c:90
#define CALIBRATION_VALUE
#define APP_BUFFER_SIZE
Definition: main.c:34
#define DISABLE_CONT_READ
Application Task
Initializes the driver, performs the click default factory reset, and single point calibration
with a calibration solutio with 225 mV ORP value.
{
log_printf( &logger, "Reading... \r\n" );
ezocarrierorp_error_check( error_flag );
Delay_ms( 5000 );
}
void application_task(void)
Definition: main.c:176
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.EZOCarrierORP
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.