1
\$\begingroup\$

For a project I need a zero crossing wave like this

enter image description here

Its generated by an inductive coil of a distributor of a car engine where that signal triggers a CDI (capacity discharge ignition) when it falls from positive to under -0.3v.

My target is to reproduce or at least mime such a zero crossing wave with a PWM wave using an Arduino Nano in a car environment.

In the circuit below I tried this by using a 2N3904 NPN transistor where the -5 volt are provided by an ICL 7660.

enter image description here

But with this circuit it results only in a +1v/-1v PWM (screenshot below) and not in a +5v/-5v PWM … actually a +2.5v/-2.5v PWM would be sufficient.

enter image description here

My question is: how can that circuit above be optimized to get at least a zero crossing +2.5/-2.5v PWM.

Thanks a lot in advance and sorry for the first complicated question attempt.

\$\endgroup\$
7
  • \$\begingroup\$ You need to ask a question. \$\endgroup\$ Commented Aug 16, 2020 at 13:51
  • \$\begingroup\$ My question is, how the circuit above can be optimized, as that simple 3904 way as I used above shurely is a very poor way. Many thanks. \$\endgroup\$ Commented Aug 16, 2020 at 14:19
  • \$\begingroup\$ It's unclear in what direction optimization will be regarded as producing a better signal. Only you know that. You haven't really explained what the ideal signal is that you need and, you need to put this information in your question and not in comments. Do you mean a 2N3904 transistor? Is your lower graph an optimized or ideal signal? What makes it ideal if it is? \$\endgroup\$ Commented Aug 16, 2020 at 14:25
  • \$\begingroup\$ I'm having a hard time following what optimization is also please edit the question \$\endgroup\$ Commented Aug 16, 2020 at 15:15
  • \$\begingroup\$ Question edited and hope its more clear, thanks a very lot and sorry. \$\endgroup\$ Commented Aug 16, 2020 at 21:53

2 Answers 2

1
\$\begingroup\$

If you want to convert the 5 V PWM signal to the + - 5 V PWM, this is an option: pwm5

It would be a little more complicated to make a + -3V PWM signal: pwm3

\$\endgroup\$
2
  • \$\begingroup\$ thanks a lot, thats what I needed. Only one more question. I think then 0-5v PWM signal here on the very left should not be the one directly provided by the digital ouput pin of the Arduino ... but better from a (7805) 5v supply where this will be switched by also a 2N3906 driven by the Arduinos digital pin PWM? \$\endgroup\$ Commented Aug 16, 2020 at 22:07
  • \$\begingroup\$ The 0-5 V PWM can come directly from Arduino. Nothing is required between the transistor emitter and the CPU pin. \$\endgroup\$ Commented Aug 16, 2020 at 22:19
1
\$\begingroup\$

All we need to generate this signal is a slightly leaky integrator that will remove DC offset over time, and three different voltage levels to control the slope of the integrator output. With a bit of low-pass filtering, the signal will look rather similar to what you want.

The switching between the slope voltages can be controlled with an MCU.

schematic

simulate this circuit – Schematic created using CircuitLab

The signal is not perfectly symmetric after filtering because we only control the first derivative and not the 2nd, but this should do I hope.

enter image description here

A practical realization of this circuit will use CMOS analog switches controlled by digital signals from an MCU. A 4066 will do just fine for this. It's not a hi-fi circuit in any way.

It can also be done without an MCU, in many different ways. One way would be with a counter and a multiplexer - just two extra chips:

schematic

simulate this circuit

CD4060 is an oscillator with a counter, and CD4051 is an analog multiplexer.

The supply pins are not shown. The frequency of oscillation is about 12kHz with values as shown. The circuit has been tested and works as expected.

Supplies are +/-5V. Supply connections:

  • +5V: U1:16, U2:16, U3:8
  • -5V: U2:7, U3:4
  • 0V: U1:8, U2:8

enter image description here

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.