Skip to content

Repository files navigation

English | 简体中文 | 繁體中文 | 日本語 | Deutsch | 한국어

LibDriver BA234

MISRA API License

The specialized chip BA234 is an integrated circuit chip specifically designed for conductivity signal processing. Combined with metal or ink electrodes, it can be used to measure the conductivity of a solution. This conductivity signal processing chip integrates functions such as probe driving, conductivity signal acquisition, amplification, filtering, temperature compensation, etc. into one, which can greatly reduce the volume of user circuit systems; The chip adopts advanced circuit design and manufacturing processes, which can achieve high-precision conductivity measurement and high reliability; The core can adapt to different conductivity ranges, perform measurements in various application scenarios, and is not easily affected by environmental factors, with stable performance. The chip has a simple interface circuit and digital signal output, which can be easily connected to computers or other digital systems to achieve automated measurement and control.

LibDriver BA234 is a full-featured driver for BA234, launched by LibDriver.It provides TDS reading, conductivity reading, salinity percentage reading, specific gravity reading, temperature reading, water hardness reading and additional features. LibDriver is MISRA compliant.

Table of Contents

Instruction

/src includes LibDriver BA234 source files.

/interface includes LibDriver BA234 UART platform independent template.

/test includes LibDriver BA234 driver test code and this code can test the chip necessary function simply.

/example includes LibDriver BA234 sample code.

/doc includes LibDriver BA234 offline document.

/datasheet includes BA234 datasheet.

/project includes the common Linux and MCU development board sample code. All projects use the shell script to debug the driver and the detail instruction can be found in each project's README.md.

/misra includes the LibDriver MISRA code scanning results.

Install

Reference /interface UART platform independent template and finish your platform UART driver.

Add the /src directory, the interface driver for your platform, and your own drivers to your project, if you want to use the default example drivers, add the /example directory to your project.

Usage

You can refer to the examples in the /example directory to complete your own driver. If you want to use the default programming examples, here's how to use them.

example basic

#include "driver_ba234_basic.h"

uint8_t res;
ba234_data_t data;
uint32_t i;

/* init */
res = ba234_basic_init();
if (res != 0)
{
    return 1;
}

...
    
for (i = 0; i < 3; i++)
{
    /* delay 1000ms */
    ba234_interface_delay_ms(1000);

    /* read */
    res = ba234_basic_read(&data);
    if (res != 0)
    {
        ba234_interface_debug_print("ba234: read failed.\n");
        (void)ba234_basic_deinit();

        return 1;
    }

    /* output */
    ba234_interface_debug_print("ba234: %d/%d.\n", i + 1, 3);
    ba234_interface_debug_print("ba234: tds is %0.1fppm.\n", data.tds_ppm);
    ba234_interface_debug_print("ba234: electrical conductivity is %0.1fus/cm.\n", data.electrical_conductivity_us_cm);
    ba234_interface_debug_print("ba234: salinity percentage is %0.2f%%.\n", data.salinity_percentage);
    ba234_interface_debug_print("ba234: specific gravity is %0.5f.\n", data.specific_gravity);
    ba234_interface_debug_print("ba234: temperature is %0.1fC.\n", data.temperature_degrees_celsius);
    ba234_interface_debug_print("ba234: water hardness is %0.1fppm.\n", data.water_hardness_ppm);
    
    ...
}

...
    
/* deinit */
(void)ba234_basic_deinit();

return 0;

Document

Online documents: https://www.libdriver.com/docs/ba234/index.html.

Offline documents: /doc/html/index.html.

Contributing

Please refer to CONTRIBUTING.md.

License

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

Contact Us

Please send an e-mail to lishifenging@outlook.com.

About

BA234 full-featured driver library for general-purpose MCU and Linux.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages