Analog Channels – How To

In a vehicle, not all data can be cast into a simple 1/0 value. Temperature for example can have infinite values within a range and the scope of analog channels is to display this kind of data in a convenient way. Variable resistance sensors are used to monitor physical quantities like temperature, pressure, position, light, and much more.

Turning into practical, sensors we can hook up to Y-Dash analog channels are:

  • thermistors (temperature sensors)
  • oil pressure sensors
  • air pressure sensors
  • linear and rotational position sensors

All resistive sensors have 2 wires, one to be connected to the analog channel, one to ground. They vary their resistance when the measured quantity changes. Each channel can be configured to work with different sensors by uploading a configuration file to the unit that specifies the sensor behaviour across the measuring range.

Understanding the Breakpoint

The resistance variation and the measured quantity of a resistive sensor are usually not tied by a formula. This means the output value cannot be computed directly, because it follows a curve specific to each sensor. A convenient way to get useful data from such a sensor, is to approximate its curve with a series of breakpoints. A breakpoint contains a known output value at a given resistance of the sensor. Values between breakpoints are computed using linear interpolation. As an example, we will examine a temperature sensor’s datasheet:

The table is made by the manufacturer, and shows the resistance vs temperature correspondence every 5 Celsius degrees. Each row contains the values required to create a breakpoint for our configuration file, ohm and temperature (the first two columns) but Y-Dash can store up to 16 breakpoints per channel, so we must strip down the total count. The goal, is to have more breakpoints in the range in which the sensor will be used at most.

For this example we want to use this sensor to measure ambient air temperature, so we’ll get rid of the impossible to reach values to reduce the number of breakpoints. Output value will be constrained by the extreme breakpoints, so we’ll start to add 16 points to our selection starting from the -15 Celsius row. The measuring range will be -15 C° / + 60 C°.

Creating the configuration file

The creation of the configuration file at this point, is just a matter of filling these data within the app tool. To start a new file, in settings go to “input channels” → “analog channels” and choose the + in the top bar. If you want to edit or start from an existing file, long press a file row within the chooser. By pressing the “cloud” icon, some ready made sensors are downloaded from the server and stored in memory. Let’s start a new file, choose a name and long press on it. The top menu will expand, showing the edit icon.

new blank file

The breakpoints list is empty, and the information fields contains default data. Filling in the values from the table, and some extra info, the result should look like this:

Information fields are used as personal reference, and should contain data like form factor, material etc…

Once you are happy with your file, connect the unit and start the upload by tapping it within the files chooser. A dialog will ask you the destination channel before the upload starts. Upload takes few seconds, the file will be saved in Y-Dash internal memory and cannot be retrieved later.

Custom sensor calibration

A datasheet for a sensor is not always available. If we are going to use automotive sensors they are often already installed or recycled from other vehicles, and don’t have a documentation. Manual calibration consists in creating a table of breakpoints, by measuring the sensor resistance in different points of the working area. A multimeter and basic knowlodge of it is required for this operation.

Example 1 – fuel level sensor

Almost all mechanical fuel level sensors belong to the same scheme, a float connected to a potentiometer trough a metal rod. As the fuel level changes the resistance also changes, giving the unit information about its position. There is more than one option to create the calibration file in this case.

The first one consists in creating 2 breakpoints, one for the minimum and one for the maximum level. The sensor resistance is measured when the tank is empty, and when it’s full. Alternatively the sensor unit can be taken out of the tank, and the float moved by hand to min and max positions, while it is measured. The breakpoints will have 0 and 100 as output values, and the unit is percent. The gauge will indicate 100% when full, and 0% when empty. When the gauge is created in Y-Dash Builder, its min and max values will have to be set to 0 and 100.

measuring sensor at “empty” position
measuring sensor at “full” position
the resulting file

The second method relies on a higher precision solution. The first breakpoint is created measuring the sensor when the tank is empty, setting the output value to 0. Some liters of fuel are then added, and the measurement is repeated. After each add a new breakpoint is created using the resistance value and the number of liters added as output value. This procedure is repeated until the tank is full. A step of 10 liters is usually fine, just keep in mind that breakpoints can’t be more than 16, so if you choose a step of 5 liters, you may reach the 16 breakpoints count before the tank is full if you have a large tank. On a motorcycle, the step can be much smaller, 1 or 1,5 liters. When creating the gauge in Y-Dash Builder, use as top scale value, the value of the highest breakpoint in the list. This method allow to linearize the output value in odd-shaped tanks, giving real information on the fuel volume left. The example can be applied to other volume units, like gallons, just change the output values accordingly.

Example 2 – coolant temperature sensor

In this example we will calibrate a OEM coolant temperature sensor mounted on a Nissan engine. In this case we can’t test it over the whole range when it’s installed on the vehicle, because this would mean heating the engine up to 120 Celsius degrees, and this could damage our engine, so the sensor must be removed and bench tested. The goal is to heat the sensor at a known temperatures, measure the resistance and create the breakpoints based on these readings. In this case a thermometer is required, over a multimeter. Many multimeters have temperature reading capability, if you own one you can both measure resistance and temperature with the same device.

measuring sensor resistance
note K-Type thermocouple connected to the multimeter

The test bench consists in plunging the sensor in cooking oil within a pan, slowly heat the oil and measure the temperature and resistance, from ambient temperature up to say 120 C°. A 5 C° increment will be fine to create a table, a selection of the values that will be used for the breakpoints creation will be done at a later stage. The reason water is not used, is that it boils at 100 C°, while oil boils at higher temperature. Water in the engine, can reach higher temperatures without boiling due to the pressurization of the cooling system. At each heating step, turn off the heating source and allow the sensor to fully reach the oil temperature before measuring the resistance. If you use Fahrenheit degrees, just create your table with F° values, and fill breakpoints fields accordingly.

table created from the measurements

We put the measured data in a spreadsheet, and highlighted the values that we’ll use to create the breakpoints, as all won’t fit in memory. The selection criteria aims to keep high precision in the engine working temperature range, so we’ll create 15 breakpoints exploiting all the data in the 50C° – 120C° range. This leaves us with 1 unused breakpoint, that will be placed at ambient temperature (20C°). This method has the benefit of having a wide range of temperature swing (20C° – 120C°) and a good precision in the engine temperature working range. The 20C° – 50C° range is more approximated, because values are interpolated.

Analyzing the data

We wanted to compare the measurements with the brekpoints list in a chart. We used Open Office to plot a chart based on these data:

The blue curve contains the whole measurement data set, the red curve is created with breakpoints data. It’s easy to see the loss of precision of the red curve in the 20C° – 50C° range, where the lines don’t overlap. The maximum error is at about 35C°, where the temperature indicated will be about 38C°. The spreadsheet file is available for the download at the bottom of the page.

Analog sensor spreadsheet

Analog sensor spreadsheet (xls format, charts may not display correctly)

Y-Dash Environment Overview

Y-Dash dashboard system, was born to display vehicle’s dashboard on Android devices screen. The processing power of modern smartphones, made this possible, in an efficient way. The dashboard system is composed of two main parts: the Android device, and the Y-Dash unit. When connected via bluetooth, the unit sends a data stream containing the vehicle’s informations to the smartphone or tablet, that will display it on the screen.

Y-Dash unit

The Android app Y-Dash View

Y-Dash View Android app takes care of displaying the graphic dashboard, and offers a deep menu, to customize the system to any requirement. Almost all the settings must be done when the unit is connected, because the data are saved in its internal storage. This feature allows to retain the data when different devices are used with the same unit. Y-Dash View is supplied with a default dashboard that adapts itself to all screen dimensions. It is configured like an aftermarket motorcycle dashboard, and the unit must be wired following the user manual diagram. Few things like tachometer scale or fuel level indicator can be tweaked on this graphic.

standard dashboard

The default dashboard can replaced by custom graphics that can be downloaded directly within the app, or can be built using the dedicated software Y-Dash Builder. Analog and digital channels can be repurposed to accomplish different tasks, so you can create your own indicators. Y-Dash Builder is a Windows software, and can be downloaded on the product page.

Y-Dash Builder

Power Launcher Widget

The app contains a home screen widget called Power Launcher, a small icon that you can keep on your phone home screen, that completely automates the dashboard usage experience. When you enable this service, the widget will launch Y-Dash View and start the connection when it receives power from usb, and disconnect and dim the screen when the supply is turned off. There is no need to touch the screen, allowing the use with gloves too. Power Launcher activity is highlited by a small icon in the status bar. A usb power supply connected to the “key switched” 12 volt is required to use this feature, but it is also necessary to recharge the phone.

Y-Dash control unit

The control unit task, is to process the input signals connected to it, and send them to a Bluetooth stream. It features 7 digital channels and 2 analog channels, all protected against short circuit and overvoltage. It can be installed in tight places due to its minimal size and is designed to work with older vehicles too, where obd port is not present.

Use cases

There are 2 main use cases:

  • the device is a personal phone and is removed from the vehicle when not in use
  • the device is permanently installed

The menu contains options to better suit the installation case, like automatic bluetooth or wifi turn off when power is removed. Let’s see how to setup the connection.

If you want to use your personal phone as a dashboard, you need to create a quick release holder, optionally connect a usb power supply to recharge the phone and take advantage of Power Launcher Widget to automate the task. If you want to avoid usb supply, there is an option to enable continuous connection when app is launched, so just tap the app icon, and wait for the connection. When the Y-Dash unit is turned off, connection is terminated automatically.

In case of a permanent installation, special care must be taken about device standby activity, because when power is removed the device rely only on its battery, and is not recharged overnight. It is mandatory to limit background activities like mail syncronization or automatic updates, so you can find menu check boxes to enable automatic wifi and bluetooth turn off when power is removed. Great improvements can be done outside Y-Dash View also, by disabling unnecessary apps. When making a permanent holder, leave access to power button, and to volume buttons if possible. This will let you turn on the device in case of need. 3d printers here can be very handy to make a custom enclosure, you may also combine lights or phisical gauges within the same cockpit. The screen turn off time should be set to the lowest value.

3D printed holder

Y-Dash environment goal is to offer a innovative and highly customizable dashboard system, eventually recycling cheap outdated devices. Min Android version required is 4.1.2 Jelly Bean.

Installation session: Aprilia Tuareg Rally

Installing Y-Dash On Aprilia Tuareg Rally To Test Y-Dash View

When it’s time to test new hardware or software, we like to choose unusual bikes or cars. This time we picked up from our collection a ’91 Aprilia Tuareg Rally 50. Altought it has a very small 2 strokes engine, this bike is light and fast, and has plenty of room for our electronics gadgets.

The goal of this mod, is the installation of a Y-Dash unit, and the replacement of the stock dashboard with a permanently mounted Android device. We had a Samsung J3 laying around, so this has been our first choice. This is a cheap phone, but the app doesn’t require high end hardware.

Wiring the Y-Dash unit

The wiring diagram of this bike is pretty standard, let’s connect the GREEN wire to the neutral switch, and the RED wire to the tachometer wire of the CDI unit.

Y-Dash unit has a oil pressure light input (for 4 stroke engines), we’ll use it to monitor the oil level in the tank. This bike has a on-off float that switches to ground when the oil level is low, we’ll connect it to the ORANGE wire of the unit.

oil level sensor out of its seat

Like most mopeds, lights run on AC current. We want to improve lighting efficiency by installing led head lights, but this requires DC conversion for high beam. This will also allow us to directly connect the high beam signal to Y-Dash. (PINK wire)

As speed source, we will install a wheel hall effect sensor that senses the brake disc bolts. It has 3 wires, 2 of them are for power supply, the signal wire will be connected to the blue wire of the unit. The wheel circumference is 2099 mm, there are 6 reference bolts. The value we’ll need later to set the speedometer is 2099 / 6 = 350.

speed sensor installed

The 2 turn signals will not be monitored on the dashboard, instead we will repurpose these inputs (BROWN and GREY wires) to switch between different dashboards, and to open the garage door respectively. They are now connected to a racing style buttons cluster.

cheap racing style buttons

Buttons functions:

  • yellow – garage door open
  • green – dashboard switch
  • white – not in use
  • blue – high beam (LED)
  • red – engine start

all buttons are momentary, except the blue one, that toggles the high beam led. Y-Dash unit is powered via the YELLOW (+) and BLACK (-) wires. A 12v usb charger is also connected to the bike to provide power to the smartphone, enabling the usage of Power Launcher. This widget completely automates the phone connection and standby when usb power is toggled.

Because this bike has 2 headlights, we removed the right incandescence lamp and installed the led in place of it.

H7 led lamp installed on the right

The left lamp is still powered by ac current, while the led runs on dc. We bought a H7 lamp with integrated fan, it required just a bit of work to mount it on the stock adapter.

In a standard configuration, analog channels in Y-Dash are dedicated to fuel level and coolant temperature. This bike doesn’t have a fuel level sensor neither a temperature sensor. We installed a ntc temperature sensor on the cylinder head to monitor the coolant temperature and connected it to the PURPLE wire of Y-Dash.

coolant temperature sensor installed

The sensor is a 1/8 thread automotive ntc sender, it will be calibrated later with the Y-Dash unit.

ntc sensor

The tank of this bike doesn’t contain a fuel level sensor. We didn’t want to bother installing one, so we decided to use the white analog channel to monitor air temperature. The ntc sensor is connected to the WHITE wire of Y-Dash. The other lead of the sensor is connected to ground. Just like the coolant sensor, the ambient temperature sensor will be calibrated later.

ambient temperature sensor, located under the dashboard
Y-Dash installed under the fuel tank

Y-Dash unit was secured to the frame with zip ties, under the fuel tank, well protected against the rain.

The Cockpit

As said previously, the heart of the dashboard is a Samsung Galaxy J3 6. We wanted to get rid of the stock gauges, and use all the available space for the new dashboard. After having modeled the cockpit, the 3d printer did the rest of the job.

3d printed cockpit and phone

The material used is PETG, easy to print, strong and durable, the same we use to print Y-Dash enclosures.

CURA slicer

The base (left part in the pictures) has keys to perfectly match the stock dashboard mount, while the center spacer has an opening to allow the usb connection.

dashboard installed

The parts are joined using M3 screws. The small hole on the right, allows the home button to be pressed, just in case. Note the usb cable on the right side.

The software

Y-Dash View allows custom dashboards to be uploaded, so we made 2 different graphics that will be switched using the green button on the handlebar. To do so, just create an “action” with Y-Dash Builder that switches between dashboards when BROWN channel goes high. The first dashboard is for road use, it features total and trip kilometers, time, speed and rpm, and few other info. The second is for track use, most of the screen area is reserved to laptimer, and only “racing info” are shown.

Another handy action we added allows the garage door to be opened when the yellow button is pressed. This requires a hardware setup on the garage door side using a smart relay like Itead Sonoff, and a software setup on the IFTTT website that triggers the relay when a encrypted command is sent from Y-Dash View. The configuration of IFTTT webhooks will be the scope of a dedicated post. The dashboards can be downloaded using the links at the end of this page. You can open and edit them with Y-Dash Builder. Click on the image to download the dashboards projects and unzip it on your hard drive, you will need Y-Dash Builder to open and edit them.

Software settings

  • Tachometer – sparks per 2 revolutions = 2
  • Speedometer – Source = wheel
  • Speedometer – Unit = kilometers
  • Speedometer – mm per sector = 350 (wheel circ / 6 bolts)
  • Purple channel – loaded h2o sensor file
  • White channel – loaded air temp file
  • Gear indicator – calibration on road
  • IFTTT Webhooks – personal key entered
  • IFTTT Webhooks – command 1 set to open gate