How to level shift a square wave output in an motorcycle application?? - Page 1
Forum section: electronics / projects

author: rbm
author_rank: Regular Contributor
timestamp: April 13, 2018, 01:36:06 am
content: Hi,I have designed and builta RPM conditioning circuit for a motorcycle enginethat will take the input from the primary side of the coil and change it to a +12V square wave for input into an aftermarket gauge.Most gauges on the market expect to see a square wave input of at least +5V and duty cycle of between 10% - 80%. However, one particularly popular gauge seems to want its RPM input to be at least -5V relative to ground! On a motorcycle, I don't have a source of power that is negative relative to the frame of the vehicle, so I am in a quantry to figure out how I will level shift the output of my circuit to make it compatible with this gauge.Does anyone have ideas?

author: NiHaoMike
author_rank: Super Contributor
timestamp: April 13, 2018, 01:41:56 am
content: A capacitor and diode can be used to allow the signal to swing negative.

author: james_s
author_rank: Super Contributor
timestamp: April 13, 2018, 01:56:34 am
content: You might look at the schematic for Megasquirt, it's an open source EFI system that is capable of taking an RPM signal from a variety of ignition systems. Internally it conditions that signal to be read by a microcontroller so you could probably lift that circuit and use it for your own needs.

author: rbm
author_rank: Regular Contributor
timestamp: April 13, 2018, 01:57:20 am
content: What I've seen of diode - capacitor level shifter presumes that the input signal is swinging +/- relative to a zero reference. It adds a positive DC offset so that the signal is shifted. In my case, I need to do the opposite -- move a positively biased signal to swing symmetrically around a zero reference. Will this circuit work?

author: floobydust
author_rank: Super Contributor
timestamp: April 13, 2018, 02:42:23 am
content: Are you sure it's a -ve trigger voltage the gauge requires? Is it expecting a coil primary signal?I think you can make the -ve pulse with a differentiator (capacitively coupled) input section.But your engine-speed detector might have a long time constant on the rising edge but fast on the falling edge. Perhaps the output pullup resistor of your engine-speed detector is too big.

author: Nerull
author_rank: Frequent Contributor
timestamp: April 13, 2018, 04:49:36 am
content: Quote from: rbm on April 13, 2018, 01:57:20 amThe capacitor isolates the signal and allows biasing to any voltage you like, including zero.

author: rbm
author_rank: Regular Contributor
timestamp: April 13, 2018, 11:20:31 pm
content: Quote from: floobydust on April 13, 2018, 02:42:23 amI'm pretty certain it's expecting the signal to transcend past 0V and into the negative region. I have a feeling that the gauge is expecting a zero crossing. I programmed the SQR signal from my FY3224 signal generator to simulate that which my conditioning design puts out (a positive only signal (12V, negative pulse to ground potential with 2mS duration). With this signal, nothing happens with the needle. I then began to add a negative DC offset into the waveform using the Offset feature of the FY3224, and as I transitioned to -5V offset voltage, the needle suddenly responded. I continued to apply -ve offset, all the while the needle responding. As I removed offset voltage, the needle went dead at -4V offset.It might be expecting a coil primary trigger, but one person I know of has ruined their gauge by connecting it to the coil primary. That signal is a 80V positive spike. There is no negative going component as you can see in the scope photos on the web page I linked in. It is possible that the correct signal could be generated if the owner connected the input to a wire wrapped several times around the #1 cylinder spark plug wire. Maybe this is what the manufacturer expects. Who knows? The manufacturer and retailers don't publish any specs whatsoever.Quote from: floobydust on April 13, 2018, 02:42:23 amI'm feeling the 10K pullup is too large and it should be closer to 1K. I'm a hobbyist and not familiar with the differentiator circuit you are proposing.

author: floobydust
author_rank: Super Contributor
timestamp: April 14, 2018, 12:10:26 am
content: I would take the tach apart and see what the input circuit is like-ve pulse could be needed if the tach is designed to connect directly to a variable reluctance (mag pickup) sensor, they output AC voltage at several volts p-p. But we do not have that.I added a 0.22uF film capacitor between your tach conditioner and the gauge.At rest, the cap charges to 12V through the pullup resistor on the transistor collector.When the tach conditioner transistor turns on, the cap discharges into the tachometer giving a -ve 12V pulse for the 2msec burn time. Between sparks the cap charges again, giving a +ve blip to the tachometer input.This what I would try and experiment with, to keep things simple, assuming the tach likes low voltage AC.

author: rbm
author_rank: Regular Contributor
timestamp: April 14, 2018, 02:04:21 am
content: Thank you very much Floobydust! That suggestion worked great.