How do I interface Speed Radar with Arduino?

I have an Arduino Uno that I have (possibly incorrectly) wired up to an AGD-331 Speed Radar Sensor ( https://www.agd-systems.com/wp-content/uploads/2017/02/product-manual-331.pdf ).

Currently, I'm trying to read the data from the RX pin and print out the data.

The radar has been configured to print out test values of 88KM/H - I can change that setting manually but currently, I can't even read the values that the sensor is outputting at all.

The sensor is 100% functional. I have tested it.

Please advise what could be going wrong.

void setup() {
  Serial.begin(115200);
  delay(1000);
}

void loop() {
  if (Serial.available() > 0) {
    String c = String(Serial.read());
    Serial.println(c + "KM/H);
  }
  delay(1000);
}

Ports of Sensor in Image:
Pin 1: Positive
Pin 2: Negative
Pin 3: TX
Pin 4: RX
Pin 7: GND
Sensor wired up to an external battery.

If you wanna get some serial messages on your PC (for debug and/or monitoring, or even commands) you can't/shouldn't use hardware UART pins 0 and 1 because in this case the Serial.println() is sending it also to the radar (don't know if this is good or not for such device as I don't know it).

If the communication can be slowed down to 38400 baud or below, like 19200 or even 9600 (the manual says you can do it, and I don't think that radar requires higher speeds), you could connect it via a couple of "SoftwareSerial" pins (maybe just the TX pin from it), so as to keep 0 and 1 free for PC communication.

I hope not, but if for any reason you don't wanna slow it down, you can't use the single internal UART for both the radar and PC communication, so don't use the "Serial" for anything else than radar (aka: can't have any PC messages from the USB).

If you still need PC debug/monitoring (it's usually a good thing to keep) you could either use a Mega (it has three UARTs) or an Uno R4 (I haven't used any yet, but as far as I know its UART and USB communications are separated).

The serial output of the radar is RS232.
RS232 uses voltages of +3 to +15 volts and −3 to −15 volts, and should not be connected directly to an Arduino UART interface.

You need to use an RS232 to UART converter to connect the radar to an Arduino. This is mentioned on page 9 of the manual:

The signal levels are wrong, and the signal needs inverting before connecting to an Arduino.

How would I connect that to the current setup?

I should've added this to the post but I'm relatively new to Arduino's etc.
So please have mercy on me lol

That lead shown in the manual is for connecting the radar to a PC using USB.

For connecting to Arduino, you would need a differant converter such as the following:


Search for RS232 to UART, or RS232 to TTL converter.

The RS232 output of the radar connects to the 9 pin D connector, and the Arduino connects to the 4 pins for GND, RXD, TXD and VCC.

You're right, I missed to check that specification, assuming it was a plain 5V serial, my fault.
This is an example:

By the way, the other considerations are still alive, starting from the speed setting and the usage of SoftwareSerial (or change board).

I have a MAX232. I just don't know where to start in connecting it into my circuit. Could you please advise.

Just start googling "Arduino MAX232 schematics" to find something like:
https://diyodemag.com/education/the_classroom_rs232_the_max232_ic_arduino_uno

Here you'll find the circuit:
image

Then you just need to connect RX/TX of the adapter to the pins you configure with SoftwareSerial after setting the radar interface to 19200 baud (as an example but don't try SoftwareSerial above 38400 because it isn't reliable), instead of shown pins 0 and 1, and you can start testing.

Just buy the adapter if you are not sure

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