ELM327 with Arduino direct connect with SoftwareSerial


I want to connect my Arduino Uno (or just a ATMEGA328) with an ELM327 (cheap version but with bluetooth Module).

Now I desoldered the bluetooth module and connected Wires to RX/TX just like in the pictures. I've got the Idea from a Youtube video but he did not posted his code sadly...

I also tried this code:

#include <SoftwareSerial.h>
#include "ELMduino.h"

SoftwareSerial mySerial(2, 3); // RX, TX
#define ELM_PORT mySerial

ELM327 myELM327;
uint32_t rpm = 0;

void setup()
  digitalWrite(LED_BUILTIN, HIGH);


  Serial.println("Attempting to connect to ELM327...");

  if (!myELM327.begin(ELM_PORT))
    Serial.println("Couldn't connect to OBD scanner");
    while (1);

  Serial.println("Connected to ELM327");

void loop()
  float tempRPM = myELM327.rpm();
  if (myELM327.status == ELM_SUCCESS)
    rpm = (uint32_t)tempRPM;
    Serial.print("RPM: "); Serial.println(rpm);
    Serial.print(F("\tERROR: "));

I've got the ELMduino library ofc and I also tried this code:

#include <Arduino.h>

#include <Wire.h>

#include <SoftwareSerial.h>
String inputString = "";         // a string to hold incoming data
SoftwareSerial softwareSerial(8, 9);
int  serIn;
char serInString[100];  // array that will hold the different bytes  100=100characters;
                        // -> you must state how long the array will be else it won't work.
int  serInIndx  = 0;    // index of serInString[] in which to insert the next incoming byte
int  serOutIndx = 0;    // index of the outgoing serInString[] array;
//This is a character buffer that will store the data from the serial port
char rxData[20];
char rxIndex=0;
//Variables to hold the speed and RPM data.
int vehicleSpeed=0;
int vehicleRPM=0;

void setup()

void readOBD() {
     char inChar;
  String rec = "[";
 // only if there are bytes in the serial buffer execute the following code
  if(softwareSerial.available()) {    
    //keep reading and printing from serial untill there are bytes in the serial buffer
     while (softwareSerial.available()>0){
        inChar = softwareSerial.read();  //read Serial        
         if(inChar == '\r' || inChar == '\n') break;
        rec += String(inChar);
     rec += "]";
     if(rec.length() > 4) 
     else {
       rec = "";

void loop()

I'am also more than sure that I have to use the ELM327 chip for my car and I also have sucessfully connected one like 1 year ago but with a MCP2515 and a Renault Twingo. Now I've got a Renault Clio 5 (2020) and it uses the ELM327 with the CAN protocol. Found it on this site: OBD-2 Liste (erfolgreich) gescannter Fahrzeuge

So after hours of googling and trying is my last chance to ask in this forum for help :frowning: I also could try to connect the ELM327 via bluetooth but I'm pretty sure there will be a delay in the transfer via bluetooth and in the end I want to build a REV limiter and a shifting light. I just need to know how I can connect to the ELM327 via Serial connection. I hope you can help!

I know, that cheap (chinese) ELM327 copies, does not all support CAN Bus.
They only have K-Line, which several manufacturers also support. But not all!

The software also was copied or somehow rebuild on the well documented ELM327, but several functions are missing!
Like redefining the init process, changing the keepalive messages and so on.

First thing: Try to use the stock ELM327 to connect to your renault. Just to proove it works properly!
If not available, try another car, where you are sure, it worked before!

Then I¬īd consider to stay on the bluetooth approach.
First of all, you are more flexible. Then I get around 15-20 Messages per second from my VW. Which is faster then you can/should show numbers on a LED matrix.
Also you should not attach modified devices to the diagnostic port. It¬īs quite sensible and the voltage from the board net, is quite noisy. Often, too noisy for an Arduino.

Beside of that: Your code won¬īt work.
You are sending out data, block your Arduino with a delay and do not read any response.
Then repeat it several times, only god knows what is now in the software serial buffer, and then you wait for 5 seconds, until the ECU will timeout (due to a min 2 second mandatory keepalive message).
println sends a Carriage Return and Linfeed. CR will be enough.
Are you sure about the internal baudrate of 38400?

I can only recommend to do one step by another and not everything at once!

1 Like

Try this: https://www.instructables.com/Arduino-OBD2-ELM327-I2C-LCD-HC05-Bluetooth/

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