Skip to content

Commit

Permalink
Version 2 Mod-EC hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
justind000 committed Mar 22, 2023
1 parent 0dde3a3 commit d25ef4b
Show file tree
Hide file tree
Showing 11 changed files with 506 additions and 269 deletions.
10 changes: 0 additions & 10 deletions .gitignore

This file was deleted.

27 changes: 9 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
Mod-EC
======

> [Datasheet](https://www.ufire.co/files/isolated_qwiic_dev_board_schematic.pdf) 📜
> [Datasheet](https://docs.google.com/document/d/1tfF-OZBhD1JVnNeXnkn0zgdczgs0994KFTN9oT3JPR4/export?format=pdf) 📜
Add the ability to measure EC to your hardware application with a fully digital interface.

#### Summary ℹ️

* EC range of 0.05 µS/cm to 1 S/cm with appropriate probe
* Accuracy ±0.002  mS/cm
* Resolution 0.001 mS/cm
* EC range of 0.1 mS/cm to 10.0 mS/cm
* Accuracy ±0.02  mS/cm
* Resolution 0.01 mS/cm
* Temperature compensated
* I²C, UART, and USB interfaces
* 1-Wire interface for DS18B20 temperature sensor
* I²C interfaces
* 25x15 mm for castellated or DIP mounting
* Single, dual, and triple point calibration

Expand All @@ -31,26 +30,18 @@ Add the ability to measure EC to your hardware application with a fully digital

Adding a module to your own design is straightforward. You'll need:

1. bus connection to your controlling device (I2C, UART, USB)
1. bus connection to your controlling device
2. clean, preferably isolated, power supply
3. probe connection (U.FL, BNC, terminal block)

Some resources to get started:

* [Schematic of the I2C Isolated Dev Board](https://www.ufire.co/files/isolated_qwiic_dev_board_schematic.pdf)
* Design Incorporation section of the [Datasheet](https://www.ufire.co/files/isolated_qwiic_dev_board_schematic.pdf)

> [Request a custom board](https://docs.google.com/forms/d/e/1FAIpQLSfiCyjnq35GVyaRjVw6HphhNFNmoyi723qlqVLjUhc-TrmvfQ/viewform)
* * *

### Ask a question 🤙

* [Support Request](https://docs.google.com/forms/d/e/1FAIpQLSekGsS88VkVGCOdW58-MLXKEMpZ8m3PTjGt28sdiWZpEqDXPg/viewform)
* [Discord](https://discord.gg/rAnZPdW)
* [[email protected]](mailto:[email protected])

* * *
### Buy One
[Mod-EC](https://ufire.co/buy/)

[Isolated Dev Board](https://ufire.co/buy/) - all the components needed to use the module
### Website
[microfire.co](https://microfire.co)
23 changes: 9 additions & 14 deletions examples/Basic/Basic.ino
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
/*!
ufire.dev for links to documentation, examples, and libraries
microfire.co for links to documentation, examples, and libraries
github.com/u-fire for feature requests, bug reports, and questions
questions@ufire.co to get in touch with someone
questions@microfire.co to get in touch with someone
Mod-EC hardware version 1, firmware 1
Mod-EC hardware version 2, firmware 1
*/

#include <uFire_Mod-EC.h>
uFire::Mod_EC::i2c ec;
#include <Microfire_Mod-EC.h>
Microfire::Mod_EC::i2c ec;

void setup()
{
// start Serial and I2C
Serial.begin(9600);
Wire.begin();

// start the sensor after Wire.begin()
// start the sensor
ec.begin();
}

void loop()
{
// get the temperature of the solution
ec.measureTemp();

// take an EC measurement
ec.measureEC(ec.tempC);
// take an EC measurement
ec.measureEC();

// display the results
Serial.println((String) ec.mS + " mS/cm");
Serial.println((String) ec.tempC + " °C");
Serial.println();

delay(1000);
}
47 changes: 47 additions & 0 deletions examples/BasicDS18B20/BasicDS18B20.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*!
microfire.co for links to documentation, examples, and libraries
github.com/u-fire for feature requests, bug reports, and questions
[email protected] to get in touch with someone
Mod-EC hardware version 2, firmware 1
*/
#include <Microfire_Mod-EC.h>
#include <OneWire.h> // Click here to install the library: http://librarymanager/All#OneWire
#include <DallasTemperature.h> // Click here to install the library: http://librarymanager/All#DallasTemperature

// what pin is the temperature sensor's signal pin connected to?
#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature temp(&oneWire);
Microfire::Mod_EC::i2c ec;

void setup()
{
// start Serial and I2C
Serial.begin(9600);
Wire.begin();

// start the OneWire and Dallas library
temp.begin();

// start the sensor
ec.begin();
}

void loop()
{
// take a temperature measurement
temp.requestTemperatures();
float temp_c = temp.getTempCByIndex(0);

// take an EC measurement
ec.measureEC(temp_c);

// display the results
Serial.println((String) ec.mS + " mS/cm");
Serial.println((String) temp_c + " °C");
Serial.println();

delay(1000);
}
42 changes: 11 additions & 31 deletions examples/ErrorHandling/ErrorHandling.ino
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/*!
ufire.dev for links to documentation, examples, and libraries
microfire.co for links to documentation, examples, and libraries
github.com/u-fire for feature requests, bug reports, and questions
questions@ufire.co to get in touch with someone
questions@microfire.co to get in touch with someone
Mod-EC hardware version 1, firmware 1
Mod-EC hardware version 2, firmware 1
*/

#include <uFire_Mod-EC.h>
uFire::Mod_EC::i2c ec;
#include <Microfire_Mod-EC.h>
Microfire::Mod_EC::i2c ec;

void setup()
{
// start Serial and I2C
Serial.begin(9600);
Wire.begin();

// start the sensor and check for error
if (ec.begin() != true)
{
Serial.println("Error: the sensor isn't connected");
Expand All @@ -23,46 +24,25 @@ void setup()

void loop()
{
// get the temperature of the solution
ec.measureTemp();

// check for errors
if (ec.status)
{
Serial.println("Error:");
switch (ec.status)
{
case ec.STATUS_NO_PROBE_RANGE:
Serial.println(" temperature sensor not connected");
break;

case ec.STATUS_SYSTEM_ERROR:
Serial.println(" temperature sensor not connected or damaged");
break;
}
}

// take an EC measurement
ec.measureEC(ec.tempC);
ec.measureEC();
switch (ec.status)
{
case ec.STATUS_NO_PROBE_RANGE:
Serial.println(" probe not connected or solution out of range");
Serial.println("Error: probe not connected or solution out of range");
break;

case ec.STATUS_SYSTEM_ERROR:
Serial.println(" module not functioning properly");
Serial.println("Error: module not functioning properly");
break;

case ec.STATUS_CONFIG_ERROR:
Serial.println(" parameters to measureEC, or calibration data likely incorrect");
Serial.println("Error: parameters to measureEC, or calibration data incorrect");
break;

case ec.STATUS_NO_ERROR:
// display the results if no error
Serial.println((String) ec.mS + " mS/cm");
Serial.println((String) ec.tempC + " °C");
Serial.println();
break;
}
}
Loading

0 comments on commit d25ef4b

Please sign in to comment.