Megasquirt 3 - Generic Sensor inputs

Home

This page has now been superceded, please click here

Intro - Settings - Wiring

Introduction

The Generic Sensors allows optional analogue inputs to be connected and easily recorded in datalogs or used as parameters in the Output Ports. The analogue inputs are in the 0-5V range and are internally converted with a 10bit ADC (Analogue to Digital Convertor) giving 1024 steps. Typical uses include:
-pre- and post- intercooler pressure and temperature
-fuel pressure
-nitrous pressure
-exhaust back-pressure
-pedal position
-suspension travel

The MS3X card provides three ready to use 0-5V analogue inputs. With some DIY there are two more analogue inputs available on the mainboard. For even more, a CAN connected extension board may be used up to a maximum of 16 supported inputs.

Settings

Each sensor channel is turned on individually. Once it is enabled it will appear in datalogs. The channels are named sensor01, sensor02....up to sensor16.

Source
To enable a channel, change the source from "off" to a specific input.
JS5, JS4 are the DIY inputs on the mainboard
EXT_MAP, EGO2, Spare ADC are the ready to use inputs on the MS3X connector
CAN ADC01-24 are analogue inputs collected from a remote CAN connected board(s) and must be configured in the CAN section before use.

Transformation
This specifies how the raw 0-1023 number the MS3 sees internally should be turned into something meaningful to you.
-raw - just the raw 0-1023 number, not usually very useful
-linear - apply a linear conversion from 0V to 5V values. This is appropriate for many sensors
-Same as MAP - if you have an identical pressure sensor as the main MAP sensor
-Same as CLT - if you have an identical temperature sensor and bias resistor as the main CLT sensor
-Same as MAT - if you have an identical temperature sensor and bias resistor as the main MAT sensor
-Same as EGO - if you have an identical EGO calibration as the main EGO sensor
-Same as MAF - if you have an identical Mass Air Flow sensor as the main MAF sensor calibration
-GM calibration - if you have a GM temperature sensor and standard bias resistor

0V, 5V value
These are only used with the Linear transformation.
-0V value - specifies the number you want to see when 0V is applied
-5V value - specifies the number you want to see when 5V is applied

Many sensors specify output at other voltages, e.g. some datasheets advise pressure at 0.5V and 4.5V. This needs to be converted to the 0V and 5V values using a calculator.
Take,
'A' = low voltage
'B' = high voltage
'C' = low pressure
'D' = high pressure

Calculate E = (D - C) / (B - A)
0V value = C - (E * A)
5V value = (E * 5) + 0V value

Worked example 1 - MPX4250AP 2.5bar pressure sensor

This sensor has a linear (ratiometric) output voltage range of 0.5V to 4.5V from zero to full pressure.
It is a 250kPa absolute pressure sensor suitable for MAP, baro pressure readings. (It could be used for exhaust back pressure too, but beware of exhaust fumes entering the vehicle and possible sensor contamination.)

From the datasheet (assuming 5.0V supply.)
0.2V is 20kPa
4.8V is 250kPa

Calculate the 0V and 5V values as above.
Take A = 0.2V, B = 4.8V, C = 20kPa, D = 250kPa

E = (D - C) / (B - A) = (250 - 20) / (4.8 - 0.2) = 230 / 4.6 = 50

0V value = C - (E * A) = 20 - (50 * 0.2) = 20 - 10 = 10
5V value = (E * 5) + 0V value = (50 * 5) + 10 = 250 + 10 = 260

For this particular sensor you would enter 10 in the 0V box and 260 in the 5V box. Those values are never actually reached, but this gives the correct calibration.

Worked example 2 - 2000psi Honeywell sensor
Part no. MLH02KPSB06A
This sensor has a linear (ratiometric) output voltage range of 0.5V to 4.5V from zero to full pressure.
It is a 2000psi gauge sensor that would be suitable for measuring nitrous line pressure
0.5V is 0psi
4.5V is 2000psi

Calculate the 0V and 5V values as above.
Take A = 0.5V, B = 4.5V, C = 0psi, D = 2000psi

E = (D - C) / (B - A) = (2000 - 0) / (4.5 - 0.5) = 2000 / 4 = 500

0V value = C - (E * A) = 0 - (500 * 0.5) = 0 - 250 = -250 (yes this is negative)
5V value = (E * 5) + 0V value = (500 * 5) - 250 = 2500 - 250 = 2250

For this particular sensor you would enter -250 in the 0V box and 2250 in the 5V box. Those values are never actually reached, but this gives the correct calibration.

Worked example 3 - 100psi Honeywell sensor
Part no. MLH100PSB06A
This sensor has a linear (ratiometric) output voltage range of 0.5V to 4.5V from zero to full pressure.
It is a 100psi gauge sensor that would be suitable for measuring fuel pressure
0.5V is 0psi
4.5V is 100psi

Calculate the 0V and 5V values as above.
Take A = 0.5V, B = 4.5V, C = 0psi, D = 100psi

E = (D - C) / (B - A) = (100 - 0) / (4.5 - 0.5) = 100 / 4 = 25

0V value = C - (E * A) = 0 - (25 * 0.5) = 0 - 12.5 = -12.5 (yes this is negative)
5V value = (E * 5) + 0V value = (25 * 5) - 12.5 = 125 - 12.5 = 112.5

For this particular sensor you would enter -12.5 in the 0V box and 112.5 in the 5V box. Those values are never actually reached, but this gives the correct calibration.

Lag
The smoothing factor to apply. This uses the same number system as lags elsewhere. 100% means no smoothing and lower numbers give increased smoothing and lag to the input. 15% is a sensible lower limit.

CLT/MAT temp units
Specify the temperature unit system you want.

Wiring

MS3X sensor input wiring
Temp sensor wiring
See also the MS3X jumper setup information for where to add the internal bias resistor.
3 wire sensor wiring
To connect to the two DIY sensor inputs, see the MS2/Extra docs

Typical pressure sensor
pressure sensor
This is a pressure sensor from Honeywell with a 1/8"NPT thread and a plug the same as GM TPS plugs. The sensor takes a 5V supply (from TPS REF), signal ground at the Megasquirt and gives a 0-5V output (actually 0.5 to 4.5V).
Honeywell sensor diagram

If you have a question, comment, or suggestion for this FAQ please post it on the forum.

No part of this manual may be reproduced or changed without written permission from James Murray and Ken Culver.