Hi Guys,
Having some issues with my circuit and wondering if anyone out there has any good ideas.
For the record, I have very little electronics experience, all self taught, so forgive me for any blindingly obvious mistakes I've made.
I'm generating a phase and frequency correct PWM signal with Timer1 on an Arduino Nano, and outputting the signal on OC1A (PIN D9). I have no problem with this signal. It's exactly what I need.
This square wave then goes through a capacitor/resistor differentiator to produce a positive and negative signal. This works as hoped. I'm quite happy with this signal wave form. It has a very sharp rising/falling edge and the capacitor discharges OK (I think).
The problem arises when I try to amplify this signal through a non-inverting amplifier. I'm using an LM358 or this job. Also tried a TL072 with the same result.
Here's the hopefully understandable circuit.
At node 1 I measured a clean square wave. Frequency is 216Hz. Duty cycle 13%. The voltage flips between 0V and 5V as expected. No problems here.
At node 2 I measured the spikes from the differentiator. The rising edge is fast and the waveform looks good on the scope. Not exactly sure if I'm allowed to do this on an Arduino due to the negative spike, but I ran it for an hour and nothing went bang
I feed this signal into the non-inverting input of the LM358. The sketch shows no resistor on the input. I tried with and without but no difference in the result. The negative feedback should give a gain if I'm understanding things correctly.
At node 3.....This is where it's all going wrong. I was thinking that the rising edge at the output should be a fast rise like the input, but alas this is not the case. The rise is super slow, and the output only rises to about 1V before trailing off back to zero. It takes roughly 10us at the output to go from 0 to 1V and from 0 to -1V.
I must be doing something very wrong.
I also tried the same circuit but with the op amp as a buffer, but the same result.
I haven't tried the op amp as an inverting amplifier. I can try that but I'd rather try to find out why it's doing what it's doing as it is right now. I'm sure that there's a very simple answer, but I've been trying for hours and got no where.
The final output will be the signal for a motorcycle capacitive discharge ignition system (CDI).
I have a somewhat longer version of the circuit I made, in which the pin D9 output fires a 2N7000 mosfet, which in turn fires the differentiator, which in turn goes through a non-inverting amplifier. This does actually work and can run a CDI, but when I scope the final signal it has exactly the same issue with the slow rising edge. I want a fast edge.
Also acceptable is a positive and negative square wave, but I have no idea how to do that. Maybe through a couple of comparators somehow???
Sorry for the long post, but if anyone has any useful tips then I'll be more than grateful.
Happy to give more info if needed (and if I can).
Cheers,'
Matt