Go Down

### Topic: Controlling an analog automotive tachometer (Read 11403 times)previous topic - next topic

#### Twizted

#15
##### May 02, 2012, 12:20 am

BenF is right, 3000Hz is far too high. Use the calculations he provided, or to put is another way, frequency = RPM * cylinders/120.

Your equation yielded the proper results albeit the needle only got close to the given x1000 which I sort of expected given the quality of this gauge (it was SUPER cheap)....

Below is the code I used and I sent the signal through a simple 4N25 Opto I had laying around to isolate the arduino from the rest of it...

Code: [Select]
`void setup()  {   pinMode(9, OUTPUT);} void loop()  {     tone(9, 33.3333333333333);    delay(2500);    tone(9, 66.66666666666667);    delay(2500);    tone(9, 100);    delay(2500);    tone(9, 133.3333333333333);    delay(2500);    tone(9, 166.6666666666667);    delay(2500);    tone(9, 200);    delay(2500);    tone(9, 233.3333333333333);    delay(2500);    tone(9, 266.6666666666667);    delay(2500);    noTone(9);    delay(2500);}`

#### justjed

#16
##### May 02, 2012, 02:35 am

I am glad you got it working. I am just curious, did you have a datasheet ? Others maybe interested doing the same thing.  Even me, I may add a tach for my car.

I haven't looked at the OBDuino and similar, but a tach-out signal would be a nice addition, if there isn't such a function already. Adding a tach to a Ford Focus is either easy or hard. I've found multiple differing "guides" on how to do it, but most of them involve an adapter which IIRC hooks up to the coil, or DIY renditions of the the same. I assume that if you hook up to the CANbus, tach info is there someplace.
... it is poor civic hygiene to install technologies that could someday
facilitate a police state. -- Bruce Schneier

#### Techone

#17
##### May 02, 2012, 08:02 pm
Thank for the tips, justjed, I have to look into the Ford Focus Can Bus to have the tach signal.  Hum... by just thinking about it, when my car was being tested for emissions require by the Ministry of Transportation - Ontario, the tech only connect the CAN bus to a computer system and can read all the info when the car run on a tread mill.

Yes, it is possible... I will do a search about it. I will look at the book "Haynes Repair Manual" Ford Focus 2000 to 2005.

BTW, justjed, my car is fix, \$3000 for a 60 000 km motor. ( include installation ).  Just to let you know. The motor fail around 150 000 km.

My car is fine now, BTW

#### Strat067

#18
##### Nov 16, 2015, 02:52 am
I am trying to recreat this with a Tach I got from Summit. The tone function works well, however when I try to lower the tone signal frequency enough to get under 500rpm it starts to freak out. at 30hz I am at 500 rpm, at 29 hz I am pegged out on the tach. I tried to switch to the following code:

void loop() {
digitalWrite(8, HIGH);
delayMicroseconds(1000);
digitalWrite(8, LOW);
delayMicroseconds(1000);
}

and as I play with the time delay, I run into the same issue where its either 500 rpm, 0, or pegged out as I lower the frequency. Is it something with my signalling that once I get a square wave that is slow enough the tach can't handle it?

#### drjohnbullas

#19
##### May 06, 2016, 06:26 pm
[May 2016]

I am trying to emulate the rotation of a speedometer cable to correct for a change in wheel diameter and gearbox and adjust BUT in passing I must observe that as soon as the tachometer becomes an integral part of a complex loom and the vehicles ancillaries start to become "sentient", tapping off wires to trigger/stimulate additional gizmos becomes problematic.

As the owner of a Honda Jazz with little more complex than a rev counter I have decided that displaying coolant temperature and lambda with this is best achieved via a bluetooth odbcII adaptor and a spare 7" tablet... if there is a way to tap into the odbcII with an arduino to grab into I would love to hear about it!

#### drjohnbullas

#20
##### May 06, 2016, 06:45 pmLast Edit: May 06, 2016, 06:56 pm by drjohnbullas
Tachos on a lot of older (pre 1990's) vehicles such as mine take a feed from the low tension side of the ignition coil and the waveform of the 0v/12v is a function of the type of coil and ignition controller being used (optical, points or points assisted), you may find some feed 0/12v when the starter is turning and 0/9v running (ballasted coils)!

https://www.fairchildsemi.com/application-notes/AN/AN-8208.pdf is a good read nonetheless

#### Billdefish

#21
##### May 06, 2016, 09:28 pm
The Tone() library cuts out around 30hz so that is likely why you are having issues at that level.

Bill

#### substatica

#22
##### Dec 14, 2016, 09:00 pm
I'm attempting to accomplish the same thing here with a Faria 5000 RPM 8 Cylinder Marine Gauge, however I can't get the gauge to read more than 1500. I'm using a 2SC3503 transistor and a 4148 diode. I've tried a number of sketches using tone(), analogWrite() and digitalWrite() with delayMicroseconds() but I've not been able to get the gauge higher than 1500.

tone(9, 29); gets it up to 1500 and tone(9, 14.5); seems like it's maybe half, but other multiples don't work. Any ideas?

#### substatica

#23
##### Dec 14, 2016, 11:52 pmLast Edit: Dec 15, 2016, 03:38 am by substatica
Switched to a 2SC1624 with a 1k resistor to the Arduino PWM and I can get it up to 3000 now, but can't reach 4000 or 5000.

I've fried a couple 2N3904's already. If I lower the resistor value between the PWM and the base to 680ohms I can get the gauge to max, but I think it's frying the circuit in the process. With 1k things seem stable but I can't max the gauge.

#### allanhurst

#24
##### Dec 15, 2016, 04:55 amLast Edit: Dec 15, 2016, 06:43 am by allanhurst
I'm surprised you can fry a 2N3904 with a current limited pwm signal at the base and 10mA max on the collector - how exactly are you wiring this ? ( please post a diagram)....

Some modern revcounters ( and other analog readouts) use quadrature meters - these have 2 coils at right angles. You need to drive them with sin and cos of the required angle of the meter.

Rather different....

I've done this for a revcounter on  my daughter's boat using the ripple of the alternator as the input signal , and a pro-mini with a bit of signal conditioning.  Works fine.

Another sort have a similar quadrature motor, but then a gear train to the needle spindle, such that so many pulses from the '0' position are required to get the needle to the required position - ie a little stepper motor. 1/4 turn per step.

This sort are driven negative for many pulses at start-up to get the meter to a known '0' position against a mechanical end stop,  then up/down as required from there to get the wanted display position  .

A bit like the ancient Smiths chronometric speedos from the 1950's.

Again, rather different....

regards

Allan

#### substatica

#25
##### Dec 15, 2016, 02:00 pmLast Edit: Dec 15, 2016, 02:12 pm by substatica
This gauge is vintage, not modern, pretty sure it's off of a diesel power boat and is marked as 8 cylinder. You can see the exact same gauge here,

http://www.ebay.ca/itm/NOS-Vintage-FARIA-8-CYL-5000-RPM-Tachometer-Thomas-G-Faria-MARINE-/322252186561

You can see the gauge being driven by the circuit here,

https://www.instagram.com/p/BOA7U58hUDo/

The circuit is attached. The gauge has a ground and lead for the lamp and two leads for the signal. Thanks.

#### allanhurst

#26
##### Dec 15, 2016, 07:06 pmLast Edit: Dec 15, 2016, 07:38 pm by allanhurst
You'll need a current limiting resistance in series with the movement. Your direct connection probably explains why you blew up 2N3904's.

And may not have done the meter itself much good ,through overcurrent

And you will probably need a regulated  + 12 or other voltage.

Measure the meter resistance with an ohmeter - what does it say?

regards

Allan

#### substatica

#27
##### Dec 15, 2016, 09:44 pm
Quote
You'll need a current limiting resistance in series with the movement. Your direct connection probably explains why you blew up 2N3904's.
You mean between the transistor and the gauge itself? After the diode or the other lead? Resistance of the gauge leads is nil -- or less than 1ohm. That's the same as another of the exact same gauge I've not touched.

Does that mean I should be running between one of those gauge leads and the gauge lamp ground instead?

Hooked up to the boat's control panel this gauge had a yellow wire running across both of the leads and a white to both lamp leads.

#### allanhurst

#28
##### Dec 15, 2016, 10:57 pm
See the enclosed.

The value of R2 depends on the meter sensitivity ( how many mA for fullscale ) and it's own internal resistance, and the supply volts..

regards

Allan

#### substatica

#29
##### Dec 15, 2016, 11:26 pm
The value of R2 depends on the meter sensitivity ( how many mA for fullscale ) and it's own internal resistance, and the supply volts.
When I add R2 the only time I get meter movement is when the resistor starts to smoke.

Go Up

Please enter a valid email to subscribe