- ezoph ⇒
numberLike
Communicate with the EZO pH device and sensor
- mh_z16 ⇒
number
Make a new instance of the MH_Z16 sensor with SC16IS750PW I2C/UART bridge
- max38155k
Communicate with the MAX38155k device and sensor
- numberLike :
number
|string
A number, or a string containing a number.
- pin :
Object
A number, or a string containing a number.
ezoph ⇒ numberLike
Communicate with the EZO pH device and sensor
Returns: numberLike
- value - the output of the device. this can be anything from the pH to the current status of the device.
Properties
Name | Type | Description |
---|---|---|
i2c | Object |
an i2c object |
address | number |
address of the device |
ph | numberLike |
the last pH value read |
timeout | number |
the time taken to carry out operation, in ms. defaults to 900, the longest time needed for any operation. |
This is 'exported' so it can be used with require('ezoph.js').connect(pin1,pin2)
Kind: static method of ezoph
Example (How to use ezoph module)
//create a new instance of ph sensor
var i2c = new I2C(); // create new i2c object
var phAddress = 0x63; // EZO pH i2c address
var sda = D23; // setup i2c pins
var scl = D22;
i2c.setup({ // setup I2C bus
scl:scl,
sda:sda
});
phSensor = new ( require('ezoph') )( i2c, phAddress );
ezoph~ezoph/read() ⇒ numberLike
Reads ph
Kind: inner method of ezoph
Returns: numberLike
- data - value returned from device
ezoph~ezoph/calMid() ⇒ numberLike
Single point calibration at midpoint
Kind: inner method of ezoph
Returns: numberLike
- data - 1 if successful 2,254,255 if unsuccessful
ezoph~ezoph/calLow() ⇒ numberLike
Two point calibration at low point
Kind: inner method of ezoph
Returns: numberLike
- data - 1 if successful, 2,254,255 if unsuccessful
ezoph~ezoph/calHigh() ⇒ numberLike
Three point calibration at high point
Kind: inner method of ezoph
Returns: numberLike
- data - 1 if successful, 2,254,255 if unsuccessful
ezoph~ezoph/command(callback, comm) ⇒ numberLike
Sends specific command to ezo ph circuit
Kind: inner method of ezoph
Returns: numberLike
- data - 1 if successful, 2,254,255 if unsuccessful
Param | Type | Description |
---|---|---|
callback | function |
|
comm | numberLike |
command to send to circuit, ie. 'sleep', or 'i' |
Clears the command and data arrays (used before sending a new command)
Kind: inner method of ezoph
Read a command as a string
Kind: inner method of ezoph
Param | Type | Description |
---|---|---|
comm | numberLike |
the command that the device will carry out |
Retreive data from device
Kind: inner method of ezoph
Param | Type | Description |
---|---|---|
callback | function |
value of the data reived from device |
timeout | int |
the amount of time needed for the device to complete function. minimum is 900 |
Make a new instance of the MH_Z16 sensor with SC16IS750PW I2C/UART bridge
Returns: number
- - the co2 concentration measured by the device
Param | Type | Description |
---|---|---|
i2c | Object |
an instance of an I2C object |
address | number |
the address of device (default is 0x9a) |
Properties
Name | Type | Description |
---|---|---|
ppm | number |
the last measured co2 concentration (can be used for debug) |
- mh_z16 ⇒
number
- static
- inner
- ~mh_z16/begin()
- ~mh_z16/calZero()
- ~mh_z16/send(data)
- ~mh_z16/parse(data) ⇒
Array
- ~resultCallback ⇒
number
- ~resultCallback :
function
This is 'exported' so it can be used with require('mh_z16.js').connect(pin1,pin2)
Kind: static method of mh_z16
Example (How to use mh_z16 module)
//create a new instance of ph sensor
var i2c = new I2C(); // create new i2c object
var co2Address = 0x47; // EZO pH i2c address
var sda = D23; // setup i2c pins
var scl = D22;
i2c.setup({ // setup I2C bus
scl:scl,
sda:sda
});
phSensor = new ( require('mh_z16') )( i2c, co2Address );
Initializes the mh_z16 sensor
Kind: inner method of mh_z16
Calibrate the zero level for ppm Must be done in normal air ~ 400ppm
Kind: inner method of mh_z16
Send data to the MH_Z16
Kind: inner method of mh_z16
Param | Type | Description |
---|---|---|
data | Array |
an array of 9 integers to send to the device |
parse the device data and calculate ppm bytes (2 - 5) are the actual values of the co2
Kind: inner method of mh_z16
Returns: Array
- ppm - an integer value of the ppm concentration
Param | Type | Description |
---|---|---|
data | Array |
a 9 element array |
Measure the co2 Concentration
Kind: inner typedef of mh_z16
Returns: number
- - the value of the concentration, or 0, when there is a problem
Example (How to use mh_z16.measure)
// if the concentration is to be stored in a variable ppm then:
mh_z16.measure( ()=>{} );
ppm = mh_z16.ppm
Receive data from device
Kind: inner typedef of mh_z16
Communicate with the MAX38155k device and sensor
Param | Type | Description |
---|---|---|
spi | Object |
an SPI object |
sck | pin |
the pin that the spi clock is connected to |
miso | pin |
the pin that the spi MISO connected to |
cs | pin |
chip select for the device |
Properties
Name | Type | Description |
---|---|---|
temp | number |
the last temperature that the sensor recorded |
data | Array |
the array that holds the data from the sensor (for debug) |
- max38155k
- exports ⏏
- ~ezoph/begin()
- ~ezoph/readC() ⇒
number
- ~ezoph/readF() ⇒
number
- ~ezoph/readK() ⇒
number
- ~ezoph/readR() ⇒
number
- exports ⏏
This is 'exported' so it can be used with require('max31855k.js').connect(pin1,pin2)
Kind: Exported member Example (How to use max31855k module)
//create a new instance of ph sensor
var spi = new SPI(); // create new spi object
var phAddress = 0x63; // EZO pH i2c address
var miso = D25; // setup spi pins
var cs = D33;
var sck = D32;
tempSensor = new ( require('max31855k') )( spi, sck, miso, cs );
Initialize the spi bus (only needs to be run once)
Kind: inner method of exports
Reads temperature in Celsius
Kind: inner method of exports
Returns: number
- temp - the current temparature read from the sensor in Celsius
Reads temperature in Farenheit
Kind: inner method of exports
Returns: number
- temp - the current temparature read from the sensor in Farenheit
Reads temperature in Kelvin
Kind: inner method of exports
Returns: number
- temp - the current temparature read from the sensor in Kelvin
Reads temperature in Rankine
Kind: inner method of exports
Returns: number
- temp - the current temparature read from the sensor in Rankine
A number, or a string containing a number.
A number, or a string containing a number.
Kind: global typedef