Skip to content

Commit

Permalink
Version 2 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
justind000 committed Mar 30, 2023
1 parent f81c8e4 commit 5591c72
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 92 deletions.
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ Add the ability to measure ORP to your hardware application with a fully digital
#### Summary ℹ️

* mV range of -2.23 to 2.23
* Accuracy ±0.001 mV
* Resolution 0.001 mV units
* I²C, UART, and USB interfaces
* 1-Wire interface for DS18B20 temperature sensor
* Accuracy ±0.1 mV
* Resolution 0.1 mV units
* I²C interface
* 25x15 mm for castellated or DIP mounting
* Single point calibration

Expand All @@ -32,22 +31,14 @@ Adding a module to your own design is straightforward. You'll need:
2. clean, preferably isolated, power supply
3. probe connection (U.FL, BNC, terminal block)

Some resources to get started:

* [Schematic of the Isolated Dev Board](https://ufire.co/files/isolated_qwiic_dev_board_schematic.pdf)
* Design Incorporation section of the [Datasheet](https://docs.google.com/document/d/1nhQdt0k4pQb8jUJF8Eyrj9TyxYFNImvvaVTNkO53OXs/export?format=pdf)

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

#### Ask a question 🤙
### 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-ORP](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)
11 changes: 6 additions & 5 deletions examples/Basic/Basic.ino
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
/*!
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
[email protected] to get in touch with someone
Mod-ORP hardware version 1, firmware 1
Mod-ORP hardware version 2, firmware 1
*/

#include <uFire_Mod-ORP.h>
uFire::Mod_ORP::i2c orp;
#include <Microfire_Mod-ORP.h>
Microfire::Mod_ORP::i2c orp;

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

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

Expand Down
26 changes: 5 additions & 21 deletions examples/ErrorHandling/ErrorHandling.ino
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*!
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
[email protected] to get in touch with someone
Mod-ORP hardware version 1, firmware 1
Mod-ORP hardware version 2, firmware 1
*/

#include <uFire_Mod-ORP.h>
uFire::Mod_ORP::i2c orp;
#include <Microfire_Mod-ORP.h>
Microfire::Mod_ORP::i2c orp;

void setup()
{
Expand All @@ -23,21 +23,6 @@ void setup()

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

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

// take a pH measurement
orp.measureORP();
switch (orp.status)
Expand All @@ -46,9 +31,8 @@ void loop()
Serial.println(" Error: Module not functioning properly");
break;
case orp.STATUS_NO_ERROR:
Serial.print(orp.mV, 3);
Serial.print(orp.mV);
Serial.println((String)" mV @ " + orp.tempC + "°C");
Serial.println();
break;
}

Expand Down
45 changes: 14 additions & 31 deletions examples/Shell/Shell.ino
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
/*
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-ORP hardware version 2, firmware 1
This allows you to run various functions in a command-line like interface.
Enter:
`config` to see the configuration of the device.
'reset' to reset all the configuration stored in the device
Measure ORP:
`orp`
Single Point Calibration:
sin <calibration solution in pH> <solution temp [25]>
`sin 60.0 t` - Calibrate at 600.0 mV
sin <calibration solution in mV>
`sin 600` - Calibrate at 600.0 mV
Measure Temperature:
temp
Change the I2C address:
i2c 0x0F
*/

#include <Arduino.h>
#include <Wire.h>
#include "uFire_Mod-ORP.h"
#include "Microfire_Mod-ORP.h"

uFire::Mod_ORP::i2c orp;
Microfire::Mod_ORP::i2c orp;

String buffer, cmd, p1, p2;
const int fw_compatible = 1;
const int hw_compatible = 1;
const int hw_compatible = 2;

void config()
{
orp.getDeviceInfo();
Serial.println((String) "uFire Mod-ORP Sensor: " + (orp.connected() ? "connected" : "*disconnected*"));
Serial.println((String) "Microfire Mod-ORP Sensor: " + (orp.connected() ? "connected" : "*disconnected*"));
if (!orp.connected()) return;
if ((orp.fwVersion != fw_compatible) || (orp.hwVersion != hw_compatible))
{
Expand All @@ -52,23 +54,6 @@ void config_reset()
config();
}

void temperature()
{
orp.measureTemp();
switch (orp.status)
{
case orp.STATUS_SYSTEM_ERROR:
Serial.println("Error: no temperature sensor connected");
break;
case orp.STATUS_NO_ERROR:
Serial.print("C|F: ");
Serial.print(orp.tempC);
Serial.print(" | ");
Serial.println(orp.tempF);
break;
}
}

void i2c()
{
uint8_t i2c_address;
Expand Down Expand Up @@ -104,7 +89,7 @@ void measure_orp()
Serial.println("Error: Module not functioning properly");
break;
case orp.STATUS_NO_ERROR:
Serial.print(orp.mV, 3);
Serial.print(orp.mV);
Serial.println((String)" mV");
break;
}
Expand All @@ -128,20 +113,18 @@ void single()

void help()
{
Serial.println(F("List of available commands, parameters separated by spaces, `low 4.0 22.1`, bracketed numbers are defaults if none provided"));
Serial.println(F("List of available commands, parameters separated by spaces"));
Serial.println(F("config -or- c : no parameters : Displays all configuration and system information."));
Serial.println(F("orp : no parameters : Starts an ORP measurement."));
Serial.println(F("i2c : I2C_address : Changes the module's I2C address."));
Serial.println(F("reset -or- r : no parameters : Returns all configuration information to default values."));
Serial.println(F("sin : calibration_mV : Single-point calibration."));
Serial.println(F("temp -or- t : no parameters : Starts a temperature measurement"));
}

void cmd_run()
{
if ((cmd == "conf") || (cmd == "config") || (cmd == "c")) config();
if ((cmd == "reset") || (cmd == "r")) config_reset();
if ((cmd == "temp") || (cmd == "t")) temperature();
if (cmd == "sin") single();
if (cmd == "i2c") i2c();
if (cmd == "orp") measure_orp();
Expand Down
1 change: 0 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ connected KEYWORD2
calibrateSingle KEYWORD2
getDeviceInfo KEYWORD2
measureORP KEYWORD2
measureTemp KEYWORD2
reset KEYWORD2
setDeviceInfo KEYWORD2
setI2CAddress KEYWORD2
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
{
"name": "Microfire LLC",
"email": "[email protected]",
"url": "https://ufire.co",
"url": "https://microfire.co",
"maintainer": true
}
],
"version": "1.0.0",
"version": "2.0.0",
"frameworks": "arduino",
"platforms": "*"
}
8 changes: 4 additions & 4 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Microfire_Mod-ORP
version=1.0.0
version=2.0.0
author=Microfire LLC
maintainer=contact@ufire.co
maintainer=contact@microfire.co
sentence=Add the ability to measure ORP to your hardware application with a fully digital interface.
paragraph=I2C, UART, and USB interfaces, mV range of -2.23 to 2.23, Accuracy ±0.001 mV, Resolution 0.001 mV units
paragraph=I2C interface, mV range of -2.23 to 2.23, Accuracy ±0.1 mV, Resolution 0.1 mV units
category=Sensors
url=https://ufire.co
url=https://microfire.co
architectures=*
21 changes: 11 additions & 10 deletions src/uFire_Mod-ORP.cpp → src/Microfire_Mod-ORP.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "uFire_Mod-ORP.h"
#include "Microfire_Mod-ORP.h"

float uFire::Mod_ORP::i2c::_tempC = -1;
float uFire::Mod_ORP::i2c::_tempF = -1;
float uFire::Mod_ORP::i2c::_mV = -1;
float uFire::Mod_ORP::i2c::_calibrationSingleOffset = -1;
int uFire::Mod_ORP::i2c::_hwVersion = -1;
int uFire::Mod_ORP::i2c::_fwVersion = -1;
int uFire::Mod_ORP::i2c::_status = -1;
float Microfire::Mod_ORP::i2c::_tempC = -1;
float Microfire::Mod_ORP::i2c::_tempF = -1;
float Microfire::Mod_ORP::i2c::_mV = -1;
float Microfire::Mod_ORP::i2c::_calibrationSingleOffset = -1;
int Microfire::Mod_ORP::i2c::_hwVersion = -1;
int Microfire::Mod_ORP::i2c::_fwVersion = -1;
int Microfire::Mod_ORP::i2c::_status = -1;

namespace uFire
namespace Microfire
{
namespace Mod_ORP
{
Expand Down Expand Up @@ -122,7 +122,8 @@ namespace uFire
_tempC = _read_4_bytes(TEMP_C_REGISTER);
if (_tempC == -127.0)
{
_tempF = -127;
_tempF = 0;
_tempC = 0;
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/uFire_Mod-ORP.h → src/Microfire_Mod-ORP.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define TEMP_C_REGISTER 8 /*!< temperature in C register */
#define CALIBRATE_SINGLE_OFFSET_REGISTER 12 /*!< single-point calibration register */

namespace uFire
namespace Microfire
{
namespace Mod_ORP
{
Expand Down Expand Up @@ -73,5 +73,5 @@ namespace uFire
uint8_t _read_byte(uint8_t reg);
};
} // namespace Mod_ORP
} // namespace uFire
} // namespace Microfire
#endif // ifndef Mod_ORP_H

0 comments on commit 5591c72

Please sign in to comment.