0% found this document useful (0 votes)
433 views10 pages

Mfi Custom Sensors

The document provides information about connecting custom sensors to an mPort device, including warnings about properly checking voltage levels before connecting sensors to avoid physical damage. It recommends modifying existing sensor definitions rather than defining completely new custom sensors. The document then provides details about the mPort's input, output, power and ground pins and their functions. It discusses power and current limits, how the analog and RTD interfaces work, and provides an example JSON format for defining a custom sensor.

Uploaded by

eJc2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
433 views10 pages

Mfi Custom Sensors

The document provides information about connecting custom sensors to an mPort device, including warnings about properly checking voltage levels before connecting sensors to avoid physical damage. It recommends modifying existing sensor definitions rather than defining completely new custom sensors. The document then provides details about the mPort's input, output, power and ground pins and their functions. It discusses power and current limits, how the analog and RTD interfaces work, and provides an example JSON format for defining a custom sensor.

Uploaded by

eJc2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CustomSensors

Warning:connectingthewrongvoltageleveltotheanalogordigitalinputscanphysically
damagethemPort.Alwayscheckvoltagelevelsbeforeconnectingnewsensors.Oreven
betterfollowinstructionsfromexpertsontheforumthathavealreadyconnectedsucha
sensor.

Itisrecommendedthatyoudontdefineyourowncustomsensordefinitions.Instead,modify
existingones.

Pins

Label

Function

Overview

Ports

Input

0v2v=off,>4v24v=on

RJ451&5,TB7

Output

0,5v,12vor24v

RJ452&8,TB8

Power

0,12v,24v

RJ454,TB6

Ground

Common

RJ457,TB3

A+

Analog+

differentialanalog,positive

RJ453,TB5

Analog

differentialanalog,negative

RJ456,TB4

RTD

RTD

ResistanceTemperatureDetector

TB1&2

Power
Currentdrawoftheconnecteddevicesmustbekeptunder40mAtotal,peroutputvoltage(5v,
12v,24v).Thisincludescurrentonboththepowerpinsandtheoutputpins.

Analog
Analogisdifferential,andcanvarybetween2.048vand+2.048v.

Toconnectasingleendeddevice,theApincanbegrounded.Thentheinputvoltagecanvary
between0and+2.048v.

Tomeasurevoltageshigherthen+2.048v,andvoltagedividercircuitcanbeused.

RTD
TheResistanceTemperatureDetectoristypePT100,withanalphacoefficientof0.00385
ohms/ohm/C.TheRTDinterfaceis2wire.Temperaturemeasurementscanvarybetween
50Cand+250C.

RJ45Pinout

Notes:
Eventhoughtherearemultipleinputsandoutputsperport,onlyasinglesensorcanbe
definedperport(theadditionalinputsandoutputsareforsecondarysensorfunctions,
liketamper)
SensorautodetectisonlyprovidedonRJ45ports,andisenabledbytheattacheddevice
connectingIn2andOut2(pins5and8)

Configuration
Customdevicetypesaredefinedbyplacingdefinitionsinthecustomsensordefinitionaccess
fromthebottompanelofthewebuserinterface.

ThestructureformatisJSON,witheachtypeofdevicebeinganentryintheJSONobject,
indexedbythenameofthedevicetype.

Onceanewdevicetypeisdefined,itcanthenbeusedwithintheuserinterfacetocreate
individualmachinesofthattype.Thedevicenamewillbeavailableasanoptioninthedevice
configurationpulldownmenusfortheporttypes(RJ45orTerminalblock)thatitisdefinedfor.

ErrorsinthestructuremaycausethestructuretoloadwhenthemFicontrollerstarts,andan
errormessagewillbedisplayedintheserverlogfile.(ex:<launcher>ERRORSystemService
Unabletoparsecustomsensorbundledata.Butthecontentisvalidatedbeforesaving,sothis
shouldnowhappen.

Definingacustomdevicewiththesamenameasapredefineddevicewilloverridethe
predefineddefinitionwiththecustomdefinition.

Parameters
Thisisforinformationalpurposesonly.Donotcreateyourowndefinitionsbyrandomly
assigningvaluestothesefieldssomenotallcombinationshavebeentested.Tocreateanew
customsensor,itisrecommendedthatyoufindanexistingoneontheforumandmodifyit
suchasbychangingtheconversionfunction.

Name

Description

Type

desc

devicedescription

string

analog

whetherthedeviceistoreportanalogvalues

boolean

rj45_v1

whetherthedevicecanbeconnectedtoanRJ45
port

boolean

tblock_v1

whetherthedevicecanbeconnectedtothe
terminalblock

boolean

pwr_volt

power

integer(12,24)

output

whetherthedevicesoutputistobedynamically
boolean
controlled(versusconstantlyon).Ifthisvalueis
true,thedevicewillhaveon/offbuttonsintheuser
interface,andwillbeselectableasanoutputinthe
ActionTab

do_volt0

voltageforoutput1

integer(5,12,24)

do_volt1

voltageforoutput1

integer(5,12,24)

rep_analog

whetherthedeviceistoreportanalog
measurements

boolean(0or1)

analog_tag

tagforanalogmeasurements

string

rep_sum

whetherthedeviceistoreportasumoftheanalog 0or1
measurements

sum_tag

tagforsumoftheanalogmeasurements

string

rep_rms

whetherthedeviceistoreporta
RootMeanSquaredcalculationoftheanalog
measurements

0or1

rms_tag

tagforanalogRMSmeasurements

string

rep_rms_sum

whetherthedeviceistoreportasumoftheRMS
oftheanalogmeasurements

0or1

rms_sum_tag

tagforanalogRMSsummeasurements

string

rep_input0

whethertoreportthestateofthefirstbinaryinput boolean(0or1)
(I1)

input_tag0

tagforthefirstbinaryinput

string

unit0

unitsforthefirstbinaryinput

stringwithtwovalues,
separatedby/

rep_input1

whethertoreportthestateofthefirstbinaryinput boolean(0or1)
(I2)

input_tag1

tagforthesecondbinaryinput

string

unit1

unitsforthesecondbinaryinput

stringwithtwovalues,
separatedby/

default_tag

specifieswhichofthetagstodisplayasthedefault string
intheuserinterface(suchasthevalueinthe

DevicesTab)
conversion

conversionfunctionforanalogmeasurements

string,consistingof
xyzwhichisthe
analogmeasurement,
andarithmetic
operations.

unit

unitforanalogmeasurements

string(CELSIUS
specialcasefor
temperature)(native
FAHRENHEITnot
supported)

unit0

inversion0

whethertoinvertthefirstbinaryinput

boolean

inversion1

whethertoinvertthesecondbinaryinput

boolean

precision

numberofbitsofprecisionforanalog
measurements

integer

<tag>_unit

unitsforcustomtags.forinstance,
counts_unit:openingstospecifytheunitfora
tagofcounts

string

<tag>_type

binaryspecifiesthevalueisabinaryvalue(two
states)Specifyingasbinarywilldrawgraphasa
2statelinegraph

binary||undefined

Notes:

somebooleansarefalse/true,andsomeare0/1
theinputnamesarezerobased(0,1)whilethepinsare1based(1,2)

Example
{
"UbiquitimFiTHS:Humidity":{
"desc":"Ubiquitihumiditysensor(needtoroutepins1and2ofMFITHStopins3
and6ofthemPortRJ45connector,orpins5and5ofthemPortterminalblock)",
"conversion":"xyz*50",
"analog":true,
"rj45_v1":true,
"tblock_v1":true,

"pwr_volt":12,
"rep_analog":1,
"default_tag":"humidity",
"analog_tag":"humidity",
"unit":"%",
"precision":2

},
"Illuminometer":{
"desc":"Illuminometer.24Vpower,output0~5VDC",
"analog":true,
"rj45_v1":true,
"tblock_v1":true,
"pwr_volt":24,
"rep_analog":1,
"default_tag":"light",
"analog_tag":"light",
"conversion":"xyz*5000",
"unit":"lux",
"precision":2
},
"SparkFunIlluminometer":{
"desc":"www.sparkfun.com/products/9088",
"analog":true,
"rj45_v1":true,
"tblock_v1":true,
"do_volt0":5,
"rep_analog":1,
"default_tag":"lux",
"analog_tag":"lux",
"conversion":"2xyz*4",
"unit":"lux",
"precision":4
},
"InfraredBeam":{
"desc":"InfraredBeamDetector",
"digital":true,
"rj45_v1":true,
"tblock_v1":true,
"pwr_volt":24,
"do_volt0":24,
"rep_input0":1,
"input_tag0":"beam",
"default_tag":"beam",

"unit0":"broken/unbroken",
"inversion0":true
},
"LightSensor(Seeedstudio)":{
"desc":"Seeedstudiolightsensor",
"conversion":"xyz*5",
"analog":true,
"rj45_v1":true,
"tblock_v1":true,

"do_volt0":5,
"rep_analog":1,
"default_tag":"lux",
"analog_tag":"lux",
"unit":"lux",
"precision":2
},
"MoistureSensor(Seeedstudio)":{
"desc":"Seeedstudiomoisturesensor",
"conversion":"xyz*50",
"analog":true,
"rj45_v1":true,
"tblock_v1":true,
"do_volt0":5,
"rep_analog":1,
"default_tag":"m",
"analog_tag":"m",
"unit":"%",
"precision":0
},
"SoundSensor(Seeedstudio)":{
"desc":"Seeedstudiosoundsensor",
"conversion":"xyz*50",
"analog":true,
"rj45_v1":true,
"tblock_v1":true,
"do_volt0":5,
"rep_analog":1,
"default_tag":"sound",
"analog_tag":"sound",
"unit":"%",
"precision":0
}

Templates
Analog
"ExampleAnalogSensor":{

"desc":"Thisiswherethedescriptiongoes.",

"analog":true,

"rj45_v1":true,

"tblock_v1":true,

"pwr_volt":24,

"rep_analog":1,

"default_tag":"light",

"analog_tag":"light",

"conversion":"xyz*5000",

"unit":"lux",

"precision":2
},

Interfacing
ThemPortsanaloginterfaceisdifferential,andsupportsvoltagesbetween2.048and+2.048
volts.

SingleEndedSensors


SingleendedsensorscanbeconnectedbysimplyconnectingthemPortsnegativeanalogpin
(A)tothemPortsgroundpin(G).

VoltageConversion(05v,010vsensors)

Avoltagedividercircuitcanbeusedtolowervoltagestothesupportedrange.Caremustbe
takentoensureresistorswiththecorrectvaluesandaccuracyareused,andtoprovidetheright
levelofoverallresistanceinthecircuit.

CurrentConversion

Somesensorsusecurrent,opposedtovoltage,toindicatethemeasuredvalue.020mAand
420mAcurrentsarecommon.

Inbothofthesecases,a100Ohmresistorcanbeusedtoconvertthecurrenttoamaximum2
volts.

Aburdenresistorcanbeusedtoconvertthecurrentmeasurementtoavoltagemeasurement,
whichcanbereadbythemPort.

You might also like