Speed output pcb v2

Hi. I’m needing speed output to get speed for a rate controller. Currently getting the speed out of a trimble 500. Has anyone written code for that and would be able to help me out with getting that working. I’m using pcb v2. Thanks

We have it for dual GPS setups. What are you using for GPS?

Using a ardusimple single antenna.

Is that a speed pulse signal from the Trimble or would your rate controller accept NMEA VTG?

I cannot see why such an effort to make AOG output pulses like a sensor does from a pinion or a propeller shaft or something similar. AOG would need to do it based on VTG or GGA while a simple hall sensor or a magnet and a reed relay would do it “without any conversion”.

Quite a different thing if the other box asks for NMEA, not so easy to create NMEA messages for a speed signal if just using a reed relay.

1 Like

That is just standard speed pulse from Trimble. We run through an esp32 on dual, and use the esp to output the pulse. There may be other options, but my suggestion would be to connect your ardusimple to esp32, and output that way

1 Like

The speed is sent to the autosteer board. Then 130 pulses per meter. Some simple conversations and tone will give you what you need.

2 Likes

In the version 5 ino the speed resolution is enough to implement this? It’s 0.1 km/h I think.
V4 had not enough resolution I think.

So we could use D2 or D5 as output.

Like @KentStuff said, just use tone();

I can give a try in the next days.

1 Like

1 k/h * 1000 m / k * 1 h/ 3600 sec * 130 pulses/meter

Speed in kmh * 130/ 3.6 = pulses per second.

Apparently Tone fill interfere with pin 3 and 11 on arduino?

So it will work only with Cytron and his pwm must be connected to pwm2.(Invert pin function 3 and 9)

PulsePerM = 130;

Frequency = Speed * PulsePerM / 3.6;

Ok so am using pwm 2 to wake up the Cytron. That will still work if they are switched around? Could do like @Jhmach said and use a esp32 if that would be easier. Haven’t looked to see what that would take to hook that up.

I will try to build the code tonight, it should be way easier to adapt the PCB ino than add an other esp32.

Pat, I’m interested also. Look forward to your results

Here a first (already edited :wink: )version with the radar output:Autosteer_USB_v5_0.ino (25,6 Ko)
(to copy in the folder instead the original)

PWM1 and 2 have to be inverted: PWM2 is now for the Cytron pwm.
Can make funny things with IBT(maybe).

To be tested, I’m not 100% sure about the rounding at the radarFreq (int and float)

What I added:

//define the radar pin
#define RADAR_PIN 2 //PD2

//Radar pulses variables
const uint8_t pulsePerM = 130; // number of pulses per metre
uint16_t radarFreq = 0; // frequency for the output
const uint8_t radarLoop = 10; //Number of main loops before it ticks
uint8_t radarLoopCnt = 0;

 if (radarLoopCnt >= radarLoop)
    {
      radarLoopCnt =0;
      RadarOutput();
    }
    else radarLoopCnt ++;

//Radar
void RadarOutput()
{
  //Caculate the frequency
  radarFreq = gpsSpeed*pulsePerM*10.00;
  radarFreq /= 36;

  if (radarFreq > 40) tone(RADAR_PIN, radarFreq);
  else noTone(RADAR_PIN);
}

Edit I now added a GPS speed of 0.0 when communication with AOG is lost.

Thanks I will try that.

Well I’ve finally been able to work with this a bit. The hertz fluctuates quite a bit. I tried our trimble out and I get a constant hz. Like 130 hz at 5 mph and then up and down from there. I’m getting 8v from our Dickey John rate controller so I put in a 4n35. Not totally sure how those things work but I can’t read the hz on the other side of it.

You should have voltage and ground coming from your monitor to the 4N35. The 4N35 uses the PWM from the output and closes to the circuit between the monitor voltage and ground to create pulses.

Do you need a pull up resistor on the other side of the 4n35 to get a hz reading?

I could try that.


This is the how I hooked it up.

1 Like