How to increase 5v Square wave signal frequency by 50% - Page 1
Forum section: electronics / projects

author: ONETEN
author_rank: Contributor
timestamp: September 17, 2014, 09:02:53 am
content: Hi Guys,I am hoping someone here can point me into the right area of electronics for a solution to this problem - in short I need to devise a way to increase the frequency of a 5v square wave signal by 50%, or add an additional pulse for every 2 pulses.My application is a Tachometer in a car, originally this car had a 6cyl engine in it, and now it has been converted to a 4cyl.What I have determined is that the Engine computer of the new 4cyl engine outputs 4 x 5v square wave pulses per revolution via the tacho wire, where as the old engine would output 6 pulses per revolution (being a 6cyl). The issue is now the Tachometer reads incorrectly due to being calibrated for 6 pulses per rev as opposed to 4, so it read on average 75% of the correct RPM.750rpm when the engine is actually at 1000rpm1500rpm when the engine is at 2000rpm etc etc.I know of plenty of applications where 6cyl engine computer was fitted to a tacho calibrated for a 4cyl (every 3rd pulse was skipped on output from ECU to Tacho to correct the reading) but in this case I actually need to add an additional pulse for every 2 pulses the engine computer outputs to drive this tachometer accurately.Problem is I don't even know what components are out there to help me do this, most of my experience in electronics is more in PIC and micro controller programming.I had a couple of idea's to use flip-flops or even logic gates, or perhaps a counter but I feel like there has to be a more simple solution i am not aware of.Any pointers on what to look into is greatly appreciated!Thanks,Hayden

author: ludzinc
author_rank: Unknown
timestamp: September 17, 2014, 09:17:36 am
content: Nothing super easy comes to mind.Initial thoughts are x 12 then /8 but thats just messy.But does it have to be done in the digital domain?Some tachos work by rectifying the PWM input. Can you supply a DC voltage to the input (0 - 5V) and drive the needle that way? If so I'd rectify the PWM singal form the tacho and then amplify that with an opamp with a gain of 1.5But then again, after all that, is a 4 cylinder tacho for your car available from the wreckers?

author: ONETEN
author_rank: Contributor
timestamp: September 17, 2014, 09:33:21 am
content: Thanks for the reply.You are spot on asking if it has to be digital - and the answer is no. Its what I am used to and I guess I need to think outside the box a bit more!!No reason rectifying the signal wont work, as technically speaking my device would need to be operating between the ECU and the Tacho, having the PWM Tacho signal from the ECU as a input, and the adjusted output going to the tacho.Let me explain a bit further though:The car in question is a 1978 Toyota Cressida, which only ever came with a 6cyl engine. Sadly a 4cyl tacho doesnt exist to the best of my knowledge.The original 1978 tacho is driven directly from the Ignition coil -ve post, when the coil is saturated by the transistor ignition module (6 times per revolution), the tacho is effectively "driven" at ~12v.The engine is from a Nissan Silvia and is an SR20DET engine, it uses a distributorless multi coil ignition system and therefore the Tacho is driven directly from the ECU with a 5v signal.In terms of rectifying inline, I already have a little circuit that uses a the 5v signal to switch a BC341 to create an inductive charge in the coil from a standard SPST horn relay, which in turn drives the old-style tachometer. If you think I can incorporate an op-amp to amplify the 5v signal coming from the ECU, and therefore drive the tacho 1.5 times faster - then this looks like the answer I was hoping for

author: max_torque
author_rank: Super Contributor
timestamp: September 17, 2014, 09:35:17 am
content: Easiest is just to get the 4cyl tacho!But it's worth checking that the current tacho cannot be "switched" between 4 & 6 cyl mode, sometimes with a jumper link on the pcb, sometimes by using a different input pin etc! (saves the manufacturer having to have two different specs of tacho!)

author: ONETEN
author_rank: Contributor
timestamp: September 17, 2014, 09:44:57 am
content: I wish it were that easy!I did actually think I may be able to recalibrate the tacho itself - problem is I cant find any info on the main IC on the tacho board. Its an NEC "C1006".Some of the resistors reference straight from pins on the IC to ground, but I have no idea what they do :/

author: Precipice
author_rank: Frequent Contributor
timestamp: September 17, 2014, 09:55:39 am
content: Quote from: ONETEN on September 17, 2014, 09:44:57 amNone of them will mind much if you parallel them with a similar value resistor. Time to break out the signal generator and croc clips, and see which (if any) sets the frequency-needle ratio?(There's a reasonable chance that the chip simply watches for a rising edge on an attenuated copy of the coil input signal, and generates a fixed pulse width pulse, which the needle averages out. The more frequently you get an ignition pule, the higher the PWM average, and the higher the needle position.Messing with the pulsewidth (which will probably be controlled by an R and a C), should get you the recalibration you want. Maybe.

author: dannyf
author_rank: Super Contributor
timestamp: September 17, 2014, 10:22:33 am
content: A few options:1) measure the incoming signal's frequency and generate one that's 50% higher;2) use a pll to tripple the signal's frequency and then run it through a /2 divider.3) change the sensor;4) buy a new tacho;5) live with it.

author: Unknown
author_rank: Unknown
timestamp: September 17, 2014, 10:38:59 am
content: Quote from: ONETEN on September 17, 2014, 09:33:21 amPretty sure they were available with a 4 cylinder engine (either the 3T or 18R) here in Aus & NZ, so probably the UK and maybe SA too. Maybe try getting in touch with a club in one of those places to see if they came with a tacho, & compare styles?

author: dannyf
author_rank: Super Contributor
timestamp: September 17, 2014, 10:40:25 am
content: QuoteOne beautiful car - especially the later versions.

author: max_torque
author_rank: Super Contributor
timestamp: September 17, 2014, 10:44:20 am
content: Looking at that IC, it has a heatsink sticking out the side, so drives the gauge coil directly, probably with "current control" vs input frequency. I very much doubt that the actual IC has the ratiometric information hard coded into it, much more likely the ratio of frequency to current is set by an external resistor!

author: rs20
author_rank: Super Contributor
timestamp: September 17, 2014, 10:50:22 am
content: If an analog input works, and all the tach is working from is the mean DC value at its input, then surely just amplifying the square wave by 50% will have the effect that you want?

author: Seekonk
author_rank: Super Contributor
timestamp: September 17, 2014, 11:59:38 am
content: I would trace out that board a little. Couldn't find anything on a search of that chip. These generally work by a pulse triggering a one shot. That pulse is averaged by the meter. Some possible options.That 75 ohm resistor is probably in series with the meter. Decreasing its value a little could boost meter current.The clear glass zener to the right. That may be in parallel with the meter insuring every pulse has the same voltage. Another diode common rectifying diode in series (Reverse direction of the zener) would increase the voltage by .7V and therefore increase meter current.Increasing timing capacitor value would increase pulse width.If you could trace it out just a little and post it I might be able to suggest the beat approach.

author: PA0PBZ
author_rank: Super Contributor
timestamp: September 17, 2014, 12:17:01 pm
content: Found this, it's a C1006C but it looks close:RC between 1 and 8(don't remove the red parts...)

author: ONETEN
author_rank: Contributor
timestamp: September 18, 2014, 04:10:06 am
content: Firstly, thanks everyone so much for the input!! Was a great help.I lurk here a fair bit and I gotta say this community is awesome.So this story has a happy ending, although it would have come sooner had I seen PA0PBZ's post last night! (good work finding that!)Precipice, Max_Torque & Seekonk were on the money, the meter was driven direct from the C1006 IC, even though I dont know what the chip does exactly it made sense that current would be controlled by an external resistor.So I traced out the board, and found the 75ohm resistor on Pin 5 going straight to GND. Set the meter up on the bench and found it was hitting 3000RPM at 99Hz. Logic said to me "well you want to either add or subtract 1/3 of the resistor value to change current limiting by that amount" so first thing I tested was a 150ohm in parralell with the 75ohm (giving 50ohm total) and BINGO! She increased to 4000RPM at 99hz.Quickly worked out after that the following values:50ohm = 4cyl (2 pulses per revolution on a 4-stroke)75ohm = 6cyl (3 pulses per revolution on a 4-stroke)100ohm = 8cyl (4 pulses per revolution on a 4-stroke)Here is a diagram I made up quickly of the circuit (hopefully this helps someone out in the future!), and a few pics of the tacho on the bench, as well as the car in question for those interested!!Cheers for the help guys

author: max_torque
author_rank: Super Contributor
timestamp: September 18, 2014, 10:30:35 am
content: I love it when a plan comes together!Nice work ;-)

author: SeanB
author_rank: Super Contributor
timestamp: September 18, 2014, 05:04:05 pm
content: So who drives the fire engine? Those Cressida's were available her in ZA with a 6 cylinder or a 4 cylinder engine, though the 4 cylinder was the base model, with no tacho, no clock and a 4 speed box IIRC, and the 6 cylinder had the tacho, clock and the options of a 5 speed box or an auto box, along with a factory AC as well.Lovely vehicles, just had differential problems with them as the 6 cylinder was a lot more power than the diff could reliably handle. Detlef went through a few diff replacements because he had a very heavy right foot. those were a very popular police pursuit car in small towns, as they were capable of doing over 220kph as stock. Plus the boot was big enough to hold the gatso camera, tripod, battery, loads of film, beach chair and umbrella and cooler box needed to do revenue sourcing at the town boundary where the speed limit changed.

author: David Hess
author_rank: Super Contributor
timestamp: September 24, 2014, 07:05:24 pm
content: Quote from: dannyf on September 17, 2014, 10:22:33 amLooks like he solved it but this is what I would have done if it was not practical to modify the tachometer itself. A 4046 phase locked loop and some divider logic could handle it just fine.

author: Seekonk
author_rank: Super Contributor
timestamp: September 25, 2014, 02:53:00 pm
content: That 75 ohm is probably in the emitter of the meter drive transistor so it acts like a constant current source for each pulse.It is good to have a fire engine around for any project startup.