Arduino AC Signal Creation

Hello all,

I am new to this and need some help.

My project needs to create a 6v AC signal replicating what is shown in the picture.

The signal is the AC from an inductive sensor on a flywheel and peak to peak of the waveform shows 1 revolution.

I would be very grateful for any help or guidance

Kind regards,
Max

You can not generate a negative voltage with an Arduino. You can not generate a 10V output, either.

You'll need an op-amp to generate that high a voltage swing.

Mr. Google can tell you about Arduinos and sine wave output, and other wave forms.

Thank you for your reply!

I have looked into op-amps and I can get an understanding of how they work.

I have also now created a pwm of the signal to supply an op amp with.

My question is that can the arduino vary the voltage during a PWM?

In my attached image from the first post I want to create the higher voltage spike at beginning/end of crankshaft revolution.

Can I run the PWM at 4.5 volts then one at 5 volts to create the spike?

Many thanks!

Max

My question is that can the arduino vary the voltage during a PWM?

[u]PWM[/u] switches between 0 and 5V and you can control the duty cycle to control the average voltage.

You can filter/average the voltage to get variable DC (or AC if the PWM frequency is much higher than the AC frequency). But that's NOT a great way to do it... A digital-to-analog converter (DAC) is a better way to do it. (The "standard" Arduinos have an ADC but no built-in DAC.)

Okay I understand.

If I used my PWM output to create the 'average voltage' using the duty cycle. This signal then into a DAC and then into an Op-Amp?

This will create my AC signal matching what I need in the first post?

Will the reaction time with these 3 components be quick enough? The voltage switches from roughly +6v to -6v in 0.5 micro seconds.

Many thanks!
Max

If I used my PWM output to create the 'average voltage' using the duty cycle. This signal then into a DAC and then into an Op-Amp?

While it will have an average voltage determined by the duty cycle this will have no effect on the peak voltage and so will not affect anything.

This is an X-Y problem, why do you want the waveform you claim and what impedance does it have to be? that means what current are you expecting this signal to drive?

This will create my AC signal matching what I need in the first post?

To create an AC signal you will need to have a split supply to drive the op amps. That is one with a +12 ground and -12 V output.

Hi Mike, Thank you for your reply!

The signal is not driving anything and it is simply and indication of the crankshaft speed of an engine, read by the engine ECU.

I am wanting to create the signal to fool the vehicle ECU into thinking the engine is running when it isn't.

Max

The signal is not driving anything

I am wanting to create the signal to fool the vehicle ECU into thinking the engine is running when it isn't.

So the signal is driving an ECU.
The shape therefore is not going to matter but the amplitude needs to be above the minimum amplitude to drive the ECU, which may or may not be what you see when you look at it. The ECU will be looking at the frequency to know what speed the engine is doing.

However this is a closed loop system so the ECU will expect to see some response when it alters other parameters like the mixture from the carburettor. So just a simple fixed frequency might just whack all the other outputs high and not leave you with a system configuration that is useful.

So why do you want to trick the ECU into thinking the engine is running?

So the ECU is an EDC15 ECU running the Land Rover TD5 engine.

The vehicle has had an engine transplant replacing the TD5 engine with a BMW M57 engine, so now the engine ECU is not communicating to the body ECU that the engine is in a running state.

The rpm output from the BMW ECU is a square wave 12 volt signal.

My aim is to replicate the TD5 crank signal into the ECU dependent on the frequency of this 12v square wave from the BMW ECU.

I have already tested that the crank shaft speed signal is all that is needed by jumping a wire from another running TD5 engined Land Rover to the ECU in the transplanted vehicle.

This signal gets altered by the TD5 engine ECU and is an output to other vehicle ECU's such as the leveling suspension, traction control etc.

Hope that clears it up?

Thanks!

Max