Convert 0-5v square wave to sine wave

Thread Starter

SonOfAnarchy ZA

Joined Jul 13, 2011
45
Hi guys and girls I am struggling with my latest project:(

I have a speedometer that I would like to convert from a speed sensor to a GPS. I have already got an Arduino and managed to get the GPS board to work with it, the issue is getting the Arduino to control the speedometer. The speedometer requires a sine wave between 40hz and 800hz and can go as low as 2v. The Arduino obviously only give out a square wave so I'm not sure on what the next step needs to be. I've come to the conclusion I need some sort of digital to analogue converter. I found this https://www.robotics.org.za/AF935?search=d/a not sure if it is going to do the trick.

Any feedback would be greatly appreciated.
 

Alec_t

Joined Sep 17, 2013
14,313
The speedometer requires a sine wave between 40hz and 800hz and can go as low as 2v.
I'd be surprised if the speedometer is particularly fussy over the waveform, although it may be expecting a dual polarity input, such as would come from a typical inductive sender. Have you tried sending a square-wave signal via a capacitor to the speedo?
 

dendad

Joined Feb 20, 2016
4,476
have you tried the spedo on a square wave? It may work ok on a square wave.
Or a square wave filtered a bit.
Or a square wave driving the spedo via a transformer, or......

But what is the input impedance of the spedo? Can a port on the Arduino drive it directly or will you need a buffer amp?
If a sine wave is needed, the PWM out of an Arduino may deliver it.
There are a few way to go about driving it.
You need to find out a bit more info on the spedo drive requirements I think.
 

Thread Starter

SonOfAnarchy ZA

Joined Jul 13, 2011
45
Ok seems the speedo works with a square wave as well but when I program the Arduino to give out a tone the speedo does nothing. When I check the output on the oscilloscope the square wave is static whereas my generator the square wave moves( not sure if I''m explaining this correctly)
 

dendad

Joined Feb 20, 2016
4,476
Ok seems the speedo works with a square wave as well but when I program the Arduino to give out a tone the speedo does nothing. When I check the output on the oscilloscope the square wave is static whereas my generator the square wave moves( not sure if I''m explaining this correctly)
It may be you need an amplifier as the Arduino cannot drive very much.
What is the voltage from your generator when connected to the spedo?
When you say the square wave is static, is it a square wave at a fixed frequency or just a straight line?
If a straight line when connected to the spedo, but a square wave when not connected, that shows you need some sort of buffer to increase the current drive available.
 

Thread Starter

SonOfAnarchy ZA

Joined Jul 13, 2011
45
I'm not getting a voltage out of my generator at all and it is a fixed frequency. the Arduino give 2.5v and the wave remains the same when connected to the speedo
 

dendad

Joined Feb 20, 2016
4,476
If you are driving the speedo with the generator, you must be getting something out. Probably AC and that may read 0V on a DC meter.
And a 50% square wave of 5V will read 2.5V.
But some clarity is needed. What is the "generator"?
Ana the speedo?
Those names cover a vast selection of stuff.
Can you post pictures?
 

dendad

Joined Feb 20, 2016
4,476
Maybe you can use an LM386 audio amp to raise the 2.5V AC to the required level.
I'm off to bed now as it is getting later here. Please post what you decide to do.
 

Thread Starter

SonOfAnarchy ZA

Joined Jul 13, 2011
45
Don't think the voltage is the issue think it needs an AC signal. I took my generator as low as 1.3vac and the speedo still worked where the Arduino gives a DC signal @ 2.5v
 
Top