Controlling an analog dash

Introduction and miscellaneous that we haven't created categories for, yet
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Controlling an analog dash

Post by Greenbeast »

My conversion vehicle is from 1997 and pretty basic.
I'm looking for information on controlling the stock dash dials, The tacho has a cable from the gearbox/Tcase that i'm retaining, but i'd like to run the temp gauge, fuel gauge (admittedly this won't be a terribly accurate way of seeing SoC) and speedo.
I gather this will probably involve an arduino unless there are off the shelf devices that will do this for me.

Can someone point me to products or projects that tackle this please?
User avatar
joromy
Posts: 371
Joined: Fri Jun 28, 2019 12:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Controlling an analog dash

Post by joromy »

I have done it with a teensy. CAN bus controlled from simp BMS and openinverter,
viewtopic.php?f=16&t=433#p4880

https://github.com/jomytec/Teensy-CAN-b ... ller-in-EV
Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

That looks very nice. I may well use this to control the (analogue) instrument cluster on my bike conversion...
DaveH
Posts: 91
Joined: Sat Jun 13, 2020 9:04 am
Location: Hull, UK
Has thanked: 1 time
Been thanked: 8 times

Re: Controlling an analog dash

Post by DaveH »

I am also planning to use a Teensy over CAN as I have used one before. Low down on my to-do list though. I have some 52mm VDO gauges that I installed for the engine and it would be nice to control these as well if I can somehow make some replacement faces for them with different markings.
User avatar
FJ3422
Posts: 113
Joined: Fri Jul 10, 2020 9:55 am
Location: Netherlands
Been thanked: 1 time

Re: Controlling an analog dash

Post by FJ3422 »

Regarding the Temp gauge & fuel gauge; most commonly this are resistive sensors to ground, so easy replacable by a PWM-signal to ground.

Speedo / Tacho has some electronics integrated. Speedo usually needs a variable frequency square wave (can easily be generated with an arduino) as well as the Tacho. If they are not as smooth / dynamic as you would like them to have; just directly drive both the Sin/Cos coils of the moving-magnet device by an arduino. Just like I did: viewtopic.php?f=11&t=1237
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

I just checked my temperature gauge and it needs between 470R and 10R to ground for the full range. Maximum reading corresponds to ~65mA, so that should be easy enough to achieve via a low-side PWM from an Arduino.
IMG_0330.jpg
I'm not sure what to do with the mechanical tacho. That may need to be replaced with a circular electronic display...
IMG_0332.jpg
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Controlling an analog dash

Post by LRBen »

What car are you converting?

I have been looking into the MG F dash on my project in the last few days. It is also pre-canbus. Most of the gauges are controlled by resistive sensors to ground as FJ3422 said. My RPM gauge is controlled through one of the engine sensors, and in my case gives 2 square wave pulses per RPM. This I am going to replicate this with an arduino or something similar, reading the motor RPM from the inverter.
My speedo is run from a sensor in the wheel hub, so that will remain.
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

Well, that was fun. PWM works like a charm! :D


Code couldn't be simpler:

Code: Select all

int meter_pin = 6; 
int meter_value;
const int min_blue = 0;
const int low_blue = 75;
const int middle_blue = 150;
const int high_blue = 175; 
const int red_start = 200;
const int red_max = 255;

void setup() {
  Serial.begin(115200);
  pinMode(meter_pin, OUTPUT);
}

void temperature(int meter_value) {
  analogWrite(meter_pin, meter_value);
  Serial.println(meter_value);
}

void loop() {
  temperature(min_blue);
  delay(10000);
  temperature(low_blue);
  delay(10000);
  temperature(middle_blue);
  delay(10000);
  temperature(high_blue);
  delay(10000);
  temperature(red_start);
  delay(10000);
  temperature(red_max);
  delay(10000);
}
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Controlling an analog dash

Post by arber333 »

clanger9 wrote: Fri Jan 01, 2021 7:46 pm IMG_0330.jpg

I'm not sure what to do with the mechanical tacho. That may need to be replaced with a circular electronic display...
See what i made. Maybe you can use it too.
https://leafdriveblog.wordpress.com/202 ... edo-works/
https://leafdriveblog.wordpress.com/202 ... r-working/
viewtopic.php?f=9&t=52&start=25#p10772
It works for speedo as well as RPM. I still need to adapt my SOC meter to fuel dial.
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

Excellent guys, thanks
LRBen wrote: Fri Jan 01, 2021 8:07 pm What car are you converting?
A Daihatsu Fourtrak, it's delightfully basic for a car that's only 23 year old and has only done 46k miles on ICE.

I will pull the cluster from my test mule vehicle and start playing with arduinos
LRBen
Posts: 474
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 43 times
Been thanked: 107 times

Re: Controlling an analog dash

Post by LRBen »

Greenbeast wrote: Sat Jan 02, 2021 7:34 am A Daihatsu Fourtrak
Ah they are great little vehicles. My father in law had one on the farm for a few years. It's currently sitting in the corner of the yard with a broken axle or something like that. Looking forward to seeing how you get on with it.
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

Yeah i love it, i bought another as soon as my first one started to show it's age and wasn't worth maintaining, even tried selling the first before now but glad it never went as it's a perfect test bed while i daily drive the better one.
Great 4x4/offroad capability and seats 5 (technically seats 7 in fact but i'm just looking to retain seating for 5), i'll post a build thread when i get to the first electric/motor stuff i think, i've stripped the drivetrain from the test mule and the fuel tank is half out (rusted bolts).
I might bring the instrument cluster indoors to start working on that of an evening
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

Time to get started
IMG-20210102-WA0005.jpeg
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

clanger9 wrote: Fri Jan 01, 2021 9:16 pm Well, that was fun. PWM works like a charm! :D


Code couldn't be simpler:

Code: Select all

int meter_pin = 6; 
int meter_value;
const int min_blue = 0;
const int low_blue = 75;
const int middle_blue = 150;
const int high_blue = 175; 
const int red_start = 200;
const int red_max = 255;

void setup() {
  Serial.begin(115200);
  pinMode(meter_pin, OUTPUT);
}

void temperature(int meter_value) {
  analogWrite(meter_pin, meter_value);
  Serial.println(meter_value);
}

void loop() {
  temperature(min_blue);
  delay(10000);
  temperature(low_blue);
  delay(10000);
  temperature(middle_blue);
  delay(10000);
  temperature(high_blue);
  delay(10000);
  temperature(red_start);
  delay(10000);
  temperature(red_max);
  delay(10000);
}

So this code just loops through those rough zones with 10s intervals
Can you show me a circuit diagram so i can test my dial here.
I don't need speedo as that's controlled with a gear in the gearbox, but i do need temp, fuel and tacho
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

Sure, it's just a 2N2222 transistor as a low-side switch. 1k resistor from Arduino pin 6 to B. E to GND and C to the temperature gauge input.
The gauge itself is powered from 12V power supply. I can do a quick sketch tomorrow...

Probably wise to characterise the gauge with a multimeter & some resistors first. I found that the maximum current draw (with the sensor gauge input shorted to earth) was 75mA - so well within the transistor rating.
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

That would be much appreciated, i'm a bit of an arduino tinkerer but also a bit out of practice
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

I was lucky enough to find a full service manual recently, the dash circuit diagram doesn't line up completely accurately with my dash and myb tracing of the pins (assume it's for an earlier version of the vehicle), but i'm kinda guessing the temp/fuel senders and gauges didn't change

Temp Gauge
Temp Gauge.png
Fuel Gauge
Fuel Gauge.png
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

Looks good - that should work fine with PWM.

Behold, my first KiCAD schematic! :) Every day's a school day...
Arduino gauge test.png
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

This might be a more useful test setup (on a roll now...)
This is what I used to characterise the gauge. It adds a potentiometer so you can set the gauge to any value. The value is shown on the serial monitor.

NOTE: if you're using a 3.3V Arduino (e.g. Due or Teensy) DO NOT connect the high end of the pot to 5V as shown in the diagram. It needs to be connected to 3.3V, otherwise you will damage your board...
Arduino gauge test with pot.png
IMG_0338.jpeg

Code: Select all

int meter_pin = 6; 
int meter_value;
int setpoint_pin = A0; 
int setpoint;

void setup() {
  Serial.begin(115200);
  pinMode(meter_pin, OUTPUT);
}

void temperature(int meter_value) {
  analogWrite(meter_pin, meter_value);
  Serial.println(meter_value);
}

void loop() {
  setpoint = analogRead(setpoint_pin);
  setpoint = map(setpoint,0,1023,0,255);
  temperature(setpoint);
  delay(100);
}
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

Nice one thanks! Need to see if i have any 2n2222's around, everything else i have
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

Pretty much any NPN transistor will do. What have you got?

Only thing to check is the maximum current draw with the gauge input shorted to earth (using a multimeter). Hopefully <100mA.
If it's anywhere near the transistor's maximum current rating, you'll need to put a current-limiting resistor in there...
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

clanger9 wrote: Sun Jan 03, 2021 10:19 am Pretty much any NPN transistor will do. What have you got?

Only thing to check is the maximum current draw with the gauge input shorted to earth (using a multimeter). Hopefully <100mA.
If it's anywhere near the transistor's maximum current rating, you'll need to put a current-limiting resistor in there...

I'll hunt around amongst my bits and abandoned projects in a bit, i'm sure i've used one for something in the past.
Unfortunately my dmm doesn't have an ammeter, it's a fluke but pretty much they're cheapest offering
User avatar
clanger9
Posts: 203
Joined: Mon Oct 28, 2019 7:41 am
Location: Chester, UK
Been thanked: 1 time
Contact:

Re: Controlling an analog dash

Post by clanger9 »

https://www.ebay.co.uk/itm/DT-830B-Digi ... SwUElcmu~b

£3.30 for a whole multimeter! :lol:
Cheap 'n' nasty, but can't fault the price...
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

Can't find any bloody transistors, i have a feeling i'm missing a bunch of stuff somewhere. So i'll order some bits in.

Do i need a teensy for CAN interfacing? I know the car doesn't have it, but between charger/inverter and BMS i'm assuming there will be CAN in the future.

Trying to think of other little bits i'll need to get get the cluster working
Greenbeast
Posts: 115
Joined: Sat Dec 26, 2020 5:44 pm

Re: Controlling an analog dash

Post by Greenbeast »

I actually have a handful of arduinos hanging around, can i do CAN with those exclusively? So i can get the board working and running the cluster and ready for CAN input from other devices and then add in those connections and data as and when the build progresses?
Post Reply