AD9850 DDS with speedometer stops around 120kmh

Hi,

I have a volvo 240 that has a analog speedometer powered by a electric pcb that needs a input of sine wave frequentie to driven the needle.
I'm working on a Arduino Uno project with a Neo M8N GPS and a AD9850 DDS. All works well untill around 120kmh. I figured out with a simple sketch that the speedometer reads up to 193Hz (193Hz ~ 120kmh). After 193Hz the needle of my speedo drops down to zero and does nothing.
Does someone know why it wont read after 193Hz?

Usefull links: Speedo diagnostics

The AD9850 DDS is connected via arduino 5V and Ground
Sine wave output to speedo.

Simple sketch:


const int W_CLK = 8;
const int FQ_UD = 9;
const int DATA = 10;
const int RESET = 11;

// Setup
void setup() {
// Arduino setup port direction.
pinMode(FQ_UD, OUTPUT);
pinMode(W_CLK, OUTPUT);
pinMode(DATA, OUTPUT);
pinMode(RESET, OUTPUT);

// Init AD9850
pulseHigh(RESET);
pulseHigh(W_CLK);
pulseHigh(FQ_UD);  // Enable serial mode - Datasheet page 12 figure 10
}

// Loop
void loop() {
sendFrequency(193);  // freq 
while(1);
}  // end loop

/******************************** Functions ****************************************/

// Toggle a pin.
void pulseHigh(int pin) {
digitalWrite(pin, HIGH);
digitalWrite(pin, LOW);
}

// transfers a byte, a bit at a time, LSB first to the AD9850 via serial DATA line
void tfr_byte(byte data)
{
for (int i=0; i<8; i++, data>>=1) {
digitalWrite(DATA, data & 0x01);
pulseHigh(W_CLK);   //after each bit sent, CLK is pulsed high
}
}

// Set the desired frequency.
// frequency calc from datasheet page 8 = * /2^32
void sendFrequency(double frequency) {
int32_t freq = frequency * 4294967295/125000000;  // note 125 MHz clock on AD9850
for (int b=0; b<4; b++, freq>>=8) {               // Send 4 words to AD9850
tfr_byte(freq & 0xFF);
}
tfr_byte(0x000);   // Final control byte, all 0 for AD9850 chip.
pulseHigh(FQ_UD);  // Frequency update, output is set.
}

If these are all connections I doubt that you get any signal output.
Post a complete wiring diagram!

If I have to guess with that low information: The 5V signal isn't powerful enough at your 193Hz. Scale it up to 12V and you might get better results.

The 12V comes from the car battery that drives the speedometer.

I hope you understand my poor paint skills.

Anyone...?

Hi, @Nique88

Did you try the squarewave output?

@pylon suggestion that you may need 12V pulses would be a valid point.

Tom.. :smiley: :+1: :coffee: :australia:

I don't think I need square wave because of the information in de link I posted.
I don't get it and it frustrates me...

Can you monitor the input to the speedometer with an oscilloscope?

The document at the link you supplied in the OP seems to imply that the voltage on the G pin of the speedometer should be of the order of 250mV RMS, (however, it is not completely clear what the measuring points are). If you are driving it at 5v, that is 20 times more. Maybe try a resistor divider to bring the voltage down to that target range.

:frowning: dont have an Oscilloscope :frowning:

@6v6gt I'm going to give that a try

I’m wondering how you know that the signal to the speedometer doesn’t just stop at >193 Hz?

Thanks @6v6gt ! because of you I went in the right direction.
With a multimeter I read 350mV AC voltage between the G and ground from the output of the DDS.
I placed a 47 ohm resistor between the G and the ground. The output AC was then 160mV.
Now the speedo will go up to 220 kmh. Thanks a lot!

I added the sketchy scheme with the resistor.

@EmilyJane I checked that with a multimeter.

For those who are interested how it looks when I send 30hz, 100hz, 200hz and 300hz.

Volvo 240 speedo with AD9850 DDS module

OK. Well it seems to work but the 47 Ohm resistor may be a bit harsh (~100mA at 5 volts). Something like this may suit better:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.