Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Jen-in-Wellies

Digital Instrument Panel

Featured Posts

A week or two back I was asking questions about the senders on a BMC engine. I said at the time I was planning to make a digital instrument panel for a friends boat and that I'd be starting a topic on it in due course. That time has now come and here it is...

 

He has a set of traditional Smiths instruments and a variety of chrome toggle switches on the existing panel. It is all looking a bit tired and the panel has lead a hard life with scratches, things added, things removed and so on. He wanted digital displays, rather than moving needle instruments. There are a number of these around for race cars, with different price points from expensive, all the way up to eye wateringly expensive. However, expensive is too much and they are difficult to configure for boats as that is not what they are designed for. I reckoned I could make one using Arduino bits for a lot less. This obviously doesn't include my time, but since I am doing this for fun it doesn't matter. I have weird ideas about what is fun. ?

 

For those that don't know, Arduino's are programmable logic controller boards (PLC's) that are designed to be relatively easy to incorporate in to an almost infinite variety of electronic projects. They come with a programming environment and can interface with a whole variety of ancillary components.

 

The display is a twenty character by four line LCD (liquid crystal display). Available for around £6. A couple of quid more gets an add on board for this that allows two wire I2C communication with the Arduino, freeing up more pins on the Arduino for other things like warning LED outputs. The Arduino needs six analogue inputs for engine rev's, water temperature, oil pressure, voltage, fuel level and ambient light level. The ambient light level is measured by a light dependent resistor (LDR) and the aim is to use this to adjust the backlight for day/night conditions in the cockpit. The Arduino Uno board, the most common one used only has four analogue I/O pins available if you are using I2C to as this uses two of the six pins. For this reason the project uses the less common Leonardo board that I happened to have lying around, where I2C uses digital pins 2 and 3, leaving six analogue pins available. The whole thing is powered by a variable output power supply set to 5V that runs on the boat 12V. This can hopefully cope with the variable voltage from the batteries/alternator/charger/solar.

 

So far the display has been set up on a breadboard and the sketch (program) is being developed. Voltage measures and displays correctly. Oil pressure and water temperature currently have placeholder calculations in the program, so what is displayed is rubbish. RPM still needs some work with the input rectification from the AC provided by the engine sender. Engine hours works and is stored in non volatile memory while the dash is powered off. The warning LED's seem to be working and the warning buzzer is working. Fuel level is there ready for when a new tank is installed in the boat with a built in sender.

 

A picture below of the current rats nest of wires, components modules and laptop. This will look neat and tidy eventually honest! Another picture of the display with real readings for voltage and engine hours and rpm. Rubbish numbers for temperature, oil pressure and fuel level.

 

Jen

 

breadboard.JPG

LCD.JPG

Edited by Jen-in-Wellies
  • Love 2

Share this post


Link to post
Share on other sites

have you tried reading the display from an operating distance in the sun, my experience of those displays is they are OK indoors from 2-3 feet away, but not from 5 feet.

Share this post


Link to post
Share on other sites
Just now, Detling said:

have you tried reading the display from an operating distance in the sun, my experience of those displays is they are OK indoors from 2-3 feet away, but not from 5 feet.

Yes. It was sunny today and the boat it is going in is a cabin cruiser with a roofed cockpit. We tried it and it is readable.  Viewing will normally be from the seat in front of the panel, so a fixed relationship and only a few feet. The backlight is currently full on, but will be automagically adjustable.

Share this post


Link to post
Share on other sites

Interesting project! Out of interest why did you decide to go for a numeric display as opposed to say a graphical one which would allow bar gauges? Programming more complicated of course, but as your photos amply demonstrate the hardest bit is interfacing with the various engine sensors!

 

Just wondering if there is anything on the market that has the ability to gather data onto a serial bus, ie for example something to plonk on the temperature sender that locally digitises the data and sticks it on some multi-master serial bus. So just one serial bus into the microprocessor, as opposed to all those wires carrying horrible real-world voltages with spikes etc,

Share this post


Link to post
Share on other sites

Yes it is quite easy and possible to do and I have thought of doing it over the years. I never have for the following reasons

1. You tend to get a lot of odd voltages /spikes on boats which can cause failure and although you can do a lot to prevent this when the 'system' goes down you lose everything and you need to have good back up.

2. You need to make the system bombproof and use all the proper encapsulation and mounting otherwise you will get failures much more work is needed in the installation than there is making it work on the bench.

3. Unless you make a complete spare system that can be plugged in and out what sort of support would be available to the end user or the next owner of the boat?

This reminds me of a system we have in a French marina. Card control of the pontoon elec and water but now these are starting to fail there is nobody able to fix them so only a few remain working and the whole system will need to be replaced soon.

Share this post


Link to post
Share on other sites
1 minute ago, nicknorman said:

Interesting project! Out of interest why did you decide to go for a numeric display as opposed to say a graphical one which would allow bar gauges? Programming more complicated of course, but as your photos amply demonstrate the hardest bit is interfacing with the various engine sensors!

 

Just wondering if there is anything on the market that has the ability to gather data onto a serial bus, ie for example something to plonk on the temperature sender that locally digitises the data and sticks it on some multi-master serial bus. So just one serial bus into the microprocessor, as opposed to all those wires carrying horrible real-world voltages with spikes etc,

It is numerical because that is what the boats owner wants! I am not aware of anything that can be used to turn an existing sender in to a node on a bus. Doesn't mean that they don't exist. I'll be doing things to hopefully protect it from any spikes. The number of wires in from the rest of the boat isn't actually too bad. Only five instrument lines, plus power and ground. Various outputs to LED's etc, but these will be within the panel.

Share this post


Link to post
Share on other sites
8 minutes ago, Mike Adams said:

Yes it is quite easy and possible to do and I have thought of doing it over the years. I never have for the following reasons

1. You tend to get a lot of odd voltages /spikes on boats which can cause failure and although you can do a lot to prevent this when the 'system' goes down you lose everything and you need to have good back up.

2. You need to make the system bombproof and use all the proper encapsulation and mounting otherwise you will get failures much more work is needed in the installation than there is making it work on the bench.

3. Unless you make a complete spare system that can be plugged in and out what sort of support would be available to the end user or the next owner of the boat?

This reminds me of a system we have in a French marina. Card control of the pontoon elec and water but now these are starting to fail there is nobody able to fix them so only a few remain working and the whole system will need to be replaced soon.

Yes, all true. This is the easy bit. The hard bit is boat proofing it all. Spares and repair are a problem with any electronic system once the manufacturer goes bust, or ceases to support it. All will be documented, including electronic and paper versions. A spare set of the basic modules is cheap to get. If it goes wrong in a non recoverable way, then back to traditional instruments. Nothing here would prevent you getting home if it went wrong. The boat could be started with a screwdriver across the starter motor! Instruments are just for monitoring.

Edited by Jen-in-Wellies

Share this post


Link to post
Share on other sites

Thanks for the feed back and good to know its coming on. However if I am right about those gauges being bimetallic thermal types with stabiliser I still think t would be cheaper in the long run to switch to a resistive temperature sender and a pietzo oil pressure sender. If you keep the original senders I would be very interested in how you marry them to a digital circuit.

Share this post


Link to post
Share on other sites

Jen this is fascinating!  Several years ago I did some experimenting with an Arduino board, connecting it to my internet router and using it to control a mains relay board so that I could switch on lights at home from an internet-connected PC or mobile phone anywhere.  It was just a proof-of-concept to help me understand the power of these small, cheap programmable devices.  The simplicity of programming the Arduino was impressive but as nicknorman says above the hardest bit is interfacing it with the hostile real world environment of the engine and various temperature and pressure sensors.

 

Nevertheless I've wanted to add this kind of instrumentation to my own boat so please do post more details here of your successes (and failures!), ideally with as much info and circuit diagrams as you can.  I'm sure I'm not alone in being really interested in your work on this.

Share this post


Link to post
Share on other sites
3 hours ago, Jen-in-Wellies said:

It is numerical because that is what the boats owner wants! I am not aware of anything that can be used to turn an existing sender in to a node on a bus. Doesn't mean that they don't exist. I'll be doing things to hopefully protect it from any spikes. The number of wires in from the rest of the boat isn't actually too bad. Only five instrument lines, plus power and ground. Various outputs to LED's etc, but these will be within the panel.

Many years ago when PIC microcontrollers were recently out I had a car with central locking but not remote locking. I added a maplin remote keyfob /receiver and a very simple circuit comprising an 8 pin PIC, some simple software and 3 small relays - one to lock and one to unlock and as I wanted it to be able to flash the indicators (the usual 1 flash for locked and 2 for unlocked - or vice versa, can’t remember!), one for the indicators.

 

But I had a lot of trouble getting it to work. In the end I discovered that the relays were making the PIC programme crash due to spikes. A few Transorbs later and all was well! That is the trouble with ultra low power microelectronics, they just need ultra low power spikes to screw them up!

Edited by nicknorman

Share this post


Link to post
Share on other sites

I much prefer analogue instruments. You can twist the gauges so that the pointers are upright when everything is normal, so you don't have to even read them,  just glance at them to check that everything is OK. 

 

 With digital readouts you need to actually read each one to understand what is happening, which takes much longer.

  • Greenie 1

Share this post


Link to post
Share on other sites

A little progress today calibrating the engine temperature sender. This is a negative temperature coefficient thermistor, the usual thing for engines. They have a very non-linear relationship between temperature and resistance, however the reciprocal of the absolute temperature is proportional to the log of the resistance. If you plot one against you get a straight line with a slope and an intercept that can be used to calculate the temperature for any resistance and this equation can be plugged in to the arduino.

 

The temperature sender was removed from the engine and suspended in a pan of water on the stove. In the water was also suspended a jam thermometer! Temperatures and resistance measurements were taken heating up to a rolling boil, then cooling down. The results were entered in to a spreadsheet and a nice linear graph created. A straight line was fitted and the resulting equation worked out to be put in to the Arduino sketch. I used base ten log, rather than natural log as arduino's support any base and base ten was easy to do.

 

The oil pressure sender is much simpler. It is another resistance sender, but it looks like the resistance is inversely proportional to the pressure, from the existing dash pressure gauge. The resistance was measured with the engine off (0psi) and the engine running at around 1200rpm with cold oil for 60psi.

 

Temperature calibration below.

Jen

 

 

temperature-calibration.png

Edited by Jen-in-Wellies

Share this post


Link to post
Share on other sites

Idea - If you want to confirm the pressure transducer you can use a tire foot pump with pressure gauge.

 

My engine on a very low temp start has an oil pressure of about 6 bar falling to about 2 bar when hot.  Not sure my foot pump can go that high.

Edited by Chewbacka

Share this post


Link to post
Share on other sites
8 hours ago, Chewbacka said:

Idea - If you want to confirm the pressure transducer you can use a tire foot pump with pressure gauge.

 

My engine on a very low temp start has an oil pressure of about 6 bar falling to about 2 bar when hot.  Not sure my foot pump can go that high.

Good suggestion. A bike pump will handle the pressure involved as they go to over 100psi. The difficulty is in interfacing the pump with the sender. Either finding a set of adaptors between whatever weird threads bike valves use and the bsp of the sender, or cutting off the adaptor on the pump, ruining it and pushing the tube on to a fir tree fitting. Hassle and extra expense if you don't have everything available.

I didn't say in the post above that I have more evidence that the pressure senders resistance is linear. I have monitored the voltage across it when the existing gauge is working and plotted this against the oil pressure on the Smiths gauge. This is linear, so its resistance is linear. The gauge is a simple bimetallic strip one with a built in voltage regulator.

Jen

Edited by Jen-in-Wellies

Share this post


Link to post
Share on other sites

The sender for the engine speed outputs AC with frequency and AC voltage rising as the engine speed does. Voltage is a lot easier to measure than frequency, but the Arduino can only measure DC voltage. I've built a bridge rectifier with a smoothing capacitor. Did a quick exercise with this connected across the terminals of the existing tacho and measured output voltage against RPM. All this assumes that the existing tacho is reasonably accurate. The results are nicely linear. At 0V output, the revs would be around 175rpm. This is due to the 0.8V from the engine sender that are lost across the diodes of the rectifier. The DC voltage at normal and maximum engine speeds massively exceeds the 5V input limit of the Arduino pins. It will need a voltage divider to bring them down to a safe level. A 1k and 2.7k resistor will do this as this will be over 4000rpm. There will also be a zener diode just in case the engine exceeds this, though the engine will probably blow up, so zapping the arduino will be the least of the problems.

Jen

 

 

 

tacho-calibration.png

Share this post


Link to post
Share on other sites

I’m not that familiar with the Arduino but generally microcontrollers have counter/timers that can easily be used to measure frequency. I would have considered taking the AC waveform, squaring it up /clamping it, and using a timer to measure the period (or using it to clock a counter, depending on the frequency range to be measured and update rate required). It just seems a shame to take a digital type output, convert it to analogue, then convert it back to digital within the controller, thus increasing errors.

 

https://tushev.org/articles/arduino/9/measuring-frequency-with-arduino

 

Also just wondering if the voltage on the alternator W terminal will be affected by how hard the alternator is working (ie what the field current is for a given rpm).

Edited by nicknorman

Share this post


Link to post
Share on other sites
1 hour ago, nicknorman said:

I’m not that familiar with the Arduino but generally microcontrollers have counter/timers that can easily be used to measure frequency. I would have considered taking the AC waveform, squaring it up and using a timer to measure the period (or using it to clock a counter, depending on the frequency range to be measured and update rate required). It just seems a shame to take a digital type output, convert it to analogue, then convert it back to digital within the controller, thus increasing errors.

There are several sets of libraries available for measuring frequency and at first I planned to use one of these. However, they all sample on the digital input pins, and the input would need converting to a square wave, or pulse train. The voltage is also varying with engine speed, as well as the frequency, which makes setting up a square pulse train harder. Could probably be done using a rising voltage trigger of some sort. I also don't have an easy way of measuring frequency, so debugging and even knowing what frequency range I was likely to get was a problem.  Some digital input libraries make assumptions about pulse width that may not turn out to be true, so I could have ended up having to customise these, or write my own frequency measurement routine. Measuring voltage is nice and simple in comparison. I like nice and simple. ?

The sender is an AC generator in essence. Both frequency and voltage are proportional to engine speed and voltage from the graph is nice and linear. Certainly good enough for a tacho display on the panel.

 

I have a spectrum analyser / oscilloscope app on my phone that will pick up engine speed. Works on my boat and the boat this is for has a noisier engine. I'll double check the tacho output with this. The spectrum analyser works off the microphone. You have to be careful how you use it as the spikes you see might be from the engine rotation, a harmonic of the rotation, or something else entirely. At idle, the engine speed seems to drop below the frequency response of the microphone, for example, so then you pick up the first harmonic instead. You need to have a rough idea what to expect to interpret it correctly.

 

Jen

Edited by Jen-in-Wellies

Share this post


Link to post
Share on other sites
1 hour ago, nicknorman said:

Also just wondering if the voltage on the alternator W terminal will be affected by how hard the alternator is working (ie what the field current is for a given rpm).

The tach signal being used isn't from the alternator, but a sender on the engine that is driven by the camshaft (I think!). The sender is basically an AC generator. Frequency and voltage proportional to speed. This boat has a simple petrol car type of old style Lucas alternator fitted, so no W terminal available.

Edited by Jen-in-Wellies

Share this post


Link to post
Share on other sites
3 hours ago, Jen-in-Wellies said:

The tach signal being used isn't from the alternator, but a sender on the engine that is driven by the camshaft (I think!). The sender is basically an AC generator. Frequency and voltage proportional to speed. This boat has a simple petrol car type of old style Lucas alternator fitted, so no W terminal available.

Oh I see. In that case measuring the voltage should be fine!?

3 hours ago, Jen-in-Wellies said:

There are several sets of libraries available for measuring frequency and at first I planned to use one of these. However, they all sample on the digital input pins, and the input would need converting to a square wave, or pulse train. The voltage is also varying with engine speed, as well as the frequency, which makes setting up a square pulse train harder. Could probably be done using a rising voltage trigger of some sort. I also don't have an easy way of measuring frequency, so debugging and even knowing what frequency range I was likely to get was a problem.  Some digital input libraries make assumptions about pulse width that may not turn out to be true, so I could have ended up having to customise these, or write my own frequency measurement routine. Measuring voltage is nice and simple in comparison. I like nice and simple. ?

The sender is an AC generator in essence. Both frequency and voltage are proportional to engine speed and voltage from the graph is nice and linear. Certainly good enough for a tacho display on the panel.

 

I have a spectrum analyser / oscilloscope app on my phone that will pick up engine speed. Works on my boat and the boat this is for has a noisier engine. I'll double check the tacho output with this. The spectrum analyser works off the microphone. You have to be careful how you use it as the spikes you see might be from the engine rotation, a harmonic of the rotation, or something else entirely. At idle, the engine speed seems to drop below the frequency response of the microphone, for example, so then you pick up the first harmonic instead. You need to have a rough idea what to expect to interpret it correctly.

 

Jen

Just as an aside then, one easy way to make a 50% duty cycle square wave is to use a JK flipflop to give a divide by two function. Of course you halve the frequency which might or might not be a problem.

Share this post


Link to post
Share on other sites

using the arduino you can use an interrupt to measure frequency, I used it some time ago to build a windspeed & direction monitor.

from memory the 1st interrupt sets a timer then every interrupt after that compares the timer with the value from the previous interrupt and stores the difference for the main program loop to pick up when it needs it.

I do remember that the code used in the interrupt had to be very tight & fast running otherwise it would cause glitches on the graphic lcd screen I was using, when the interrupt fires the arduino stops whatever it's doing to handle it and then resumes it's previous task, this introduces a varying number of delays in other tasks, the longer the delay the more likely to cause a problem (in it's current form my screen glitches if the windspeed hits 180 mph... but with windspeeds that high I have bigger concerns than a scrambled lcd screen)

Share this post


Link to post
Share on other sites
On 22/06/2018 at 11:50, Jen-in-Wellies said:

The tach signal being used isn't from the alternator, but a sender on the engine that is driven by the camshaft (I think!). The sender is basically an AC generator. Frequency and voltage proportional to speed. This boat has a simple petrol car type of old style Lucas alternator fitted, so no W terminal available.

I can’t see that sender output voltage into a fixed load would be any less stable than frequency, and as you say easier to use.

Share this post


Link to post
Share on other sites

Oh dear!! does all this mean my dial thingies that all work with lovely needles are soon going to stop working ☹️ Will I no longer be able to see my water temp is exactly where it should be and so too my oil pressure and that my batteries are charging/charged without " Going Digital " :ninja:

  • Greenie 1

Share this post


Link to post
Share on other sites
1 hour ago, mrsmelly said:

Oh dear!! does all this mean my dial thingies that all work with lovely needles are soon going to stop working ☹️ Will I no longer be able to see my water temp is exactly where it should be and so too my oil pressure and that my batteries are charging/charged without " Going Digital " :ninja:

One thing you see in the professional digital helm is that the gauges emulate the needle type when it’s a lot better to have bars as it’s easier at a glance to see if all is okay on a lot of multiple gauges.

Share this post


Link to post
Share on other sites
20 minutes ago, Robbo said:

One thing you see in the professional digital helm is that the gauges emulate the needle type when it’s a lot better to have bars as it’s easier at a glance to see if all is okay on a lot of multiple gauges.

On one of the older helicopter types I flew with dial-type instruments, the system instruments were rotated so that the needles all pointed to the 12 o’clock position when the readings were normal. That way you could tell at a glance if any of the system instruments were abnormal.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.