Trying to send AT messages via UART

Hi Forum.
I am trying to send AT messages using Arduino UNO to my OBDII-UART adaptor board (Sparkfun brand) to my J1850 PWM bus.
Cant seem to get there with the commnands at this stage.
Everything is wired up and I can do whats required using MultiEcuScan and an OBDII adaptor but stuck asking the Uno to send the code. Thanks for any advice.

#include <SoftwareSerial.h>

void setup(){
  Serial.begin(38400);
  
  Serial.println("ATZ"); //Reset the OBD-II-UART
  delay(2000);
  Serial.println("ATS1"); //SAE J1850 PWM Protocol
  delay(1000);

  Serial.flush(); //Delete any data that may be in the serial port.
}

void loop(){
//  Serial.println("ATCP18");
//  delay(200);
  Serial.println("ATSH18DA60F1"); // Bus Address 18DA60F1
  delay(200);
  Serial.println("052F559703FF"); // Data
  delay(200);

  //Serial.flush();
}

What does that mean?

  • Is the Arduino not sending anything at all?
  • Is it sending (what you think is) the right thing, but the OBDII adaptor doesn't recognise it?
  • other?

Have you tested your commands from a serial terminal?

R4? R3 (or earlier)?

Show a schematic of how you have these things connected, and some good clear photos of your setup.

They have a few - please give a link.

Have you checked Sparkfun's tutorials, examples, etc?

how ?

I noticed this in the code but you don't use it...

➜ share the details of your circuit

1 Like

Hi awneil. Thank you for your reply.
'Cant seem to get there with the commands at this stage' means I can send the AT commands ok and the Serial Monitor shows the 'ok' responses from everything except the last line which is the data 052F559703FF. that comes back using Serial Monitor as 'NO DATA' however when I monitor what MultiEcuScan outputs I see this 18DA60F1052F559703FF.
Using the AT commands data sheet it says to send the address ATSH18DA60F1 and the data as the next line, so I am stuck at that point.

What happens if you send the commands manually from a terminal?

Any help from the Sparkfun examples/tutorials?

Using an R3 Uno.
Sparkfun board https://www.sparkfun.com/products/9555
Uno Tx to Sparkfun Rx
Uno Rx to Sparkfun Tx
Uno Gnd to Sparkfun Gnd
Sparkfun J1850 connections and Gnd to OBDII port connections
Sparkfun tutorials I cant seem to find with respect to the J1850 PWM protocol

If you are using the Uno Hardware UART, you can't open the Serial Monitor or else you have three devices sharing the port. Better to use a Mega which has multiple hardware UARTs. One for Serial Monitor, one for you board.

Hi blh64. Thanks for your message.
I am only using the Serial Monitor for a test of the commands, not via the Uno too.

That does not make sense. If your Uno is plugged into your PC so you can communicate with the Serial Monitor, it is using the UART. Or do you mean you are sending the commands to the Serial Monitor without the Sparkfun board connected?

1 Like

I am sending using the Serial.println commands from which I can see the RX and TX of the Uno and the Sparkfun board illuminate. However now you ask I can also see what I am sending on the Serial Monitor (as my PC is powering the Uno board) at the same time which I find odd ! Why indeed should that happen. I was expecting the commands only to be sent via the Sparkfun. Confusion reigns !

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